2개의 마스터 노드와 3개의 작업자 노드가 있는 Kubernetes 클러스터가 있습니다. 또한 별도의 클러스터도 있습니다.하프록시서버공개 IP.
기본적으로 kubeadm은 클러스터에 필요한 모든 인증서를 생성하고 /etc/kubernetes/pki에 인증서를 저장합니다.
문서에 따라 하나 이상의 사용자 정의 인증서와 관련 키를 /etc/kubernetes/pki에 배치하고 실행할 수 있습니다.kubeadm 초기화나머지 인증서를 생성하는 명령입니다.https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/kubeadm-certs/
클러스터가 이미 실행 중이고 실행 중인 init 명령이 실행 전 오류와 함께 실패합니다.
그래서 아래 단계에 따라 인증서와 Kubernetes 구성을 생성했습니다.
cd /etc/kubernetes/pki/
sudo rm ca.key ca.crt
sudo openssl genrsa -out ca.key 2048
sudo openssl req -x509 -new -nodes -key ca.key -subj "/CN=My Local CA" -days 10000 -out ca.crt
sudo kubeadm init phase certs all --control-plane-endpoint "haproxy_IP:6443"
cd /etc/kubernetes/
sudo rm admin.conf controller-manager.conf kubelet.conf scheduler.conf
sudo kubeadm init phase kubeconfig all --control-plane-endpoint "haproxy_IP:6443"
sudo rm $HOME/.kube/config
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
이제 오류가 발생합니다.
kubectl은 노드를 얻습니다
Error from server (InternalError): an error on the server ("") has prevented the request from succeeding
openssl s_client -connect haproxy_IP:6443
CONNECTED(00000005)
write:errno=0
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 0 bytes and written 315 bytes
Verification: OK
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
Early data was not sent
Verify return code: 0 (ok)
kubectl get node --v=7
09:41:50.597844 31816 request.go:943] Got a Retry-After 1s response for attempt 8 to https://haproxy_IP:6443/api?timeout=32s
09:41:51.598061 31816 round_trippers.go:422] GET https://haproxy_IP:6443/api?timeout=32s
09:41:51.598112 31816 round_trippers.go:429] Request Headers:
09:41:51.598219 31816 round_trippers.go:433] Accept: application/json, */*
09:41:51.598504 31816 round_trippers.go:433] User-Agent: kubectl/v1.20.4 (linux/amd64) kubernetes/e87da0b
09:41:51.602249 31816 round_trippers.go:448] Response Status: in 3 milliseconds
09:41:51.602301 31816 request.go:943] Got a Retry-After 1s response for attempt 9 to https://haproxy_IP:6443/api?timeout=32s
09:41:52.602523 31816 round_trippers.go:422] GET https://haproxy_IP:6443/api?timeout=32s
09:41:52.602558 31816 round_trippers.go:429] Request Headers:
09:41:52.602572 31816 round_trippers.go:433] User-Agent: kubectl/v1.20.4 (linux/amd64) kubernetes/e87da0b
09:41:52.602585 31816 round_trippers.go:433] Accept: application/json, */*
09:41:52.605922 31816 round_trippers.go:448] Response Status: in 3 milliseconds
09:41:52.605980 31816 request.go:943] Got a Retry-After 1s response for attempt 10 to https://haproxy_IP:6443/api?timeout=32s
09:41:53.606187 31816 round_trippers.go:422] GET https://haproxy_IP:6443/api?timeout=32s
09:41:53.610028 31816 round_trippers.go:429] Request Headers:
09:41:53.610048 31816 round_trippers.go:433] Accept: application/json, */*
09:41:53.610059 31816 round_trippers.go:433] User-Agent: kubectl/v1.20.4 (linux/amd64) kubernetes/e87da0b
09:41:53.612676 31816 round_trippers.go:448] Response Status: in 2 milliseconds
09:41:53.612837 31816 cached_discovery.go:121] skipped caching discovery info due to an error on the server ("") has prevented the request from succeeding
09:41:53.613146 31816 helpers.go:216] server response object: [{
"metadata": {},
"status": "Failure",
"message": "an error on the server (\"\") has prevented the request from succeeding",
"reason": "InternalError",
"details": {
"causes": [
{
"reason": "UnexpectedServerResponse"
}
],
"retryAfterSeconds": 1
},
"code": 500
}]
F0413 09:41:53.613294 31816 helpers.go:115] Error from server (InternalError): an error on the server ("") has prevented the request from succeeding
만약 내가초기화이전 인증서 및 구성 파일과 함께 새 인증서 및 구성 파일을 만든 다음 모든 것잘 작동해요아무 문제 없이.
그래서 나는 내 접근 방식에 뭔가 빠진 것이 있다고 생각합니다.
이 문제와 관련된 아이디어나 유사한 경험에 감사드립니다.