How to use harbor Private Warehouse in kubernetes
Kubernetes in how to use harbor private warehouse, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.
Preset
Copy the ca.crt of harbor to the / etc/docker/certs.d/harbor.test.com:6443 directory of node
Cp ca.crt / etc/docker/certs.d/harbor.test.com:6443/
The secret to be used to create Pod pull image
Kubectl create secret docker-registry my-harbor-secret-docker-server=harbor.test.com:6443-docker-username=-docker-password=-docker-email=-namespace=harbor-test
Secret is only valid under default namespace by default. If you do not add-- namespace, the secret cannot be used by non-default namespace, and the failure to pull the image will be displayed.
Failed to pull image "harbor.test.com:6443/test/test-secret:latest": rpc error: code = Unknown desc = Error response from daemon: pull access denied for harbor.test.com:6443/test/test-secret:latest, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
Create a Pod private-reg-pod.yaml for testing
ApiVersion: v1kind: Podmetadata: name: private-reg namespace: harbor-testspec: containers:-name: private-reg-container image: harbor.test.com:6443/test/test-secret:latest imagePullSecrets:-name: my-harbor-secretkubectl create-f private-reg-pod.yaml, is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.