From 3e0563014595d0fc18b058c0eb6c9f86744792b1 Mon Sep 17 00:00:00 2001 From: Cees-Jan Kiewiet Date: Fri, 10 Jul 2020 21:06:13 +0200 Subject: [PATCH] Enforce each pod to be on a different node --- README.md | 4 ++++ charts/docker-hub-exporter/Chart.yaml | 2 +- charts/docker-hub-exporter/templates/deployment.yaml | 10 ++++++++++ charts/redirect/Chart.yaml | 2 +- charts/redirect/ci/single-replica-values.yaml | 1 + charts/redirect/templates/deployment.yaml | 10 ++++++++++ 6 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 charts/redirect/ci/single-replica-values.yaml diff --git a/README.md b/README.md index efa9c19..ca40a8d 100644 --- a/README.md +++ b/README.md @@ -7,3 +7,7 @@ Opinionated helm chats for my personal projects, and OSS Projects that either do * [`docker-hub-exporter`](https://hub.helm.sh/charts/wyrihaximusnet/docker-hub-exporter) * [`redirect`](https://hub.helm.sh/charts/wyrihaximusnet/redirect) + +## Opinionated decisions shared by all charts + +* All have pod anti-affinity to be not be on the same node diff --git a/charts/docker-hub-exporter/Chart.yaml b/charts/docker-hub-exporter/Chart.yaml index 3536a65..5e2d0c6 100644 --- a/charts/docker-hub-exporter/Chart.yaml +++ b/charts/docker-hub-exporter/Chart.yaml @@ -4,7 +4,7 @@ description: Docker Hub exporter home: https://github.com/jessestuart/docker-hub-exporter icon: https://helm.wyrihaximus.net/images/charts/docker-hub-exporter.png type: application -version: 0.2.4 +version: 0.3.0 appVersion: d05df48 maintainers: - name: WyriHaximus diff --git a/charts/docker-hub-exporter/templates/deployment.yaml b/charts/docker-hub-exporter/templates/deployment.yaml index 482d3a7..6bdebc8 100644 --- a/charts/docker-hub-exporter/templates/deployment.yaml +++ b/charts/docker-hub-exporter/templates/deployment.yaml @@ -54,3 +54,13 @@ spec: args: - -listen-address=:9170 - -organisations={{ .Values.organisations }} + affinity: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: app + operator: In + values: + - {{ include ".helm.fullname" . }} + topologyKey: "kubernetes.io/hostname" diff --git a/charts/redirect/Chart.yaml b/charts/redirect/Chart.yaml index b970c70..1dbf08c 100644 --- a/charts/redirect/Chart.yaml +++ b/charts/redirect/Chart.yaml @@ -16,7 +16,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. -version: 0.2.0 +version: 0.3.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. diff --git a/charts/redirect/ci/single-replica-values.yaml b/charts/redirect/ci/single-replica-values.yaml new file mode 100644 index 0000000..ebf6be8 --- /dev/null +++ b/charts/redirect/ci/single-replica-values.yaml @@ -0,0 +1 @@ +replicaCount: 1 diff --git a/charts/redirect/templates/deployment.yaml b/charts/redirect/templates/deployment.yaml index 8013c0d..b002660 100644 --- a/charts/redirect/templates/deployment.yaml +++ b/charts/redirect/templates/deployment.yaml @@ -66,3 +66,13 @@ spec: - name: {{ include ".helm.fullname" . }}-volume configMap: name: {{ include ".helm.fullname" . }} + affinity: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: app + operator: In + values: + - {{ include ".helm.fullname" . }} + topologyKey: "kubernetes.io/hostname"