install-k8s-on-ubuntu-2204/install-kube-from-repo.sh

18 lines
574 B
Bash
Raw Normal View History

2024-01-27 19:33:25 +02:00
#!/usr/bin/env bash
2024-01-27 19:52:52 +02:00
export DEBIAN_FRONTEND=noninteractive
2024-01-27 19:33:25 +02:00
apt install -y apt-transport-https ca-certificates curl gpg
2024-01-28 20:27:05 +02:00
stat /etc/apt/keyrings/kubernetes-apt-keyring.gpg || \
2024-01-27 19:33:25 +02:00
curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.29/deb/Release.key | gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg
echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.29/deb/ /' | \
tee /etc/apt/sources.list.d/kubernetes.list
apt update
apt-get install -y kubelet kubeadm kubectl
apt-mark hold kubelet kubeadm kubectl