summaryrefslogtreecommitdiff
path: root/roles/kubernetes/kubeadm
diff options
context:
space:
mode:
Diffstat (limited to 'roles/kubernetes/kubeadm')
-rw-r--r--roles/kubernetes/kubeadm/base/tasks/main.yml6
-rw-r--r--roles/kubernetes/kubeadm/upgrade30
2 files changed, 18 insertions, 18 deletions
diff --git a/roles/kubernetes/kubeadm/base/tasks/main.yml b/roles/kubernetes/kubeadm/base/tasks/main.yml
index e339fbcb..1e5ef920 100644
--- a/roles/kubernetes/kubeadm/base/tasks/main.yml
+++ b/roles/kubernetes/kubeadm/base/tasks/main.yml
@@ -7,7 +7,7 @@
dest: "/etc/apt/preferences.d/{{ item }}.pref"
content: |
Package: {{ item }}
- Pin: version {{ kubernetes_version }}-00
+ Pin: version {{ kubernetes_version }}-*
Pin-Priority: 1001
- name: install kubeadm packages
@@ -15,8 +15,8 @@
name:
- haproxy
- hatop
- - "kubeadm={{ kubernetes_version }}-00"
- - "kubectl={{ kubernetes_version }}-00"
+ - "kubeadm={{ kubernetes_version }}-*"
+ - "kubectl={{ kubernetes_version }}-*"
state: present
allow_downgrade: yes
diff --git a/roles/kubernetes/kubeadm/upgrade b/roles/kubernetes/kubeadm/upgrade
index 5328eefa..eb54ab17 100644
--- a/roles/kubernetes/kubeadm/upgrade
+++ b/roles/kubernetes/kubeadm/upgrade
@@ -8,8 +8,8 @@ VERSION=1.24.3
apt-get update
-sed "s/^Pin: version .*$/Pin: version $VERSION-00/" -i /etc/apt/preferences.d/kubeadm.pref
-apt-get install -y "kubeadm=$VERSION-00"
+sed "s/^Pin: version .*$/Pin: version $VERSION-*/" -i /etc/apt/preferences.d/kubeadm.pref
+apt-get install -y "kubeadm=$VERSION-*"
kubeadm version
kubeadm upgrade plan
@@ -17,9 +17,9 @@ kubectl drain $(hostname) --ignore-daemonsets --delete-emptydir-data
kubeadm upgrade apply "v$VERSION"
sed "s/^kubernetesVersion: .*$/kubernetesVersion: $VERSION/" -i /etc/kubernetes/kubeadm.config
-sed "s/^Pin: version .*$/Pin: version $VERSION-00/" -i /etc/apt/preferences.d/kubelet.pref
-sed "s/^Pin: version .*$/Pin: version $VERSION-00/" -i /etc/apt/preferences.d/kubectl.pref
-apt-get update && apt-get install -y "kubelet=$VERSION-00" "kubectl=$VERSION-00"
+sed "s/^Pin: version .*$/Pin: version $VERSION-*/" -i /etc/apt/preferences.d/kubelet.pref
+sed "s/^Pin: version .*$/Pin: version $VERSION-*/" -i /etc/apt/preferences.d/kubectl.pref
+apt-get update && apt-get install -y "kubelet=$VERSION-*" "kubectl=$VERSION-*"
// security updates + reboot ?
@@ -32,14 +32,14 @@ secondary control-plane node:
VERSION=1.24.3
apt-get update
-sed "s/^Pin: version .*$/Pin: version $VERSION-00/" -i /etc/apt/preferences.d/kubeadm.pref
-apt-get install -y "kubeadm=$VERSION-00"
+sed "s/^Pin: version .*$/Pin: version $VERSION-*/" -i /etc/apt/preferences.d/kubeadm.pref
+apt-get install -y "kubeadm=$VERSION-*"
kubectl drain $(hostname) --ignore-daemonsets --delete-emptydir-data
kubeadm upgrade node
-sed "s/^Pin: version .*$/Pin: version $VERSION-00/" -i /etc/apt/preferences.d/kubelet.pref
-sed "s/^Pin: version .*$/Pin: version $VERSION-00/" -i /etc/apt/preferences.d/kubectl.pref
-apt-get update && apt-get install -y kubelet="$VERSION-00" "kubectl=$VERSION-00"
+sed "s/^Pin: version .*$/Pin: version $VERSION-*/" -i /etc/apt/preferences.d/kubelet.pref
+sed "s/^Pin: version .*$/Pin: version $VERSION-*/" -i /etc/apt/preferences.d/kubectl.pref
+apt-get update && apt-get install -y kubelet="$VERSION-*" "kubectl=$VERSION-*"
// security updates + reboot ?
@@ -52,15 +52,15 @@ worker nodes:
VERSION=1.24.3
apt-get update
-sed "s/^Pin: version .*$/Pin: version $VERSION-00/" -i /etc/apt/preferences.d/kubeadm.pref
-apt-get install -y "kubeadm=$VERSION-00"
+sed "s/^Pin: version .*$/Pin: version $VERSION-*/" -i /etc/apt/preferences.d/kubeadm.pref
+apt-get install -y "kubeadm=$VERSION-*"
@primary control-plane node: kubectl drain <node> --ignore-daemonsets --delete-emptydir-data
kubeadm upgrade node
-sed "s/^Pin: version .*$/Pin: version $VERSION-00/" -i /etc/apt/preferences.d/kubelet.pref
-sed "s/^Pin: version .*$/Pin: version $VERSION-00/" -i /etc/apt/preferences.d/kubectl.pref
-apt-get update && apt-get install -y kubelet="$VERSION-00" "kubectl=$VERSION-00"
+sed "s/^Pin: version .*$/Pin: version $VERSION-*/" -i /etc/apt/preferences.d/kubelet.pref
+sed "s/^Pin: version .*$/Pin: version $VERSION-*/" -i /etc/apt/preferences.d/kubectl.pref
+apt-get update && apt-get install -y kubelet="$VERSION-*" "kubectl=$VERSION-*"
// security updates + reboot ?