2024. 2. 16. 21:56ㆍ카테고리 없음
https://velog.io/@squarebird/Docker%EC%99%80-%EC%9D%B8%EC%A6%9D%EC%84%9C-22
minikube가 설치된 PC가 아닌, proxy를 써서 remote에서 접근할 경우 아래와 같은 에러가 발생함
인증서를 proxy-client.crt/proxy-client.key를 사용해도 동일한 증상 발생함
인증서를 apiserver.crt/apiserver.key를 사용해도 동일한 증상 발생함
proxy-client.crt/proxy-client.key는 minikube가 설치된 PC에서 kubectl 명령을 하면, 인증정보가 없다고 뜸
E0216 21:48:29.240621 12512 memcache.go:238] couldn't get current server API group list: Get "https://{minikube가 설치된 PC의 IP}:8443/api?timeout=32s": x509: cannot validate certificate for {minikube가 설치된 PC의 IP} because it doesn't contain any IP SANs
그래서, IP 제약이 없는 인증서를 새로 만들어서 이 문제를 해결하려고 함
# 기존 인증서 백업
cat /home/{계정}/.kube/config
-------------------------------
clusters:
- cluster:
certificate-authority: /home/{계정}/.minikube/ca.crt
생략
users:
- name: minikube
user:
client-certificate: /home/{계정}/.minikube/profiles/minikube/client.crt
client-key: /home/{계정}/.minikube/profiles/minikube/client.key
-------------------------------
cd /home/{계정}/.minikube
Trouble Shooting
- WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!
known_hosts 파일을 열어서 {서버 IP}에 해당하는 IP 정보 삭제
또는 'ssh-keyscan -t rsa {서버 IP}' 명령으로 키값을 생성하여 값을 강제로 넣을 수도 있음
# 에러
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ED25519 key sent by the remote host is
SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.
Please contact your system administrator.
Add correct host key in C:\\Users\\{계정}/.ssh/known_hosts to get rid of this message.
Offending RSA key in C:\\Users\\:{계정}/.ssh/known_hosts:10
Host key for {서버 IP} has changed and you have requested strict checking.
Host key verification failed.
https://www.openssl.org/docs/manmaster/man5/x509v3_config.html
https://velog.io/@squarebird/Docker%EC%99%80-%EC%9D%B8%EC%A6%9D%EC%84%9C-22
https://kdev.ing/windows-certlm/
https://kubernetes.io/docs/reference/access-authn-authz/authentication/#static-token-file
openssl genrsa -out server.key 2048
openssl req -new -key server.key -out server.csr
openssl x509 -req -days 365 -in server.csr -CA ca.crt -CAkey ca.key -out server.crt -extfile server.conf
openssl x509 -in server.crt -nout -text
kubectl get pods -v=10