I am studying how to create a Proxmox-Microk8s workflow. I can deploy basic apps with my yaml, like Wekan or Wordpress. I cannot deploy a custom image from a registry. It's the most basic npm create vite@latest app with no custom code at all. I can build, tag, and push to the registry, but deployment always fails with ErrImagePull. Below are the steps I've taken to try to diagnose why, for the built-in Microk8s registry and the result of each.
The image is listed in the Microk8s built-in registry:
Command: curl http://localhost:32000/v2/_catalog
Response: {"repositories":["my-test-app","nginx"]}
The tag looks valid:
Command: curl http://localhost:32000/v2/my-test-app/tags/list
Response: {"name":"my-test-app","tags":["latest"]}
Examining its manifest reports no error:
Command: curl -I -X GET http://localhost:32000/v2/my-test-app/manifests/latest
Response (abbreviated): HTTP/1.1 200 OK
I can pull and run the image from this registry to another PC Works on another node form the kube cluster Works on Docker for Windows; same local network, but not part of proxmox or kube clusters
I believe my deployment yaml is as simple as possible:
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: my-namespace
name: my-deployment
labels:
app: my-test-app
spec:
replicas: 1
selector:
matchLabels:
app: my-test-app
template:
metadata:
labels:
app: my-test-app
spec:
containers:
- name: my-test-app
image: 10.0.0.144:32000/my-test-app:latest # also tried `localhost:32000/my-test-app:latest`
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
namespace: my-namespace
name: my-deployment-service
spec:
selector:
app: my-test-app
ports:
- protocol: TCP
port: 80
targetPort: 80
type: ClusterIP
Applying the yaml appears successful:
Command: sudo microk8s kubectl apply -f deploy-my-test-app.yaml
Response: deployment.apps/my-deployment created service/my-deployment-service unchanged
The deployment reports the error:
Command: sudo microk8s kubectl get pods -n my-namespace
Response: my-deployment-69fcdbb744-z8t6t 0/1 ImagePullBackOff
Investigating the errors:
Command: sudo microk8s kubectl describe pod abbriviated...
Responses (abbriviated):
- Warning FailedCreatePodSandBox 3m12s kubelet Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "..." : plugin type="calico" failed (add): error getting ClusterInformation: Get "https://10.152.183.1:443/apis/crd.projectcalico.org/v1/clusterinformations/default": dial tcp 10.152.183.1:443: connect: connection refused
- I have no idea what this could be. I have not done any "custom tweaks" to the Microk8s install.
- Warning Failed 2m14s kubelet Failed to pull image "localhost:32000/my-test-app:latest": failed to pull and unpack image "localhost:32000/my-test-app:latest": failed to read expected number of bytes: unexpected EOF
- As previously stated: I can pull and run this image on other OS's (made sure to also test on one that didn't origianlly push the image, to make sure it wasn't cached)
- Warning FailedCreatePodSandBox 3m12s kubelet Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "..." : plugin type="calico" failed (add): error getting ClusterInformation: Get "https://10.152.183.1:443/apis/crd.projectcalico.org/v1/clusterinformations/default": dial tcp 10.152.183.1:443: connect: connection refused
I also observe the same error when trying to use a Portainer/ GitLab registry (though I have done less investigation to the cause of that scenario).
Ultimately, I intend to expose this to Cloudflared with an ingress. This is my attempt to get the basic build-tag-push-deploy workflow operational. Any advice would be greatly appreciated.