-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can't use insecure registry when use kubectl apply #9371
Comments
Hi, you may provide your own You may need to check your private registry certificates location and validity (harbor registry, docker client) |
Thank you for reply. It seems that the insecure_skip_verify flag works during cluster setup process and command line with nerdctl but not kubectl apply. this is very strange. By the way, with regard to the error[x509: certificate relies on legacy Common Name field, use SANs instead], I have reissue the certificated for harbor's IP, now the error is : [failed to do request: Head "https://10.25.6.13/v2/library/centos/manifests/centos7": x509: certificate signed by unknown authority]. the problem is that with [insecure_skip_verify=true], they should pull the images with auth without validating the ssl certificates. |
we fixed the problem, the root cause is that [insecure_skip_verify=true] config does not work. here is the config about insecure registries for containerd.
The rendered /etc/containerd/config.toml contains:
but it needs to be:
I fixed the problem by modifing the template file: roles/container-engine/containerd/templates/config.toml.j2
it seems that #9207 does not fix the problem about insecure registries for containerd. Registry Endpoint
for the registry endpoint located at https://my.custom.registry, the registry.configs should specify the registry host my.custom.registry not the whole endpoint format: https://my.custom.registry.
|
Great work! Perhaps you can submit your patching to the PR. |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close not-planned |
@k8s-triage-robot: Closing this issue, marking it as "Not Planned". In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Environment:
Cloud provider or hardware configuration:
bare-metal
OS (
printf "$(uname -srm)\n$(cat /etc/os-release)\n"
):Linux 5.4.212-1.el7.elrepo.x86_64 x86_64
CentOS Linux release 7.8.2003 (Core)
Version of Ansible (
ansible --version
):ansible [core 2.12.5]
Version of Python (
python --version
):Python 3.10.6
Kubespray version (commit) (
git rev-parse --short HEAD
):425e202 (release-2.20)
Network plugin used:
calico
Command used to invoke ansible:
ansible-playbook -i inventory/sample/hosts.yaml --become --become-user=root cluster.yml
we deployed the kubernetes with containerd+offlinerepo+insecure registry, we can setup the k8s cluster successfully, but when use kubectl apply to test some simple kubernetes manifests, it can not work.
config of offline Private Container Image Registry is:
registry_host: "10.25.x.x"
the output of describe pod:
Failed to pull image "10.25.x.x/library/centos:centos7": rpc error: code = Unknown desc = failed to pull and unpack image "10.25.x.x/library/centos:centos7": failed to resolve reference "10.25.x.x/library/centos:centos7": failed to do request: Head "https://10.25.x.x/v2/library/centos/manifests/centos7": x509: certificate relies on legacy Common Name field, use SANs instead
Error: ErrImagePull
Error: ImagePullBackOff
the config of insecure registry is :
containerd_insecure_registries:
"10.25.x.x:80": "http://10.25.x.x:80"
containerd_registry_auth:
username: admin
password: xxxx
when I test the following command on one the master node, and we can see the warning message WARN[0015] skipping verifying HTTPS certs for "10.25.x.x" . everything is ok as expected. pull Succeeded and Login Succeeded
/usr/local/bin/nerdctl pull 10.25.x.x/library/centos:centos7
/usr/local/bin/nerdctl login 10.25.x.x
/usr/local/bin/nerdctl login 10.25.x.x:443
my question is that: what is the difference between the process of kubectl apply and the process of setup cluster (including nerdctl directly) to pull images? and how to fix the issue.
The text was updated successfully, but these errors were encountered: