작성
·
809
·
수정됨
1
Kubernetes Cluster 설치 v1.22를보고 설치 하였는데,
설치 후 master node에 join하는 과정에서 join.sh파일은 생서되었으나 내용물이 없고, kubectl명령어를 써보면
The connection to the server localhost:8080 was refused - did you specify the right host or port?
에러가 뜹니다. 신속하게 해결 하고 싶은데 답변 부탁드립니다.
참고로 vagrant up 실행시 아래와 같은 에러가 발생됩니다
==> k8s-master: Running provisioner: shell...
k8s-master: Running: inline script
k8s-master: I0329 11:04:29.670608 14429 version.go:255] remote version is much newer: v1.26.3; falling back to: stable-1.22
k8s-master: [init] Using Kubernetes version: v1.22.17
k8s-master: [preflight] Running pre-flight checks
k8s-master: [preflight] WARNING: Couldn't create the interface used for talking to the container runtime: docker is required for container runtime: exec: "docker": executable file not found in $PATH
k8s-master: error execution phase preflight: [preflight] Some fatal errors occurred:
k8s-master: [ERROR FileContent--proc-sys-net-bridge-bridge-nf-call-iptables]: /proc/sys/net/bridge/bridge-nf-call-iptables does not exist
k8s-master: [ERROR FileContent--proc-sys-net-ipv4-ip_forward]: /proc/sys/net/ipv4/ip_forward contents are not set to 1
k8s-master: [preflight] If you know what you are doing, you can make a check non-fatal with --ignore-preflight-errors=...
k8s-master: To see the stack trace of this error execute with --v=5 or higher
k8s-master: failed to load admin kubeconfig: open /root/.kube/config: no such file or directory
k8s-master: To see the stack trace of this error execute with --v=5 or higher
k8s-master: cp: cannot stat ‘/etc/kubernetes/admin.conf’: No such file or directory
k8s-master: chown: cannot access ‘/root/.kube/config’: No such file or directory
답변 1
0
안녕하세요. 다운받은 Vagrantfile 스크립트를 열어서 내용을 보면 아래와 같은 내용이 있는데,
# Iptables 커널 옵션 활성화
cat <<EOF > /etc/sysctl.d/k8s.conf
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
EOF
sysctl --system
# permissive 모드로 SELinux 설정(효과적으로 비활성화)
아래 내용 추가 부분 넣어서 다시 해보시겠어요? Iptables 커널 옵션 활성화 부분이 설치 중에 잘 안 먹힐 경우 나올 수 있는 에러입니다.
# Iptables 커널 옵션 활성화
cat <<EOF > /etc/sysctl.d/k8s.conf
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
EOF
sysctl --system
################# 내용 추가 ####################
modprobe br_netfilter
echo 1 > /proc/sys/net/bridge/bridge-nf-call-iptables
################################################
# permissive 모드로 SELinux 설정(효과적으로 비활성화)