From c6ad4fb7ef3a81aecfc85bc10131bf29dce81754 Mon Sep 17 00:00:00 2001 From: alecsandru Date: Sat, 4 May 2024 19:05:00 +0000 Subject: [PATCH] Update 'k8s/upgrde_26_27.yml' --- k8s/upgrde_26_27.yml | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/k8s/upgrde_26_27.yml b/k8s/upgrde_26_27.yml index e2dff91..606b623 100644 --- a/k8s/upgrde_26_27.yml +++ b/k8s/upgrde_26_27.yml @@ -32,7 +32,7 @@ name: "{{ item }}" selection: install with_items: - - "kubelet" + # - "kubelet" - "kubeadm" - name: Upgrading packages apt: @@ -41,7 +41,28 @@ shell: "kubeadm upgrade plan >> /etc/kubernetes/upgrade_plan_{{ K8S_SOURCE_VERSION}}_{{ K8S_TARGET_VERSION}}" args: creates: /etc/kubernetes/upgrade_plan_{{ K8S_SOURCE_VERSION}}_{{ K8S_TARGET_VERSION}} + - name: Pulling new container images + shell: "kubeadm config images pull" - name: Apply upgrade plan shell: "sudo kubeadm upgrade apply -y v1.27.13 >> /etc/kubernetes/upgrade_ops_{{ K8S_SOURCE_VERSION}}_{{ K8S_TARGET_VERSION}}" args: - creates: /etc/kubernetes/upgrade_ops_{{ K8S_SOURCE_VERSION}}_{{ K8S_TARGET_VERSION}} \ No newline at end of file + creates: /etc/kubernetes/upgrade_ops_{{ K8S_SOURCE_VERSION}}_{{ K8S_TARGET_VERSION}} + - name: Unhold kubelet + dpkg_selections: + name: kubelet + selection: install + - name: Update kubelet + apt: + update_cache: yes + upgrade: yes + - name: Restart kubelet + service: + name: kubelet + state: restarted + - name: Pin new package versions + dpkg_selections: + name: "{{ item }}" + selection: hold + with_items: + - "kubelet" + - "kubeadm"