sudo apt update && sudo apt upgrade -y
Installiere benötigte Pakete:
sudo apt install apt-transport-https ca-certificates curl software-properties-common -y
Docker GPG-Schlüssel hinzufügen:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Docker-Repository hinzufügen:
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
Docker installieren:
sudo apt update
sudo apt install docker-ce -y
Kubernetes-Pakete hinzufügen:
sudo apt install -y apt-transport-https curl
Google Cloud-Paket-Repository hinzufügen:
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list
Kubernetes installieren:
sudo apt update
sudo apt install -y kubelet kubeadm kubectl
Kubernetes-Dienste deaktivieren:
sudo systemctl enable kubelet
sudo systemctl start kubelet
Cluster initialisieren (Master-Knoten):
sudo kubeadm init
Kubeconfig für kubectl einrichten:
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
CNI (Container Network Interface) installieren (z.B. Calico):
kubectl apply -f https://docs.projectcalico.org/manifests/calico.yaml
kubeadm join <master-ip>:6443 --token <token> --discovery-token-ca-cert-hash sha256:<hash>
Dashboard installieren:
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0/aio/deploy/recommended.yaml
Zugang zum Dashboard:
kubectl proxy
http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/
erreichbar.Kubernetes:
Docker:
Podman:
OpenShift: