minikube 인증서 교체
https://velog.io/@squarebird/Docker%EC%99%80-%EC%9D%B8%EC%A6%9D%EC%84%9C-22
Docker와 인증서 (2/2)
앞의 글에서 설명드렸던 것 처럼 인증서가 신뢰할 수 있다는 것을 증명하기 위해서는 인증서 체인을 통해 해당 인증서의 Root 인증서를 찾을 수 있어야 합니다.그렇다면 Docker에 올라갈 컨테이너
velog.io
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.
TLS 인증서 (3) - openssl 을 통해 key, csr, crt 파일 만들기
*명령어는 최하단에 별도로 정리하였습니다. 이번에는 실제 명령어를 사용하여 key, csr, crt 파일을 생성해본다. 1. key 파일 생성 먼저 비대칭 암호화 통신에 사용되는 개인키(비밀키)를 생성한다.
trylhc.tistory.com
https://www.openssl.org/docs/manmaster/man5/x509v3_config.html
/docs/manmaster/man5/x509v3_config.html
x509v3_config NAME x509v3_config - X509 V3 certificate extension configuration format DESCRIPTION Several OpenSSL commands can add extensions to a certificate or certificate request based on the contents of a configuration file and CLI options such as -add
www.openssl.org
https://velog.io/@squarebird/Docker%EC%99%80-%EC%9D%B8%EC%A6%9D%EC%84%9C-22
Docker와 인증서 (2/2)
앞의 글에서 설명드렸던 것 처럼 인증서가 신뢰할 수 있다는 것을 증명하기 위해서는 인증서 체인을 통해 해당 인증서의 Root 인증서를 찾을 수 있어야 합니다.그렇다면 Docker에 올라갈 컨테이너
velog.io
https://kdev.ing/windows-certlm/
윈도우 환경에서 사설 루트 CA 인증서 등록하는 방법
윈도우 운영체제 환경에서 사설로 만들어진 루트 CA 인증서를 컴퓨터 인증서의 신뢰할 수 있는 루트 기관으로 등록할 수 있는 방법은 두가지가 있다. 첫번째로는 MMC(certlm.msc) 프로그램의 인증서
kdev.ing
https://kubernetes.io/docs/reference/access-authn-authz/authentication/#static-token-file
Authenticating
This page provides an overview of authentication. Users in Kubernetes All Kubernetes clusters have two categories of users: service accounts managed by Kubernetes, and normal users. It is assumed that a cluster-independent service manages normal users in t
kubernetes.io
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