From 56d29d9ef0c3cf234489e489697a3be2c00612bf Mon Sep 17 00:00:00 2001 From: antonionasritense Date: Tue, 2 Jan 2024 11:58:06 +0000 Subject: [PATCH] Valtimo backend: Enable extra volumes and environment variables. Valtimo frontend: update readme documentation --- charts/valtimo-backend/Chart.yaml | 2 +- charts/valtimo-backend/README.md | 20 ++++++-- charts/valtimo-backend/templates/_helpers.tpl | 14 ++++++ .../valtimo-backend/templates/deployment.yaml | 19 ++++---- charts/valtimo-backend/values.yaml | 27 +++++++++-- charts/valtimo-frontend/Chart.yaml | 2 +- charts/valtimo-frontend/README.md | 46 +++++++++---------- 7 files changed, 85 insertions(+), 45 deletions(-) diff --git a/charts/valtimo-backend/Chart.yaml b/charts/valtimo-backend/Chart.yaml index 764a47b..3f6c08f 100644 --- a/charts/valtimo-backend/Chart.yaml +++ b/charts/valtimo-backend/Chart.yaml @@ -3,7 +3,7 @@ appVersion: 0.1.0 description: A Helm chart for Kubernetes name: valtimo-backend type: application -version: 0.1.8 +version: 0.1.9 dependencies: - name: postgresql diff --git a/charts/valtimo-backend/README.md b/charts/valtimo-backend/README.md index 90abe16..88a1756 100644 --- a/charts/valtimo-backend/README.md +++ b/charts/valtimo-backend/README.md @@ -1,6 +1,6 @@ # valtimo-backend -![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.0](https://img.shields.io/badge/AppVersion-0.1.0-informational?style=flat-square) +![Version: 0.1.9](https://img.shields.io/badge/Version-0.1.9-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.0](https://img.shields.io/badge/AppVersion-0.1.0-informational?style=flat-square) A Helm chart for Kubernetes @@ -23,6 +23,10 @@ A Helm chart for Kubernetes | autoscaling.targetCPUUtilizationPercentage | int | `80` | Valtimo-backend Deployment autoscaling target CPU percentage | | autoscaling.targetMemoryUtilizationPercentage | int | `80` | Valtimo-backend Deployment autoscaling target Mem utilization percentage | | existingSecret | string | `nil` | Refer to an existing secret to avoid managing secrets through Helm. | +| extraEnvVars | list | `[]` | Array with extra environment variables to add | +| extraEnvironmentVariables | list | `[]` | | +| extraVolumeMounts | list | `[]` | Optionally specify extra list of additional volumeMounts | +| extraVolumes | list | `[]` | Optionally specify extra list of additional volumes | | fullnameOverride | string | `""` | String to fully override valitmo-backend.fullname | | image.pullPolicy | string | `"IfNotPresent"` | Pull policy for the image | | image.repository | string | `""` | Domain of the image repository | @@ -35,19 +39,25 @@ A Helm chart for Kubernetes | ingress.hosts[0].paths[0] | object | `{"path":"/","pathType":"ImplementationSpecific"}` | Ingress path | | ingress.hosts[0].paths[0].pathType | string | `"ImplementationSpecific"` | Ingress path type | | ingress.tls | list | `[]` | Enable TLS for the Ingress | -| keycloak | string | `nil` | Keycloak subchart by Bitnami. See https://artifacthub.io/packages/helm/bitnami/keycloak?modal=values for all possible values | +| keycloak | object | `{"auth":{"adminPassword":"","adminUser":"user","existingSecret":""}}` | Keycloak subchart by Bitnami. See https://artifacthub.io/packages/helm/bitnami/keycloak?modal=values for all possible values | | livenessProbe.failureThreshold | int | `6` | Failure threshold for livenessProbe | | livenessProbe.initialDelaySeconds | int | `40` | Initial delay seconds for livenessProbe | | livenessProbe.periodSeconds | int | `10` | Period seconds for livenessProbe | | livenessProbe.successThreshold | int | `1` | Success threshold for livenessProbe | | livenessProbe.timeoutSeconds | int | `1` | Timeout seconds for livenessProbe | -| mysql | string | `nil` | MySQL subchart by Bitnami. See https://artifacthub.io/packages/helm/bitnami/mysql?modal=values for all possible values | +| mysql | object | `{"auth":{"existingSecret":"","rootPassword":""}}` | MySQL subchart by Bitnami. See https://artifacthub.io/packages/helm/bitnami/mysql?modal=values for all possible values | | nameOverride | string | `""` | Name override for Valtimo-Backend | | nodeSelector | object | `{}` | Node labels for Valtimo-backend pods assignment | +| persistence.annotations | object | `{}` | | +| persistence.enabled | bool | `false` | Enable/disable persistent volumes for Valimo-backend | +| persistence.existingClaim | string | `nil` | persistence.existingClaim The name of an existing PVC to use for persistence | +| persistence.mountPath | string | `"/tmp"` | persistence.mountPath Path to mount the volume at. | +| persistence.size | string | `"1Gi"` | persistence.size Size of data volume | +| persistence.storageClass | string | `""` | | | podAnnotations | object | `{}` | Annotations for Valtimo-backend pods | | podLabels | object | `{}` | Labels for Valtimo-backend pods | | podSecurityContext.fsGroup | int | `2000` | Set Valtimo-backend's pod security fsGroup | -| postgresql | string | `nil` | Postgresql subchart by Bitnami. See https://artifacthub.io/packages/helm/bitnami/postgresql?modal=values for all possible values | +| postgresql | object | `{"auth":{"existingSecret":"","postgresPassword":"","secretKeys":{"adminPasswordKey":"","replicationPasswordKey":"","userPasswordKey":""}}}` | Postgresql subchart by Bitnami. See https://artifacthub.io/packages/helm/bitnami/postgresql?modal=values for all possible values | | readinessProbe.failureThreshold | int | `6` | Failure threshold for readinessProbe | | readinessProbe.initialDelaySeconds | int | `20` | Initial delay seconds for readinessProbe | | readinessProbe.periodSeconds | int | `10` | Period seconds for readinessProbe | @@ -87,4 +97,4 @@ A Helm chart for Kubernetes | tolerations | list | `[]` | Tolerations for Valtimo-backend pods assignment | ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0) +Autogenerated from chart metadata using [helm-docs v1.12.0](https://github.com/norwoodj/helm-docs/releases/v1.12.0) diff --git a/charts/valtimo-backend/templates/_helpers.tpl b/charts/valtimo-backend/templates/_helpers.tpl index 0c3fb31..478f2a8 100644 --- a/charts/valtimo-backend/templates/_helpers.tpl +++ b/charts/valtimo-backend/templates/_helpers.tpl @@ -60,3 +60,17 @@ Create the name of the service account to use {{- default "default" .Values.serviceAccount.name }} {{- end }} {{- end }} + +{{/* vim: set filetype=mustache: */}} +{{/* +Renders a value that contains template. +Usage: +{{ include "valtimo-backend.tplvalues.render" ( dict "value" .Values.path.to.the.Value "context" $) }} +*/}} +{{- define "valtimo-backend.tplvalues.render" -}} + {{- if typeIs "string" .value }} + {{- tpl .value .context }} + {{- else }} + {{- tpl (.value | toYaml) .context }} + {{- end }} +{{- end -}} diff --git a/charts/valtimo-backend/templates/deployment.yaml b/charts/valtimo-backend/templates/deployment.yaml index 1af4be5..1f02228 100644 --- a/charts/valtimo-backend/templates/deployment.yaml +++ b/charts/valtimo-backend/templates/deployment.yaml @@ -48,6 +48,10 @@ spec: name: {{ .Values.existingSecret | default (include "valtimo-backend.fullname" .) }} - configMapRef: name: {{ include "valtimo-backend.fullname" . }} + env: + {{- if .Values.extraEnvVars }} + {{- include "valtimo-backend.tplvalues.render" (dict "value" .Values.extraEnvVars "context" $) | nindent 12 }} + {{- end }} ports: - name: http containerPort: 8080 @@ -60,10 +64,8 @@ spec: volumeMounts: - name: media mountPath: {{ .Values.persistence.mountPath }} - {{- if .Values.csi.enabled }} - - name: secrets-store-inline - mountPath: "/var/run/secrets/secrets-store" - readOnly: true + {{- if .Values.extraVolumeMounts }} + {{- include "valtimo-backend.tplvalues.render" ( dict "value" .Values.extraVolumeMounts "context" $ ) | nindent 12 }} {{- end }} volumes: - name: media @@ -72,13 +74,8 @@ spec: claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ include "valtimo-backend.fullname" . }}{{- end }} {{- else }} emptyDir: {} - {{- if .Values.csi.enabled }} - - name: secrets-store-inline - csi: - driver: secrets-store.csi.k8s.io - readOnly: true - volumeAttributes: - secretProviderClass: "{{ .Values.csi.secretProviderClass }}" + {{- if .Values.extraVolumes }} + {{- include "valtimo-backend.tplvalues.render" ( dict "value" .Values.extraVolumes "context" $ ) | nindent 8 }} {{- end }} {{- end }} {{- with .Values.nodeSelector }} diff --git a/charts/valtimo-backend/values.yaml b/charts/valtimo-backend/values.yaml index b2777db..49dcc3a 100644 --- a/charts/valtimo-backend/values.yaml +++ b/charts/valtimo-backend/values.yaml @@ -148,13 +148,32 @@ tolerations: [] # -- Affinity for Valtimo-backend pods assignment affinity: {} +extraEnvironmentVariables: [] + # -- Refer to an existing secret to avoid managing secrets through Helm. existingSecret: null -# -- CSI Driver to enable secrets store manager -csi: - enabled: false - secretProviderClass: "" +# -- Array with extra environment variables to add +extraEnvVars: [] +# e.g: +# extraEnvVars: +# - name: FOO +# value: "bar" + +# -- Optionally specify extra list of additional volumes +extraVolumes: [] +# e.g: +# extraVolumes: +# - name: verify-certs +# configMap: +# name: verify-certs + +# -- Optionally specify extra list of additional volumeMounts +extraVolumeMounts: [] +# e.g: +# extraVolumeMounts: +# - name: verify-certs +# mountPath: /etc/ssl/certs/extra-certs/ persistence: # -- Enable/disable persistent volumes for Valimo-backend diff --git a/charts/valtimo-frontend/Chart.yaml b/charts/valtimo-frontend/Chart.yaml index 35af091..3f7eb7c 100644 --- a/charts/valtimo-frontend/Chart.yaml +++ b/charts/valtimo-frontend/Chart.yaml @@ -3,4 +3,4 @@ appVersion: 0.1.0 description: A Helm chart for Kubernetes name: valtimo-frontend type: application -version: 0.1.4 +version: 0.1.5 diff --git a/charts/valtimo-frontend/README.md b/charts/valtimo-frontend/README.md index 7e7b787..79225d7 100644 --- a/charts/valtimo-frontend/README.md +++ b/charts/valtimo-frontend/README.md @@ -1,6 +1,6 @@ # valtimo-frontend -![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.0](https://img.shields.io/badge/AppVersion-0.1.0-informational?style=flat-square) +![Version: 0.1.4](https://img.shields.io/badge/Version-0.1.4-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.0](https://img.shields.io/badge/AppVersion-0.1.0-informational?style=flat-square) A Helm chart for Kubernetes @@ -8,20 +8,20 @@ A Helm chart for Kubernetes | Key | Type | Default | Description | |-----|------|---------|-------------| -| affinity | object | `{}` | Affinity for Valtimo-backend pods assignment | -| autoscaling.enabled | bool | `false` | Enable/disable autoscaling for the Valtimo-backend deployment | -| autoscaling.maxReplicas | int | `100` | Maximum replicas for the Valtimo-backend deployment | -| autoscaling.minReplicas | int | `1` | Minimum replicas for the Valtimo-backend deployment | -| autoscaling.targetCPUUtilizationPercentage | int | `80` | Valtimo-backend Deployment autoscaling target CPU percentage | -| autoscaling.targetMemoryUtilizationPercentage | int | `80` | Valtimo-backend Deployment autoscaling target Mem utilization percentage | -| fullnameOverride | string | `""` | String to fully override valitmo-backend.fullname | +| affinity | object | `{}` | Affinity for Valtimo-frontend pods assignment | +| autoscaling.enabled | bool | `false` | Enable/disable autoscaling for the Valtimo-frontend deployment | +| autoscaling.maxReplicas | int | `100` | Maximum replicas for the Valtimo-frontend deployment | +| autoscaling.minReplicas | int | `1` | Minimum replicas for the Valtimo-frontend deployment | +| autoscaling.targetCPUUtilizationPercentage | int | `80` | Valtimo-frontend Deployment autoscaling target CPU percentage | +| autoscaling.targetMemoryUtilizationPercentage | int | `80` | Valtimo-frontend Deployment autoscaling target Mem utilization percentage | +| fullnameOverride | string | `""` | String to fully override valitmo-frontend.fullname | | image.pullPolicy | string | `"IfNotPresent"` | Pull policy for the image | | image.repository | string | `""` | Domain of the image repository | | image.tag | string | `""` | Overrides the image tag whose default is the chart appVersion. | | imagePullSecrets | list | `[]` | Image pull secrets | | ingress.annotations | object | `{}` | Ingress annotations | | ingress.className | string | `""` | Ingress Class which will be used to implement the Ingress | -| ingress.enabled | bool | `false` | Expose the Valtimo-backend UI through an ingress | +| ingress.enabled | bool | `false` | Expose the Valtimo-frontend UI through an ingress | | ingress.hosts[0] | object | `{"host":"chart-example.local","paths":[{"path":"/","pathType":"ImplementationSpecific"}]}` | Ingress hostname | | ingress.hosts[0].paths[0] | object | `{"path":"/","pathType":"ImplementationSpecific"}` | Ingress path | | ingress.hosts[0].paths[0].pathType | string | `"ImplementationSpecific"` | Ingress path type | @@ -31,24 +31,24 @@ A Helm chart for Kubernetes | livenessProbe.periodSeconds | int | `10` | Period seconds for livenessProbe | | livenessProbe.successThreshold | int | `1` | Success threshold for livenessProbe | | livenessProbe.timeoutSeconds | int | `1` | Timeout seconds for livenessProbe | -| nameOverride | string | `""` | Name override for Valtimo-Backend | -| nodeSelector | object | `{}` | Node labels for Valtimo-backend pods assignment | -| podAnnotations | object | `{}` | Annotations for Valtimo-backend pods | -| podLabels | object | `{}` | Labels for Valtimo-backend pods | -| podSecurityContext.fsGroup | int | `2000` | Set Valtimo-backend's pod security fsGroup | +| nameOverride | string | `""` | Name override for Valtimo-frontend | +| nodeSelector | object | `{}` | Node labels for Valtimo-frontend pods assignment | +| podAnnotations | object | `{}` | Annotations for Valtimo-frontend pods | +| podLabels | object | `{}` | Labels for Valtimo-frontend pods | +| podSecurityContext.fsGroup | int | `2000` | Set Valtimo-frontend's pod security fsGroup | | readinessProbe.failureThreshold | int | `6` | Failure threshold for readinessProbe | | readinessProbe.initialDelaySeconds | int | `5` | Initial delay seconds for readinessProbe | | readinessProbe.periodSeconds | int | `10` | Period seconds for readinessProbe | | readinessProbe.successThreshold | int | `1` | Success threshold for readinessProbe | | readinessProbe.timeoutSeconds | int | `1` | Timeout seconds for readinessProbe | -| replicaCount | int | `1` | Amount of replicas running the Valtimo-backend | +| replicaCount | int | `1` | Amount of replicas running the Valtimo-frontend | | resources | object | `{}` | | -| securityContext.capabilities.drop | list | `["ALL"]` | Valtimo-backend's container security context capabilities to be dropped | -| securityContext.readOnlyRootFilesystem | bool | `false` | Valtimo-backend's container security context readOnlyRootFilesystem | -| securityContext.runAsNonRoot | bool | `true` | Run Valtimo-backend containers as non-root | -| securityContext.runAsUser | int | `1000` | Run Valtimo-backend containers under this user-ID | -| service.port | int | `80` | Valtimo-backend service port | -| service.type | string | `"ClusterIP"` | Valtimo-backend service type | +| securityContext.capabilities.drop | list | `["ALL"]` | Valtimo-frontend's container security context capabilities to be dropped | +| securityContext.readOnlyRootFilesystem | bool | `false` | Valtimo-frontend's container security context readOnlyRootFilesystem | +| securityContext.runAsNonRoot | bool | `true` | Run Valtimo-frontend containers as non-root | +| securityContext.runAsUser | int | `1000` | Run Valtimo-frontend containers under this user-ID | +| service.port | int | `80` | Valtimo-frontend service port | +| service.type | string | `"ClusterIP"` | Valtimo-frontend service type | | serviceAccount.annotations | object | `{}` | | | serviceAccount.create | bool | `true` | | | serviceAccount.name | string | `""` | | @@ -59,7 +59,7 @@ A Helm chart for Kubernetes | settings.keycloak.redirectURL | string | `""` | The URL to redirect to after a succesfull login | | settings.keycloak.url | string | `""` | URL which exposes Keycloak | | settings.whitelistedDomain | string | `""` | Domain on which the app can run | -| tolerations | list | `[]` | Tolerations for Valtimo-backend pods assignment | +| tolerations | list | `[]` | Tolerations for Valtimo-frontend pods assignment | ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0) +Autogenerated from chart metadata using [helm-docs v1.12.0](https://github.com/norwoodj/helm-docs/releases/v1.12.0)