From 35ec3d94f9234cfce4750b3bc66403da5449e34b Mon Sep 17 00:00:00 2001 From: ducoterra Date: Mon, 9 Oct 2023 16:07:37 -0400 Subject: [PATCH] ensure nextcloud cronjobs are scheduled on the same node as the running pod --- helm/nextcloud/templates/nextcloud-cronjob.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/helm/nextcloud/templates/nextcloud-cronjob.yaml b/helm/nextcloud/templates/nextcloud-cronjob.yaml index ae72337..1cb5da2 100644 --- a/helm/nextcloud/templates/nextcloud-cronjob.yaml +++ b/helm/nextcloud/templates/nextcloud-cronjob.yaml @@ -10,6 +10,21 @@ spec: spec: template: spec: + affinity: + podAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: app.kubernetes.io/name + operator: In + values: + - nextcloud + # This is the selector for the node + # So when you find a valid node - schedule the pod to the + # node that matches hostname + # needed for iscsi mounts + topologyKey: kubernetes.io/hostname + securityContext: runAsUser: 33 runAsGroup: 33