From 5097f3df7fa428683739b039ac6790a985dc3c36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Barrag=C3=A1n=20Merino?= Date: Tue, 9 Jul 2024 17:53:29 +0200 Subject: [PATCH] feat: make deployment and pod annotations editable --- charts/penpot/README.md | 6 ++++++ charts/penpot/templates/backend-deployment.yml | 8 ++++++++ .../penpot/templates/exporter-deployment.yml | 9 +++++++++ .../penpot/templates/frontend-deployment.yml | 8 ++++++++ charts/penpot/values.yaml | 18 ++++++++++++++++++ 5 files changed, 49 insertions(+) diff --git a/charts/penpot/README.md b/charts/penpot/README.md index fe8d5bb..9814373 100644 --- a/charts/penpot/README.md +++ b/charts/penpot/README.md @@ -27,10 +27,12 @@ $ helm install my-release penpot/penpot | backend.containerSecurityContext.readOnlyRootFilesystem | bool | `false` | Set Penpot containers' security context readOnlyRootFilesystem | | backend.containerSecurityContext.runAsNonRoot | bool | `true` | Set Penpot container's security context runAsNonRoot | | backend.containerSecurityContext.runAsUser | int | `1001` | Set Penpot containers' security context runAsUser | +| backend.deploymentAnnotations | object | `{}` | An optional map of annotations to be applied to the controller Deployment | | backend.image.pullPolicy | string | `"IfNotPresent"` | The image pull policy to use. | | backend.image.repository | string | `"penpotapp/backend"` | The Docker repository to pull the image from. | | backend.image.tag | string | `"2.0.3"` | The image tag to use. | | backend.nodeSelector | object | `{}` | Node labels for Penpot pods assignment. Check [the official doc](https://kubernetes.io/docs/user-guide/node-selection/) | +| backend.podAnnotations | object | `{}` | An optional map of annotations to be applied to the controller Pods | | backend.podSecurityContext | object | `{"enabled":true,"fsGroup":1001}` | Configure Pods Security Context. Check [the official doc](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) | | backend.podSecurityContext.enabled | bool | `true` | Enabled Penpot pods' security context | | backend.podSecurityContext.fsGroup | int | `1001` | Set Penpot pod's security context fsGroup | @@ -146,10 +148,12 @@ $ helm install my-release penpot/penpot | exporter.containerSecurityContext.readOnlyRootFilesystem | bool | `false` | Set Penpot containers' security context readOnlyRootFilesystem | | exporter.containerSecurityContext.runAsNonRoot | bool | `true` | Set Penpot container's security context runAsNonRoot | | exporter.containerSecurityContext.runAsUser | int | `1001` | Set Penpot containers' security context runAsUser | +| exporter.deploymentAnnotations | object | `{}` | An optional map of annotations to be applied to the controller Deployment | | exporter.image.imagePullPolicy | string | `"IfNotPresent"` | The image pull policy to use. | | exporter.image.repository | string | `"penpotapp/exporter"` | The Docker repository to pull the image from. | | exporter.image.tag | string | `"2.0.3"` | The image tag to use. | | exporter.nodeSelector | object | `{}` | Node labels for Penpot pods assignment. Check [the official doc](https://kubernetes.io/docs/user-guide/node-selection/) | +| exporter.podAnnotations | object | `{}` | An optional map of annotations to be applied to the controller Pods | | exporter.podSecurityContext | object | `{"enabled":true,"fsGroup":1001}` | Configure Pods Security Context. Check [the official doc](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) | | exporter.podSecurityContext.enabled | bool | `true` | Enabled Penpot pods' security context | | exporter.podSecurityContext.fsGroup | int | `1001` | Set Penpot pod's security context fsGroup | @@ -166,10 +170,12 @@ $ helm install my-release penpot/penpot | Key | Type | Default | Description | |-----|------|---------|-------------| | frontend.affinity | object | `{}` | Affinity for Penpot pods assignment. Check [the official doc](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity) | +| frontend.deploymentAnnotations | object | `{}` | An optional map of annotations to be applied to the controller Deployment | | frontend.image.pullPolicy | string | `"IfNotPresent"` | The image pull policy to use. | | frontend.image.repository | string | `"penpotapp/frontend"` | The Docker repository to pull the image from. | | frontend.image.tag | string | `"2.0.3"` | The image tag to use. | | frontend.nodeSelector | object | `{}` | Node labels for Penpot pods assignment. Check [the official doc](https://kubernetes.io/docs/user-guide/node-selection/) | +| frontend.podAnnotations | object | `{}` | An optional map of annotations to be applied to the controller Pods | | frontend.replicaCount | int | `1` | The number of replicas to deploy. | | frontend.resources | object | `{"limits":{},"requests":{}}` | Penpot frontend resource requests and limits. Check [the official doc](https://kubernetes.io/docs/user-guide/compute-resources/) | | frontend.resources.limits | object | `{}` | The resources limits for the Penpot frontend containers | diff --git a/charts/penpot/templates/backend-deployment.yml b/charts/penpot/templates/backend-deployment.yml index bfbc473..8227d84 100644 --- a/charts/penpot/templates/backend-deployment.yml +++ b/charts/penpot/templates/backend-deployment.yml @@ -5,6 +5,10 @@ metadata: namespace: {{ .Release.Namespace }} labels: {{- include "penpot.labels" . | nindent 4 }} + {{- with .Values.backend.deploymentAnnotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} spec: selector: matchLabels: @@ -15,6 +19,10 @@ spec: labels: app: penpot-backend {{- include "penpot.backendSelectorLabels" . | nindent 8 }} + {{- with .Values.backend.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} spec: {{- with .Values.global.imagePullSecrets }} imagePullSecrets: diff --git a/charts/penpot/templates/exporter-deployment.yml b/charts/penpot/templates/exporter-deployment.yml index e1d1ea9..ee89326 100644 --- a/charts/penpot/templates/exporter-deployment.yml +++ b/charts/penpot/templates/exporter-deployment.yml @@ -5,6 +5,10 @@ metadata: namespace: {{ .Release.Namespace }} labels: {{- include "penpot.labels" . | nindent 4 }} + {{- with .Values.exporter.deploymentAnnotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} spec: replicas: {{ .Values.exporter.replicaCount }} selector: @@ -13,7 +17,12 @@ spec: template: metadata: labels: + app: penpot-exporter {{- include "penpot.exporterSelectorLabels" . | nindent 8 }} + {{- with .Values.exporter.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} spec: {{- with .Values.global.imagePullSecrets }} imagePullSecrets: diff --git a/charts/penpot/templates/frontend-deployment.yml b/charts/penpot/templates/frontend-deployment.yml index c6c06db..b79f887 100644 --- a/charts/penpot/templates/frontend-deployment.yml +++ b/charts/penpot/templates/frontend-deployment.yml @@ -5,6 +5,10 @@ metadata: namespace: {{ .Release.Namespace }} labels: {{- include "penpot.labels" . | nindent 4 }} + {{- with .Values.frontend.deploymentAnnotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} spec: selector: matchLabels: @@ -15,6 +19,10 @@ spec: labels: app: penpot-frontend {{- include "penpot.frontendSelectorLabels" . | nindent 8 }} + {{- with .Values.frontend.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} spec: {{- with .Values.global.imagePullSecrets }} imagePullSecrets: diff --git a/charts/penpot/values.yaml b/charts/penpot/values.yaml index 2786724..84fafac 100644 --- a/charts/penpot/values.yaml +++ b/charts/penpot/values.yaml @@ -337,6 +337,12 @@ backend: # -- The prepl service port to use. # @section -- Backend parameters port: 6063 + # -- An optional map of annotations to be applied to the controller Deployment + # @section -- Backend parameters + deploymentAnnotations: {} + # -- An optional map of annotations to be applied to the controller Pods + # @section -- Backend parameters + podAnnotations: {} # -- Configure Pods Security Context. Check [the official doc](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) # @section -- Backend parameters podSecurityContext: @@ -409,6 +415,12 @@ frontend: # -- The service port to use. # @section -- Frontend parameters port: 80 + # -- An optional map of annotations to be applied to the controller Deployment + # @section -- Frontend parameters + deploymentAnnotations: {} + # -- An optional map of annotations to be applied to the controller Pods + # @section -- Frontend parameters + podAnnotations: {} # -- Affinity for Penpot pods assignment. Check [the official doc](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity) # @section -- Frontend parameters affinity: {} @@ -449,6 +461,12 @@ exporter: # -- The service port to use. # @section -- Exporter parameters port: 6061 + # -- An optional map of annotations to be applied to the controller Deployment + # @section -- Exporter parameters + deploymentAnnotations: {} + # -- An optional map of annotations to be applied to the controller Pods + # @section -- Exporter parameters + podAnnotations: {} # -- Configure Pods Security Context. Check [the official doc](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) # @section -- Exporter parameters podSecurityContext: