From 3513dfb9fc4a1cbfc3d00fe05ec3667750a60bdb Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Wed, 9 Jan 2019 20:13:19 +0000 Subject: [PATCH] Prevent gitea pods from being co-scheduled For scale out purposes, we only want one gitea pod per underlying kubernetes node. Use podAntiAffinity to accomplish this. Change-Id: Icd8f70cf7e1640e58133f67e8a519267ac3b36d3 --- kubernetes/gitea/k8s/deployment.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/kubernetes/gitea/k8s/deployment.yaml b/kubernetes/gitea/k8s/deployment.yaml index 9d84148f00..fd4769c61e 100644 --- a/kubernetes/gitea/k8s/deployment.yaml +++ b/kubernetes/gitea/k8s/deployment.yaml @@ -71,3 +71,13 @@ spec: - name: secrets secret: secretName: gitea-app + affinity: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: app + operator: In + values: + - gitea + topologyKey: "kubernetes.io/hostname"