Reputation: 25984
I have a private registry running and I can do a normal deploy, but when using knative I get errors.
The registry is running with basic authentication, user and password. I have configured each node(containerd) to use this insecure-registry.
I have found this and added
Why is knative
kubectl create secret docker-registry container-registry \
--docker-server=http://<ip>:5000 \
--docker-email=\
--docker-username=name \
--docker-password=password
and:
kubectl patch serviceaccount default -p "{\"imagePullSecrets\": [{\"name\": \"container-registry\"}]}"
And added to the service:
spec:
template:
spec:
imagePullSecrets:
- name: container-registry
But I am still getting errors: kubectl describe ksvc helloworld-go
note it is looking for https
Message: Revision "helloworld-go-00001" failed with message: Unable to fetch image "<ip>:5000/demo": failed to resolve image to digest: Get "https://<ip>:5000/v2/": http: server gave HTTP response to HTTPS client.
I can do:
kubectl run test --image=<ip>:5000/demo
and the pod is running.
I tought that if I waas able to pull from a normal deployment, why can I not using knative?
Upvotes: 0
Views: 807
Reputation: 21
I had the same issue. It seems knative does an extra step to resolve the image digest for revision handling so it tries to connect to the registry and it's not able to. That's why a normal deployment works.
I found a workaround which is to send the digest with the image name in the yaml files.
You can get the digest by executing:
docker image ls --digests
Then add the digest to the value of the image field:
image=localhost:5001/my-image:tag@sha256:9eb50ab0a4f8a9408a46bb89c18df9a5f5d2bd96724a845401840955e056ced1
I couldn't find any other solution yet.
PLG.
Edit: I found another solution: Disable digest resolution for your local registry.
Execute: kubectl -n knative-serving edit configmap config-deployment
And edit the file to add disable tag resolution:
data:
registries-skipping-tag-resolving: localhost:5001
without adding the port it didn't work for me.
Upvotes: 0