
나는 간단한 클러스터 Debian VM을 사용하여 debian minikube를 성공적으로 설정했습니다.
umen@debian12:~$ kubectl get pods
NAME READY STATUS RESTARTS AGE
hello-77c947d946-jq2s4 1/1 Running 0 45m
hello-77c947d946-wm6n2 1/1 Running 0 45m
umen@debian12:~$ minikube service list -p multinode-demo
|-------------|------------|--------------|---------------------------|
| NAMESPACE | NAME | TARGET PORT | URL |
|-------------|------------|--------------|---------------------------|
| default | hello | 80 | http://192.168.49.2:31000 |
| default | kubernetes | No node port | |
| kube-system | kube-dns | No node port | |
|-------------|------------|--------------|---------------------------|
umen@debian12:~$ curl http://192.168.49.2:31000
Hello from hello-77c947d946-wm6n2 (10.244.1.2)
무엇보다도 작동하는 것을 볼 수 있듯이
이제 내 Windows 호스트에서 이 클러스터를 연결하려고 합니다. 데비안 서버에서 인증서를 다운로드했습니다.
vi ./kube/config_debian
apiVersion: v1
clusters:
- cluster:
certificate-authority: debian/ca.crt
extensions:
- extension:
last-update: Mon, 23 Oct 2023 08:54:23 IDT
provider: minikube.sigs.k8s.io
version: v1.31.2
name: cluster_info
server: https://192.168.49.2:8443
name: minikube
contexts:
- context:
cluster: minikube
extensions:
- extension:
last-update: Mon, 23 Oct 2023 08:54:23 IDT
provider: minikube.sigs.k8s.io
version: v1.31.2
name: context_info
namespace: default
user: minikube
name: minikube
current-context: minikube
kind: Config
preferences: {}
users:
- name: minikube
user:
client-certificate: debian/client.crt
client-key: debian/client.key
연결하려고 하면 다음과 같은 결과가 나타납니다.
$ kubectl -v=8 --kubeconfig=config_debian get pods
I1023 10:55:55.058414 16936 loader.go:372] Config loaded from file: config_debian
I1023 10:55:55.154616 16936 cert_rotation.go:137] Starting client certificate rotation controller
I1023 10:55:55.154616 16936 round_trippers.go:432] GET https://192.168.49.2:8443/api?timeout=32s
I1023 10:55:55.155136 16936 round_trippers.go:438] Request Headers:
I1023 10:55:55.155136 16936 round_trippers.go:442] Accept: application/json, */*
I1023 10:55:55.155136 16936 round_trippers.go:442] User-Agent: kubectl.exe/v1.22.0 (windows/amd64) kubernetes/c2b5237
I1023 10:56:16.186405 16936 round_trippers.go:457] Response Status: in 21031 milliseconds
I1023 10:56:16.186405 16936 round_trippers.go:460] Response Headers:
I1023 10:56:16.186405 16936 cached_discovery.go:121] skipped caching discovery info due to Get "https://192.168.49.2:8443/api?timeout=32s": dial tcp 192.168.49.2:8443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
I1023 10:56:16.188079 16936 round_trippers.go:432] GET https://192.168.49.2:8443/api?timeout=32s
I1023 10:56:16.188079 16936 round_trippers.go:438] Request Headers:
I1023 10:56:16.188079 16936 round_trippers.go:442] Accept: application/json, */*
I1023 10:56:16.188079 16936 round_trippers.go:442] User-Agent: kubectl.exe/v1.22.0 (windows/amd64) kubernetes/c2b5237
I1023 10:56:37.192081 16936 round_trippers.go:457] Response Status: in 21003 milliseconds
I1023 10:56:37.192189 16936 round_trippers.go:460] Response Headers:
I1023 10:56:37.192189 16936 cached_discovery.go:121] skipped caching discovery info due to Get "https://192.168.49.2:8443/api?timeout=32s": dial tcp 192.168.49.2:8443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
I1023 10:56:37.193955 16936 shortcut.go:89] Error loading discovery information: Get "https://192.168.49.2:8443/api?timeout=32s": dial tcp 192.168.49.2:8443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
I1023 10:56:37.194510 16936 round_trippers.go:432] GET https://192.168.49.2:8443/api?timeout=32s
I1023 10:56:37.194510 16936 round_trippers.go:438] Request Headers:
I1023 10:56:37.195088 16936 round_trippers.go:442] Accept: application/json, */*
I1023 10:56:37.195088 16936 round_trippers.go:442] User-Agent: kubectl.exe/v1.22.0 (windows/amd64) kubernetes/c2b5237
문제는 원격 클러스터에 연결할 수 없는 이유입니다.
답변1
에 따라Github 문제 #2575, 아래 설명에 따라 연결 문제 및 완화의 원인을 확인하세요.
Docker Toolbox(VirtualBox를 사용하는 이전 버전)와 Windows용 Docker(Hyper-V 사용)를 모두 설치하는 데 문제가 있을 수 있는지 확인하세요. Docker Toolbox를 제거하고 Windows용 Docker를 다시 설치하면 문제를 해결하는 데 도움이 될 수 있습니다.
서버 리소스가 부족한지 확인하세요. 보내는 요청 수를 처리할 만큼 서버 리소스(예: 메모리)가 충분한지 확인하세요.
인증 측면에서 아래 2단계를 시도하고 설명서를 따르세요.검증되지 않은 minikube TLS문제를 추가로 해결하는 데 도움이 될 수 있습니다.
virtualbox의 호스트 8443에서 Minikube vm 8443으로 포트 전달 설정
TLS 확인 없이 새 컨텍스트 minikube-vpn을 생성합니다.