I'm new to kubernetes, and after successfully creating my first cluster with a single node (On debian 12), I am trying to deploy my first application, a simple hello world in python. I use Kudeadm.
I have created a simple docker image, and push it to a local registry. My registry is only accessible in local, and is not secure. Using only docker, I can pull the image after adding
{"insecure-registries": ["192.168.0.102:5005"]} to /etc/docker/daemon.json.
The problem is when I try to create a kubernetes deployment using :
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-python-app
labels:
app: my-python-app
spec:
replicas: 1
selector:
matchLabels:
app: my-python-app
template:
metadata:
labels:
app: my-python-app
spec:
containers:
- name: my-python-app
image: 192.168.0.102:5005/my-python-app
ports:
- containerPort: 8080
I get the following error :
Failed to pull image "192.168.0.102:5005/my-python-app": failed to pull and unpack image "192.168.0.102:5005/my-python-app:latest": failed to resolve reference "192.168.0.102:5005/my-python-app:latest": failed to do request: Head "https://192.168.0.102:5005/v2/my-python-app/manifests/latest": http: server gave HTTP response to HTTPS client
Which seems to be an error about the insecure registry, even though my docker config should allow it.
I have tried to enable insecure registry in /etc/docker/daemon.json, /etc/default/docker.json and add it to DOCKER_OPTS, but with the same result.