From d285a937ca0371054c4aec79c4719cfe6656fbd7 Mon Sep 17 00:00:00 2001 From: Calvin Audier Date: Wed, 16 Oct 2024 10:05:17 +0200 Subject: [PATCH 1/2] Add pod annotations support - Add podAnnotations value to add podannotations on each components - Add customPodAnnotation value to add podannotations on all components - bumped version 3.11.1 and regenerated docs Signed-off-by: Calvin Audier --- charts/litmus/Chart.yaml | 2 +- charts/litmus/README.md | 6 ++++- charts/litmus/templates/_helpers.tpl | 27 +++++++++++++++++++ .../templates/auth-server-deployment.yaml | 4 +++ .../litmus/templates/frontend-deployment.yaml | 4 +++ .../litmus/templates/server-deployment.yaml | 4 +++ charts/litmus/values.yaml | 6 ++++- 7 files changed, 50 insertions(+), 3 deletions(-) diff --git a/charts/litmus/Chart.yaml b/charts/litmus/Chart.yaml index 91ddb814..8957ce52 100644 --- a/charts/litmus/Chart.yaml +++ b/charts/litmus/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 appVersion: "3.11.0" description: A Helm chart to install ChaosCenter name: litmus -version: 3.11.0 +version: 3.11.1 kubeVersion: ">=1.16.0-0" home: https://litmuschaos.io sources: diff --git a/charts/litmus/README.md b/charts/litmus/README.md index f11c38b2..e4e0e8f5 100644 --- a/charts/litmus/README.md +++ b/charts/litmus/README.md @@ -1,6 +1,6 @@ # litmus -![Version: 3.11.0](https://img.shields.io/badge/Version-3.11.0-informational?style=flat-square) ![AppVersion: 3.11.0](https://img.shields.io/badge/AppVersion-3.11.0-informational?style=flat-square) +![Version: 3.11.1](https://img.shields.io/badge/Version-3.11.1-informational?style=flat-square) ![AppVersion: 3.11.0](https://img.shields.io/badge/AppVersion-3.11.0-informational?style=flat-square) A Helm chart to install ChaosCenter @@ -59,6 +59,7 @@ We separated service configuration from `portal.server.service` to `portal.serve | adminConfig.VERSION | string | `"3.11.0"` | | | allowedOrigins | string | `".*"` | | | customLabels | object | `{}` | Additional labels | +| customPodAnnotations | object | `{}` | Additional annotations | | existingSecret | string | `""` | Use existing secret (e.g., External Secrets) | | image.imagePullSecrets | list | `[]` | | | image.imageRegistryName | string | `"litmuschaos.docker.scarf.sh/litmuschaos"` | | @@ -113,6 +114,7 @@ We separated service configuration from `portal.server.service` to `portal.serve | portal.frontend.livenessProbe.successThreshold | int | `1` | | | portal.frontend.livenessProbe.timeoutSeconds | int | `5` | | | portal.frontend.nodeSelector | object | `{}` | | +| portal.frontend.podAnnotations | object | `{}` | | | portal.frontend.readinessProbe.initialDelaySeconds | int | `5` | | | portal.frontend.readinessProbe.periodSeconds | int | `10` | | | portal.frontend.readinessProbe.successThreshold | int | `1` | | @@ -145,6 +147,7 @@ We separated service configuration from `portal.server.service` to `portal.serve | portal.server.authServer.image.pullPolicy | string | `"Always"` | | | portal.server.authServer.image.repository | string | `"litmusportal-auth-server"` | | | portal.server.authServer.image.tag | string | `"3.11.0"` | | +| portal.server.authServer.podAnnotations | object | `{}` | | | portal.server.authServer.ports[0].containerPort | int | `3000` | | | portal.server.authServer.ports[0].name | string | `"auth-server"` | | | portal.server.authServer.ports[1].containerPort | int | `3030` | | @@ -194,6 +197,7 @@ We separated service configuration from `portal.server.service` to `portal.serve | portal.server.graphqlServer.livenessProbe.periodSeconds | int | `10` | | | portal.server.graphqlServer.livenessProbe.successThreshold | int | `1` | | | portal.server.graphqlServer.livenessProbe.timeoutSeconds | int | `5` | | +| portal.server.graphqlServer.podAnnotations | object | `{}` | | | portal.server.graphqlServer.ports[0].containerPort | int | `8080` | | | portal.server.graphqlServer.ports[0].name | string | `"gql-server"` | | | portal.server.graphqlServer.ports[1].containerPort | int | `8000` | | diff --git a/charts/litmus/templates/_helpers.tpl b/charts/litmus/templates/_helpers.tpl index 865dd119..fb135637 100644 --- a/charts/litmus/templates/_helpers.tpl +++ b/charts/litmus/templates/_helpers.tpl @@ -136,3 +136,30 @@ mongodb://{{ trimSuffix "," $hosts }}/admin {{- end -}} {{- end -}} +{{/* section to define the podannotations for the different components */}} +{{- define "litmus-portal.podannotations.auth-server" -}} +{{- if .Values.customPodAnnotations }} +{{ toYaml .Values.customPodAnnotations }} +{{- end }} +{{- if .Values.portal.server.authServer.podAnnotations }} +{{ toYaml .Values.portal.server.authServer.podAnnotations }} +{{- end }} +{{- end -}} + +{{- define "litmus-portal.podannotations.graphql-server" -}} +{{- if .Values.customPodAnnotations }} +{{ toYaml .Values.customPodAnnotations }} +{{- end }} +{{- if .Values.portal.server.graphqlServer.podAnnotations }} +{{ toYaml .Values.portal.server.graphqlServer.podAnnotations }} +{{- end }} +{{- end -}} + +{{- define "litmus-portal.podannotations.frontend" -}} +{{- if .Values.customPodAnnotations }} +{{ toYaml .Values.customPodAnnotations }} +{{- end }} +{{- if .Values.portal.frontend.podAnnotations }} +{{ toYaml .Values.portal.frontend.podAnnotations }} +{{- end }} +{{- end -}} \ No newline at end of file diff --git a/charts/litmus/templates/auth-server-deployment.yaml b/charts/litmus/templates/auth-server-deployment.yaml index 19bb042e..b37fdb3f 100644 --- a/charts/litmus/templates/auth-server-deployment.yaml +++ b/charts/litmus/templates/auth-server-deployment.yaml @@ -28,6 +28,10 @@ spec: {{- if .Values.portal.server.customLabels }} {{ toYaml .Values.portal.server.customLabels | nindent 8 }} {{- end }} + {{- if "litmus-portal.podannotations.auth-server"}} + annotations: + {{- include "litmus-portal.podannotations.auth-server" . | indent 8 }} + {{- end}} spec: automountServiceAccountToken: {{ .Values.portal.server.authServer.automountServiceAccountToken }} {{- if .Values.image.imagePullSecrets }} diff --git a/charts/litmus/templates/frontend-deployment.yaml b/charts/litmus/templates/frontend-deployment.yaml index bc3ce13e..e7b2b1fd 100644 --- a/charts/litmus/templates/frontend-deployment.yaml +++ b/charts/litmus/templates/frontend-deployment.yaml @@ -28,6 +28,10 @@ spec: {{- if .Values.portal.frontend.customLabels }} {{ toYaml .Values.portal.frontend.customLabels | nindent 8 }} {{- end }} + {{- if "litmus-portal.podannotations.frontend"}} + annotations: + {{- include "litmus-portal.podannotations.frontend" . | indent 8 }} + {{- end}} spec: automountServiceAccountToken: {{ .Values.portal.frontend.automountServiceAccountToken }} {{- if .Values.image.imagePullSecrets }} diff --git a/charts/litmus/templates/server-deployment.yaml b/charts/litmus/templates/server-deployment.yaml index 0ec9f270..07f18fc8 100644 --- a/charts/litmus/templates/server-deployment.yaml +++ b/charts/litmus/templates/server-deployment.yaml @@ -26,6 +26,10 @@ spec: {{- if .Values.portal.server.customLabels }} {{ toYaml .Values.portal.server.customLabels | nindent 8 }} {{- end }} + {{- if "litmus-portal.podannotations.auth-server"}} + annotations: + {{- include "litmus-portal.podannotations.auth-server" . | indent 8 }} + {{- end}} spec: automountServiceAccountToken: {{ .Values.portal.server.graphqlServer.automountServiceAccountToken }} {{- if .Values.image.imagePullSecrets }} diff --git a/charts/litmus/values.yaml b/charts/litmus/values.yaml index ea1a71a0..bc73059a 100644 --- a/charts/litmus/values.yaml +++ b/charts/litmus/values.yaml @@ -3,6 +3,8 @@ # Declare variables to be passed into your templates. nameOverride: "" +# -- Additional annotations +customPodAnnotations: {} # -- Additional labels customLabels: {} # my.company.com/concourse-cd: 2 @@ -123,6 +125,7 @@ portal: containerPort: 8185 customLabels: {} # my.company.com/tier: "frontend" + podAnnotations: {} resources: # We usually recommend not to specify default resources and to leave this as a conscious @@ -280,6 +283,7 @@ portal: periodSeconds: 10 successThreshold: 1 timeoutSeconds: 1 + podAnnotations: {} authServer: replicas: 1 autoscaling: @@ -328,7 +332,7 @@ portal: ephemeral-storage: "1Gi" volumeMounts: [] volumes: [] - + podAnnotations: {} nodeSelector: {} tolerations: [] affinity: {} From a7172b28bb44bfc39b377e21305cafeeee034d6b Mon Sep 17 00:00:00 2001 From: Calvin Audier Date: Wed, 16 Oct 2024 15:41:45 +0200 Subject: [PATCH 2/2] Fix if condition that was always true Signed-off-by: Calvin Audier --- charts/litmus/templates/auth-server-deployment.yaml | 2 +- charts/litmus/templates/frontend-deployment.yaml | 2 +- charts/litmus/templates/server-deployment.yaml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/litmus/templates/auth-server-deployment.yaml b/charts/litmus/templates/auth-server-deployment.yaml index b37fdb3f..57185cb9 100644 --- a/charts/litmus/templates/auth-server-deployment.yaml +++ b/charts/litmus/templates/auth-server-deployment.yaml @@ -28,7 +28,7 @@ spec: {{- if .Values.portal.server.customLabels }} {{ toYaml .Values.portal.server.customLabels | nindent 8 }} {{- end }} - {{- if "litmus-portal.podannotations.auth-server"}} + {{- if include "litmus-portal.podannotations.auth-server" . }} annotations: {{- include "litmus-portal.podannotations.auth-server" . | indent 8 }} {{- end}} diff --git a/charts/litmus/templates/frontend-deployment.yaml b/charts/litmus/templates/frontend-deployment.yaml index e7b2b1fd..b9e88591 100644 --- a/charts/litmus/templates/frontend-deployment.yaml +++ b/charts/litmus/templates/frontend-deployment.yaml @@ -28,7 +28,7 @@ spec: {{- if .Values.portal.frontend.customLabels }} {{ toYaml .Values.portal.frontend.customLabels | nindent 8 }} {{- end }} - {{- if "litmus-portal.podannotations.frontend"}} + {{- if include "litmus-portal.podannotations.frontend" . }} annotations: {{- include "litmus-portal.podannotations.frontend" . | indent 8 }} {{- end}} diff --git a/charts/litmus/templates/server-deployment.yaml b/charts/litmus/templates/server-deployment.yaml index 07f18fc8..7af80fbc 100644 --- a/charts/litmus/templates/server-deployment.yaml +++ b/charts/litmus/templates/server-deployment.yaml @@ -26,9 +26,9 @@ spec: {{- if .Values.portal.server.customLabels }} {{ toYaml .Values.portal.server.customLabels | nindent 8 }} {{- end }} - {{- if "litmus-portal.podannotations.auth-server"}} + {{- if include "litmus-portal.podannotations.graphql-server" . }} annotations: - {{- include "litmus-portal.podannotations.auth-server" . | indent 8 }} + {{- include "litmus-portal.podannotations.graphql-server" . | indent 8 }} {{- end}} spec: automountServiceAccountToken: {{ .Values.portal.server.graphqlServer.automountServiceAccountToken }}