virtualbox를 사용하여 우분투 서버 22.4에 kubernetes 설치

virtualbox를 사용하여 우분투 서버 22.4에 kubernetes 설치

Windows 노트북에 VirtualBox를 설치했습니다. 그런 다음 우분투 서버 22.4를 설치했습니다.

https://phoenixnap.com/kb/install-kubernetes-on-ubuntu

위에서 언급한 링크를 따라갔습니다.

여기 내 10-kubeadm.conf 파일이 있습니다

 # Note: This dropin only works with kubeadm and kubelet v1.11+
[Service]
Environment="KUBELET_KUBECONFIG_ARGS=--bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/kubernetes/kubelet.conf"
Environment="KUBELET_CONFIG_ARGS=--config=/var/lib/kubelet/config.yaml"
Environment="KUBELET_EXTRA_ARGS=--fail-swap-on=false"
# This is a file that "kubeadm init" and "kubeadm join" generates at runtime, populating the KUBELET_KUBEADM_ARGS variable dynamically
EnvironmentFile=-/var/lib/kubelet/kubeadm-flags.env
# This is a file that the user can use for overrides of the kubelet args as a last resort. Preferably, the user should use
# the .NodeRegistration.KubeletExtraArgs object in the configuration files instead. KUBELET_EXTRA_ARGS should be sourced from this file.
EnvironmentFile=-/etc/default/kubelet
ExecStart=
ExecStart=/usr/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_CONFIG_ARGS $KUBELET_KUBEADM_ARGS $KUBELET_EXTRA_ARGS

이 명령을 실행할 때

sudo kubeadm init --control-plane-endpoint=master-node --upload-certs


W0122 12:30:59.668914   77279 version.go:104] could not fetch a Kubernetes version from the internet: unable to get URL "https://dl.k8s.io/release/stable-1.txt": Get "https://dl.k8s.io/release/stable-1.txt": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
W0122 12:30:59.668985   77279 version.go:105] falling back to the local client version: v1.28.2
[init] Using Kubernetes version: v1.28.2
[preflight] Running pre-flight checks
error execution phase preflight: [preflight] Some fatal errors occurred:
        [ERROR Port-10259]: Port 10259 is in use
        [ERROR Port-10257]: Port 10257 is in use
        [ERROR Port-10250]: Port 10250 is in use
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`
To see the stack trace of this error execute with --v=5 or higher

그리고 모든 PID를 종료하려고 하면 다시 시작됩니다. 이미 우분투 서버를 제거하고 처음부터 시작했습니다. 하지만 여전히 같은 문제가 발생하여 항상 10단계에서 멈춰 있습니다.

답변1

이 명령으로 나열된 포트를 사용하는 것이 무엇인지 식별해야 합니다.

sudo netstat -tunlp

이를 갖고 나면 어떤 애플리케이션이 KubeCTL 인스턴스와 충돌하는지 확인할 수 있습니다.

관련 정보