kubekey icon indicating copy to clipboard operation
kubekey copied to clipboard

Allinone: kubectl unable to connect to the server: x509: certificate signed by unknown authority

Open chaunceyjiang opened this issue 2 years ago • 6 comments

What is version of KubeKey has the issue?

master

What is your os environment?

deepin 15.11

KubeKey config file

sudo ./kk create cluster --with-kubernetes v1.21.5  --yes --container-manager docker  --with-local-storage --with-kubesphere v3.2.1

A clear and concise description of what happend.

Unable to connect to the server: x509: certificate signed by unknown authority (possibly because of "crypto/rsa: verification error" while trying to verify candidate authority certificate "kubernetes")

image

Relevant log output

Unable to connect to the server: x509: certificate signed by unknown authority (possibly because of "crypto/rsa: verification error" while trying to verify candidate authority certificate "kubernetes")

Additional information

No response

chaunceyjiang avatar Dec 23 '21 11:12 chaunceyjiang

I had similar issue installing Air-gapped installation

https://kubesphere.io/docs/installing-on-linux/introduction/air-gapped-installation/

I temporarily solved it by using:

-subj "/CN=dockerhub.alitech.local" -addext "subjectAltName = DNS:dockerhub.alitech.local"

This is complete command: openssl req -newkey rsa:4096 -nodes -sha256 -keyout certs/domain.key -subj "/CN=dockerhub.alitech.local" -addext "subjectAltName = DNS:dockerhub.alitech.local" -x509 -days 36500 -out certs/domain.crt

SFARPak avatar Dec 25 '21 10:12 SFARPak

For now, a solution:

cp /etc/kubernetes/admin.conf $HOME/.kube/config

24sama avatar Dec 25 '21 12:12 24sama

And this issue can be a good-first-issue.

/good-first-issue

24sama avatar Dec 25 '21 12:12 24sama

@24sama: This request has been marked as suitable for new contributors.

Please ensure the request meets the requirements listed here.

If this request no longer meets these requirements, the label can be removed by commenting with the /remove-good-first-issue command.

In response to this:

And this issue can be a good-first-issue.

/good-first-issue

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.

ks-ci-bot avatar Dec 25 '21 12:12 ks-ci-bot

/assign

zaunist avatar Aug 17 '22 08:08 zaunist

[WeOpen Star]I would like to help

zaunist avatar Aug 17 '22 08:08 zaunist