Installieren Sie Kubernetes auf Ubuntu Server 22.4 mit Virtualbox

Installieren Sie Kubernetes auf Ubuntu Server 22.4 mit Virtualbox

Ich habe Virtualbox auf meinem Windows-Laptop installiert. Und dann habe ich Ubuntu Server 22.4 installiert.

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

Ich bin dem oben genannten Link gefolgt.

hier ist meine 10-kubeadm.conf-Datei

 # 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

wenn ich diesen Befehl ausführe

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

Und wenn ich versuche, alle diese PIDs zu beenden, werden sie einfach neu gestartet. Ich habe den Ubuntu-Server bereits deinstalliert und von vorne begonnen. Aber immer noch das gleiche Problem und ich hänge immer bei Schritt 10 fest

Antwort1

Sie müssen ermitteln, was die mit diesem Befehl aufgelisteten Ports verwendet:

sudo netstat -tunlp

Sobald Sie das haben, können Sie sehen, welche Anwendung mit den KubeCTL-Instanzen in Konflikt steht.

verwandte Informationen