From a49633c4dd97a2ee4834b7a49451a94a7d00f4ce Mon Sep 17 00:00:00 2001 From: Vojtech Mares Date: Fri, 17 Nov 2023 10:13:04 +0100 Subject: [PATCH] feat(k3s-upgrade): add podSelector to ignore lognhorn-manager and instance-manager pods - because of storageclass longhorn-static with numberOfReplicas=1, it is impossible to drain nodes without violating pod disruption budget - dataloss may occur on volume-level, but postgres-operator should replicate data from primary, if primary is evicted, new will be selected --- manifests/system-upgrade/k3s-upgrade-v1.28.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/manifests/system-upgrade/k3s-upgrade-v1.28.yaml b/manifests/system-upgrade/k3s-upgrade-v1.28.yaml index 3549efc..56402a9 100644 --- a/manifests/system-upgrade/k3s-upgrade-v1.28.yaml +++ b/manifests/system-upgrade/k3s-upgrade-v1.28.yaml @@ -16,6 +16,7 @@ spec: - {key: k3os.io/mode, operator: DoesNotExist} - {key: node-role.kubernetes.io/control-plane, operator: Exists} serviceAccountName: system-upgrade + jobActiveDeadlineSecs: 3600 cordon: true drain: timeout: 900s # 15 minutes @@ -23,5 +24,18 @@ spec: ignoreDaemonSets: true deleteLocalData: true skipWaitForDeleteTimeout: 180 + # ! We ignore longhorn-manager and instance-manager pods + # ! because with storageclass longhorn-static which has only single replica, it is impossible to drain the node + # ! without violating the pod disruption budget. + podSelector: + matchExpressions: + - key: app + operator: NotIn + values: + - longhorn-manager + - key: longhorn.io/component + operator: NotIn + values: + - instance-manager upgrade: image: rancher/k3s-upgrade