Loading [MathJax]/jax/output/CommonHTML/jax.js
본문 바로가기
카테고리 없음

The connection to the server was refused - did you specify the right host or port? 해결방법

by tankwoong 2023. 10. 26.
반응형

cilium을 설치하려고 했는데 계속해서 연결이 거부되었다고 나왔다.

구글링 하다보니 kubectl 문제라는 것을 알게 되었다.

 

kubectl get node 했을 때도 연결이 안됬다고 

Swap을 꺼줍니다.

root@master:~# swapoff -a
root@master:~# sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab
root@master:~# kubectl  version
Client Version: v1.28.2
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
The connection to the server 192.168.2.10:6443 was refused - did you specify the right host or port?
root@master:~# strace -eopenat kubectl version

kubectl version 명령을 실행할 때 openat 시스템 호출을 추적합니다. openat 시스템 호출은 파일 또는 디렉토리를 여는 데 사용됩니다.

이 명령을 사용하여 kubectl version 명령이 어떤 파일 또는 디렉토리를 여는지 확인할 수 있습니다. 이 정보는 kubectl 명령이 어떻게 작동하는지 이해하고 문제를 해결하는 데 도움이 될 수 있습니다.

 

export KUBECONFIG=/etc/kubernetes/admin.conf

반응형