diff options
author | Christian Pointner <equinox@spreadspace.org> | 2024-01-12 23:53:40 +0100 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2024-01-12 23:54:01 +0100 |
commit | 6ff0f56c468fc0311cee3bd213de6ce8663fbeb7 (patch) | |
tree | 312beb0595853a1de8d3336499a621fca5454f15 /roles/kubernetes/kubeadm | |
parent | switch to new kubernetes apt repo (diff) |
fix kubernetes roles to accomodate new package naming convention
Diffstat (limited to 'roles/kubernetes/kubeadm')
-rw-r--r-- | roles/kubernetes/kubeadm/base/tasks/main.yml | 6 | ||||
-rw-r--r-- | roles/kubernetes/kubeadm/upgrade | 30 |
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 ? |