0

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.

1 Answer 1

0

Your configuration and approach looks solid. I guess the problems is that the k8s is not running on top of Docker but something else (its own container runtime)

Try deploying an image from Docker Hub and look after the deployment (docker ps) if you can see it.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.