Skip to content

Commit

Permalink
add repo add on upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
cstanislawski committed Oct 25, 2024
1 parent 4c4c67f commit 6cf90bf
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions kubelift.sh
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,18 @@ function upgrade_node_components() {
ssh -o StrictHostKeyChecking=no "$SSH_USER@$node_ip" bash << EOF
set -euo pipefail
KUBERNETES_VERSION="$KUBERNETES_VERSION"
KUBERNETES_VERSION_REPOSITORY="v\${KUBERNETES_VERSION%.*}"
install -m 0755 -d /etc/apt/keyrings
curl -fsSL "https://pkgs.k8s.io/core:/stable:/\$KUBERNETES_VERSION_REPOSITORY/deb/Release.key" | \
gpg --dearmor --yes -o "/etc/apt/keyrings/kubernetes-apt-keyring-\$KUBERNETES_VERSION_REPOSITORY.gpg"
echo "deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring-\$KUBERNETES_VERSION_REPOSITORY.gpg] https://pkgs.k8s.io/core:/stable:/\$KUBERNETES_VERSION_REPOSITORY/deb/ /" | \
tee /etc/apt/sources.list.d/kubernetes.list
apt-get update
apt-mark unhold kubeadm && apt-get install -y kubeadm=$KUBERNETES_VERSION-* && apt-mark hold kubeadm
if $is_control_plane; then
Expand Down

0 comments on commit 6cf90bf

Please sign in to comment.