From 0d1d0a34d8738ae408226479e0249f5cd1873551 Mon Sep 17 00:00:00 2001 From: Jon Date: Sat, 23 Sep 2023 15:30:15 +0930 Subject: [PATCH] feat(grafana): add affinity to values !1 --- templates/Grafana-Grafana.yaml | 2 ++ values.yaml | 38 +++++++++++++++++++++++++++++----- 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/templates/Grafana-Grafana.yaml b/templates/Grafana-Grafana.yaml index f0aca0f..07e5784 100644 --- a/templates/Grafana-Grafana.yaml +++ b/templates/Grafana-Grafana.yaml @@ -53,6 +53,8 @@ spec: app.kubernetes.io/version: {{ $.Chart.Version }} spec: + affinity: + {{- toYaml .Values.nfc_monitoring.grafana.affinity | nindent 12 }} containers: - name: grafana image: "{{ .Values.nfc_monitoring.grafana.image.name }}:{{ .Values.nfc_monitoring.grafana.image.tag }}" diff --git a/values.yaml b/values.yaml index 769af8d..9ad1ef0 100644 --- a/values.yaml +++ b/values.yaml @@ -19,15 +19,43 @@ nfc_monitoring: grafana: - image: - name: grafana/grafana - tag: '10.1.2' # '10.0.5' - namespace: grafana - replicas: 1 admin_user: admin admin_password: admin + image: + name: grafana/grafana + tag: '10.1.2' # '10.0.5' + + namespace: grafana + + replicas: 1 + + affinity: + nodeAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - preference: + matchExpressions: + - key: node-role.kubernetes.io/worker + operator: Exists + weight: 100 + - preference: + matchExpressions: + - key: node-role.kubernetes.io/storage + operator: DoesNotExist + weight: 100 + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - podAffinityTerm: + labelSelector: + matchExpressions: + - key: app.kubernetes.io/name + operator: In + values: + - prometheus + topologyKey: kubernetes.io/hostname + weight: 10 + grafana_agent: image: