Skip to content

Commit 567d749

Browse files
[Ubuntu] Fix kubernetes tools install (#8609)
1 parent 254e66d commit 567d749

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

images/linux/scripts/installers/kubernetes-tools.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ curl -fsSL -o /usr/local/bin/kind $URL
1313
chmod +x /usr/local/bin/kind
1414

1515
## Install kubectl
16-
KUBECTL_VERSION=$(curl -fsSL "https://dl.k8s.io/release/stable.txt")
17-
curl -fsSL -o /usr/local/bin/kubectl "https://dl.k8s.io/release/$KUBECTL_VERSION/bin/linux/amd64/kubectl"
18-
chmod +x /usr/local/bin/kubectl
16+
KUBECTL_MINOR_VERSION=$(curl -fsSL "https://dl.k8s.io/release/stable.txt" | cut -d'.' -f1,2 )
17+
curl -fsSL https://pkgs.k8s.io/core:/stable:/$KUBECTL_MINOR_VERSION/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg
18+
echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/'$KUBECTL_MINOR_VERSION'/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list
19+
sudo apt-get update -y && sudo apt-get install -y kubectl
20+
rm -f /etc/apt/sources.list.d/kubernetes.list
1921

2022
# Install Helm
2123
curl -fsSL https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash

0 commit comments

Comments
 (0)