From 6c012d22a3f08f160182ca3d287a9c6bec952c87 Mon Sep 17 00:00:00 2001 From: Trey Dockendorf Date: Sat, 14 Nov 2026 15:15:10 -0500 Subject: [PATCH] [helm] Improvements to Helm chart MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Support releasing on “chart-” tags, fixes #223 * Add commonLabels that are used on all resources * Support templated values in numerous locations * Add oidc.existingConfigMapName and oidc.existingConfigUrlKey * Add networkPolicy.allowFrom * support targetLabels on ServiceMonitor * Support Probe relabelingConfigs * Allow postJob default containerSecurityContext Signed-off-by: Trey Dockendorf --- .github/workflows/release-helm.yml | 31 +++++++++++++++++ helm/silo/Chart.yaml | 2 +- helm/silo/README.md | 16 ++++----- helm/silo/templates/_helpers.tpl | 10 +++--- helm/silo/templates/ciliumnetworkpolicy.yaml | 3 ++ helm/silo/templates/configmap.yaml | 3 ++ helm/silo/templates/console-ingress.yaml | 11 +++--- helm/silo/templates/console-service.yaml | 8 +++-- helm/silo/templates/deployment.yaml | 34 +++++++++++++------ helm/silo/templates/ingress.yaml | 11 +++--- helm/silo/templates/networkpolicy.yaml | 10 +++++- helm/silo/templates/poddisruptionbudget.yaml | 3 ++ helm/silo/templates/post-job.yaml | 31 +++++++++-------- helm/silo/templates/pvc.yaml | 12 ++++--- helm/silo/templates/secrets.yaml | 3 ++ .../templates/securitycontextconstraints.yaml | 3 ++ helm/silo/templates/service.yaml | 8 +++-- helm/silo/templates/serviceaccount.yaml | 4 +++ helm/silo/templates/servicemonitor.yaml | 27 ++++++++++----- helm/silo/templates/statefulset.yaml | 24 +++++++++---- helm/silo/values.yaml | 22 ++++++++++++ 21 files changed, 206 insertions(+), 70 deletions(-) create mode 100644 .github/workflows/release-helm.yml diff --git a/.github/workflows/release-helm.yml b/.github/workflows/release-helm.yml new file mode 100644 index 0000000000000..b08dcb88d6369 --- /dev/null +++ b/.github/workflows/release-helm.yml @@ -0,0 +1,31 @@ +name: Publish Helm Chart to GHCR + +on: + push: + tags: + - "chart-.*" + +permissions: + contents: read + packages: write + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v7 + + - name: Install Helm + uses: azure/setup-helm@v4 + + - name: Log in to GitHub Container Registry + run: | + echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ghcr.io \ + --username ${{ github.actor }} \ + --password-stdin + + - name: Package and Push Helm Chart + run: | + helm package helm/silo + helm push silo-*.tgz oci://ghcr.io/${{ github.repository_owner }}/charts diff --git a/helm/silo/Chart.yaml b/helm/silo/Chart.yaml index 9fee02110c811..c03ed1d247a15 100644 --- a/helm/silo/Chart.yaml +++ b/helm/silo/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 description: S3-Interface Libre Object Storage name: silo -version: 7.0.5 +version: 7.1.0 appVersion: RELEASE.2026-11-12T00-00-00Z keywords: - silo diff --git a/helm/silo/README.md b/helm/silo/README.md index bbe43ac51a35c..9f332a30528c3 100644 --- a/helm/silo/README.md +++ b/helm/silo/README.md @@ -7,15 +7,15 @@ The chart and server are licensed under AGPL-3.0-or-later. ## Prerequisites - Kubernetes 1.19 or later -- Helm 3 +- Helm 3 or 4 - A PersistentVolume provisioner unless `persistence.enabled=false` ## Install -From this repository: +From GHCR: ```bash -helm install silo ./helm/silo \ +helm install silo oci://ghcr.io/pgsty/charts/silo \ --namespace silo --create-namespace \ --set rootUser=silo-admin \ --set rootPassword='replace-with-a-long-random-secret' @@ -24,7 +24,7 @@ helm install silo ./helm/silo \ For a disposable standalone installation: ```bash -helm install silo ./helm/silo \ +helm install silo oci://ghcr.io/pgsty/charts/silo \ --namespace silo --create-namespace \ --set mode=standalone \ --set replicas=1 \ @@ -64,7 +64,7 @@ helm get values my-release -n my-namespace -a > values.before-silo.yaml SILO_TAG='' MCLI_TAG='' -helm template my-release ./helm/silo \ +helm template my-release oci://ghcr.io/pgsty/charts/silo \ -n my-namespace \ -f values.before-silo.yaml \ --set nameOverride=minio \ @@ -84,7 +84,7 @@ mounts. After review, upgrade the chart and image together: ```bash SILO_TAG='' MCLI_TAG='' -helm upgrade my-release ./helm/silo \ +helm upgrade my-release oci://ghcr.io/pgsty/charts/silo \ -n my-namespace \ -f values.before-silo.yaml \ --set nameOverride=minio \ @@ -126,13 +126,13 @@ The default PersistentVolumeClaim mounts at `/export`. Use an existing claim with: ```bash -helm install silo ./helm/silo --set persistence.existingClaim=PVC_NAME +helm install silo oci://ghcr.io/pgsty/charts/silo --set persistence.existingClaim=PVC_NAME ``` Create a TLS Secret containing `private.key` and `public.crt`, then set: ```bash -helm upgrade --install silo ./helm/silo \ +helm upgrade --install silo oci://ghcr.io/pgsty/charts/silo \ --set tls.enabled=true \ --set tls.certSecret=silo-tls ``` diff --git a/helm/silo/templates/_helpers.tpl b/helm/silo/templates/_helpers.tpl index 5ce8ab39b7089..6e969f9425cc7 100644 --- a/helm/silo/templates/_helpers.tpl +++ b/helm/silo/templates/_helpers.tpl @@ -131,14 +131,14 @@ Also, we can not use a single if because lazy evaluation is not an option {{- if .Values.global }} {{- if .Values.global.imagePullSecrets }} imagePullSecrets: - {{ toYaml .Values.global.imagePullSecrets }} + {{ tpl (toYaml .Values.global.imagePullSecrets) $ }} {{- else if .Values.imagePullSecrets }} imagePullSecrets: - {{ toYaml .Values.imagePullSecrets }} + {{ tpl (toYaml .Values.imagePullSecrets) $ }} {{- end -}} {{- else if .Values.imagePullSecrets }} imagePullSecrets: - {{ toYaml .Values.imagePullSecrets }} + {{ tpl (toYaml .Values.imagePullSecrets) $ }} {{- end -}} {{- end -}} @@ -201,7 +201,7 @@ otherwise it generates a random value. {{- define "silo.root.username" -}} {{- if .Values.rootUser }} - {{- .Values.rootUser | toString }} + {{- tpl .Values.rootUser . | toString }} {{- else }} {{- include "silo.getValueFromSecret" (dict "Namespace" .Release.Namespace "Name" (include "silo.fullname" .) "Length" 20 "Key" "rootUser") }} {{- end }} @@ -209,7 +209,7 @@ otherwise it generates a random value. {{- define "silo.root.password" -}} {{- if .Values.rootPassword }} - {{- .Values.rootPassword | toString }} + {{- tpl .Values.rootPassword . | toString }} {{- else }} {{- include "silo.getValueFromSecret" (dict "Namespace" .Release.Namespace "Name" (include "silo.fullname" .) "Length" 40 "Key" "rootPassword") }} {{- end }} diff --git a/helm/silo/templates/ciliumnetworkpolicy.yaml b/helm/silo/templates/ciliumnetworkpolicy.yaml index d9d50301b7fc5..1b77646b3b21e 100644 --- a/helm/silo/templates/ciliumnetworkpolicy.yaml +++ b/helm/silo/templates/ciliumnetworkpolicy.yaml @@ -8,6 +8,9 @@ metadata: chart: {{ template "silo.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- with .Values.commonLabels }} + {{- tpl (toYaml .) $ | nindent 4 }} + {{- end }} spec: endpointSelector: matchLabels: diff --git a/helm/silo/templates/configmap.yaml b/helm/silo/templates/configmap.yaml index c3636564dcd1a..71ff744a93099 100644 --- a/helm/silo/templates/configmap.yaml +++ b/helm/silo/templates/configmap.yaml @@ -7,6 +7,9 @@ metadata: chart: {{ template "silo.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- with .Values.commonLabels }} + {{- tpl (toYaml .) $ | nindent 4 }} + {{- end }} data: initialize: |- {{- include (print $.Template.BasePath "/_helper_create_bucket.txt") . | nindent 4 }} diff --git a/helm/silo/templates/console-ingress.yaml b/helm/silo/templates/console-ingress.yaml index 248d9ce703220..40941235a4b32 100644 --- a/helm/silo/templates/console-ingress.yaml +++ b/helm/silo/templates/console-ingress.yaml @@ -12,10 +12,13 @@ metadata: release: {{ .Release.Name }} heritage: {{ .Release.Service }} {{- with .Values.consoleIngress.labels }} - {{- toYaml . | nindent 4 }} + {{- tpl (toYaml .) $ | nindent 4 }} + {{- end }} + {{- with .Values.commonLabels }} + {{- tpl (toYaml .) $ | nindent 4 }} {{- end }} {{- with .Values.consoleIngress.annotations }} - annotations: {{- toYaml . | nindent 4 }} + annotations: {{- tpl (toYaml .) $ | nindent 4 }} {{- end }} spec: {{- if .Values.consoleIngress.ingressClassName }} @@ -26,9 +29,9 @@ spec: {{- range .Values.consoleIngress.tls }} - hosts: {{- range .hosts }} - - {{ . | quote }} + - {{ tpl . $ | quote }} {{- end }} - secretName: {{ .secretName }} + secretName: {{ tpl .secretName $ }} {{- end }} {{- end }} rules: diff --git a/helm/silo/templates/console-service.yaml b/helm/silo/templates/console-service.yaml index f7f488e0fc3fd..d74760611bf09 100644 --- a/helm/silo/templates/console-service.yaml +++ b/helm/silo/templates/console-service.yaml @@ -8,8 +8,12 @@ metadata: chart: {{ template "silo.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} - {{- if .Values.consoleService.annotations }} - annotations: {{- toYaml .Values.consoleService.annotations | nindent 4 }} + {{- with .Values.commonLabels }} + {{- tpl (toYaml .) $ | nindent 4 }} + {{- end }} + {{- with .Values.consoleService.annotations }} + annotations: + {{- tpl (toYaml .) $ | nindent 4 }} {{- end }} spec: type: {{ .Values.consoleService.type }} diff --git a/helm/silo/templates/deployment.yaml b/helm/silo/templates/deployment.yaml index 259890fabbc68..b6dc33925b4a6 100644 --- a/helm/silo/templates/deployment.yaml +++ b/helm/silo/templates/deployment.yaml @@ -10,11 +10,15 @@ metadata: chart: {{ template "silo.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} - {{- if .Values.additionalLabels }} - {{- toYaml .Values.additionalLabels | nindent 4 }} + {{- with .Values.additionalLabels }} + {{- tpl (toYaml .) $ | nindent 4 }} {{- end }} - {{- if .Values.additionalAnnotations }} - annotations: {{- toYaml .Values.additionalAnnotations | nindent 4 }} + {{- with .Values.commonLabels }} + {{- tpl (toYaml .) $ | nindent 4 }} + {{- end }} + {{- with .Values.additionalAnnotations }} + annotations: + {{- tpl (toYaml .) $ | nindent 4 }} {{- end }} spec: strategy: @@ -35,8 +39,11 @@ spec: labels: app: {{ template "silo.name" . }} release: {{ .Release.Name }} - {{- if .Values.podLabels }} - {{- toYaml .Values.podLabels | nindent 8 }} + {{- with .Values.podLabels }} + {{- tpl (toYaml .) $ | nindent 8 }} + {{- end }} + {{- with .Values.commonLabels }} + {{- tpl (toYaml .) $ | nindent 8 }} {{- end }} annotations: {{- if not .Values.ignoreChartChecksums }} @@ -62,7 +69,7 @@ spec: {{- end }} containers: - name: {{ include "silo.name" . }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + image: "{{ tpl .Values.image.repository . }}:{{ tpl .Values.image.tag . }}" imagePullPolicy: {{ .Values.image.pullPolicy }} command: - "/bin/sh" @@ -111,7 +118,14 @@ spec: {{- end }} {{- if .Values.oidc.enabled }} - name: MINIO_IDENTITY_OPENID_CONFIG_URL + {{- if and .Values.oidc.existingConfigMapName .Values.oidc.existingConfigUrlKey }} + valueFrom: + configMapKeyRef: + name: {{ .Values.oidc.existingConfigMapName }} + key: {{ .Values.oidc.existingConfigUrlKey }} + {{- else }} value: {{ .Values.oidc.configUrl }} + {{- end }} - name: MINIO_IDENTITY_OPENID_CLIENT_ID {{- if and .Values.oidc.existingClientSecretName .Values.oidc.existingClientIdKey }} valueFrom: @@ -135,11 +149,11 @@ spec: - name: MINIO_IDENTITY_OPENID_CLAIM_PREFIX value: {{ .Values.oidc.claimPrefix }} - name: MINIO_IDENTITY_OPENID_SCOPES - value: {{ .Values.oidc.scopes }} + value: {{ tpl .Values.oidc.scopes . }} - name: MINIO_IDENTITY_OPENID_COMMENT value: {{ .Values.oidc.comment }} - name: MINIO_IDENTITY_OPENID_REDIRECT_URI - value: {{ .Values.oidc.redirectUri }} + value: {{ tpl .Values.oidc.redirectUri . }} - name: MINIO_IDENTITY_OPENID_DISPLAY_NAME value: {{ .Values.oidc.displayName }} {{- end }} @@ -181,7 +195,7 @@ spec: {{- end }} {{- end }} {{- with .Values.nodeSelector }} - nodeSelector: {{- toYaml . | nindent 8 }} + nodeSelector: {{- tpl (toYaml .) $ | nindent 8 }} {{- end }} {{- include "silo.imagePullSecrets" . | indent 6 }} {{- with .Values.affinity }} diff --git a/helm/silo/templates/ingress.yaml b/helm/silo/templates/ingress.yaml index e5422a6ea217d..4c864f4a20a37 100644 --- a/helm/silo/templates/ingress.yaml +++ b/helm/silo/templates/ingress.yaml @@ -12,10 +12,13 @@ metadata: release: {{ .Release.Name }} heritage: {{ .Release.Service }} {{- with .Values.ingress.labels }} - {{- toYaml . | nindent 4 }} + {{- tpl (toYaml .) $ | nindent 4 }} + {{- end }} + {{- with .Values.commonLabels }} + {{- tpl (toYaml .) $ | nindent 4 }} {{- end }} {{- with .Values.ingress.annotations }} - annotations: {{- toYaml . | nindent 4 }} + annotations: {{- tpl (toYaml .) $ | nindent 4 }} {{- end }} spec: {{- if .Values.ingress.ingressClassName }} @@ -26,9 +29,9 @@ spec: {{- range .Values.ingress.tls }} - hosts: {{- range .hosts }} - - {{ . | quote }} + - {{ tpl . $ | quote }} {{- end }} - secretName: {{ .secretName }} + secretName: {{ tpl .secretName $ }} {{- end }} {{- end }} rules: diff --git a/helm/silo/templates/networkpolicy.yaml b/helm/silo/templates/networkpolicy.yaml index 5bc822fb17b7b..880e2af0c065a 100644 --- a/helm/silo/templates/networkpolicy.yaml +++ b/helm/silo/templates/networkpolicy.yaml @@ -8,6 +8,9 @@ metadata: chart: {{ template "silo.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- with .Values.commonLabels }} + {{- tpl (toYaml .) $ | nindent 4 }} + {{- end }} spec: podSelector: matchLabels: @@ -19,11 +22,16 @@ spec: protocol: TCP - port: {{ .Values.minioConsolePort }} protocol: TCP - {{- if not .Values.networkPolicy.allowExternal }} + {{- if or (not .Values.networkPolicy.allowExternal) .Values.networkPolicy.allowFrom }} from: + {{- if not .Values.networkPolicy.allowExternal }} - podSelector: matchLabels: {{ template "silo.name" . }}-client: "true" + {{- end }} + {{- with .Values.networkPolicy.allowFrom }} + {{- tpl (toYaml .) $ | nindent 8 }} + {{- end }} {{- end }} {{- if .Values.networkPolicy.egress.enabled }} egress: diff --git a/helm/silo/templates/poddisruptionbudget.yaml b/helm/silo/templates/poddisruptionbudget.yaml index aebc135f8df3d..5ce5c15b26787 100644 --- a/helm/silo/templates/poddisruptionbudget.yaml +++ b/helm/silo/templates/poddisruptionbudget.yaml @@ -9,6 +9,9 @@ metadata: name: {{ template "silo.fullname" . }} labels: app: {{ template "silo.name" . }} + {{- with .Values.commonLabels }} + {{- tpl (toYaml .) $ | nindent 4 }} + {{- end }} spec: maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }} selector: diff --git a/helm/silo/templates/post-job.yaml b/helm/silo/templates/post-job.yaml index 33fda394a3003..42ef7cf4ff6e5 100644 --- a/helm/silo/templates/post-job.yaml +++ b/helm/silo/templates/post-job.yaml @@ -8,11 +8,14 @@ metadata: chart: {{ template "silo.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- with .Values.commonLabels }} + {{- tpl (toYaml .) $ | nindent 4 }} + {{- end }} annotations: "helm.sh/hook": post-install,post-upgrade "helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation {{- with .Values.postJob.annotations }} - {{- toYaml . | nindent 4 }} + {{- tpl (toYaml .) $ | nindent 4 }} {{- end }} spec: template: @@ -29,8 +32,8 @@ spec: spec: restartPolicy: OnFailure {{- include "silo.imagePullSecrets" . | indent 6 }} - {{- if .Values.nodeSelector }} - nodeSelector: {{- toYaml .Values.postJob.nodeSelector | nindent 8 }} + {{- if or .Values.nodeSelector .Values.postJob.nodeSelector }} + nodeSelector: {{- tpl (toYaml .Values.postJob.nodeSelector | default .Values.nodeSelector) . | nindent 8 }} {{- end }} {{- with .Values.postJob.affinity }} affinity: {{- toYaml . | nindent 8 }} @@ -39,7 +42,7 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} {{- if .Values.postJob.securityContext.enabled }} - securityContext: {{ omit .Values.postJob.securityContext "enabled" | toYaml | nindent 12 }} + securityContext: {{ omit .Values.postJob.securityContext "enabled" | toYaml | nindent 8 }} {{- end }} volumes: - name: etc-path @@ -88,9 +91,9 @@ spec: {{- if .Values.policies }} initContainers: - name: silo-make-policy - image: "{{ .Values.mcImage.repository }}:{{ .Values.mcImage.tag }}" + image: "{{ tpl .Values.mcImage.repository . }}:{{ tpl .Values.mcImage.tag . }}" {{- if .Values.makePolicyJob.securityContext.enabled }} - {{- with .Values.makePolicyJob.containerSecurityContext }} + {{- with .Values.makePolicyJob.containerSecurityContext | default .Values.postJob.containerSecurityContext }} securityContext: {{ toYaml . | nindent 12 }} {{- end }} {{- end }} @@ -122,9 +125,9 @@ spec: containers: {{- if .Values.buckets }} - name: silo-make-bucket - image: "{{ .Values.mcImage.repository }}:{{ .Values.mcImage.tag }}" + image: "{{ tpl .Values.mcImage.repository . }}:{{ tpl .Values.mcImage.tag . }}" {{- if .Values.makeBucketJob.securityContext.enabled }} - {{- with .Values.makeBucketJob.containerSecurityContext }} + {{- with .Values.makeBucketJob.containerSecurityContext | default .Values.postJob.containerSecurityContext }} securityContext: {{ toYaml . | nindent 12 }} {{- end }} {{- end }} @@ -155,9 +158,9 @@ spec: {{- end }} {{- if .Values.users }} - name: silo-make-user - image: "{{ .Values.mcImage.repository }}:{{ .Values.mcImage.tag }}" + image: "{{ tpl .Values.mcImage.repository . }}:{{ tpl .Values.mcImage.tag . }}" {{- if .Values.makeUserJob.securityContext.enabled }} - {{- with .Values.makeUserJob.containerSecurityContext }} + {{- with .Values.makeUserJob.containerSecurityContext | default .Values.postJob.containerSecurityContext }} securityContext: {{ toYaml . | nindent 12 }} {{- end }} {{- end }} @@ -188,9 +191,9 @@ spec: {{- end }} {{- if .Values.customCommands }} - name: silo-custom-command - image: "{{ .Values.mcImage.repository }}:{{ .Values.mcImage.tag }}" + image: "{{ tpl .Values.mcImage.repository . }}:{{ tpl .Values.mcImage.tag . }}" {{- if .Values.customCommandJob.securityContext.enabled }} - {{- with .Values.customCommandJob.containerSecurityContext }} + {{- with .Values.customCommandJob.containerSecurityContext | default .Values.postJob.containerSecurityContext }} securityContext: {{ toYaml . | nindent 12 }} {{- end }} {{- end }} @@ -224,9 +227,9 @@ spec: {{- end }} {{- if .Values.svcaccts }} - name: silo-make-svcacct - image: "{{ .Values.mcImage.repository }}:{{ .Values.mcImage.tag }}" + image: "{{ tpl .Values.mcImage.repository . }}:{{ tpl .Values.mcImage.tag . }}" {{- if .Values.makeServiceAccountJob.securityContext.enabled }} - {{- with .Values.makeServiceAccountJob.containerSecurityContext }} + {{- with .Values.makeServiceAccountJob.containerSecurityContext | default .Values.postJob.containerSecurityContext }} securityContext: {{ toYaml . | nindent 12 }} {{- end }} {{- end }} diff --git a/helm/silo/templates/pvc.yaml b/helm/silo/templates/pvc.yaml index ce8ce895db5c4..c1a6889517908 100644 --- a/helm/silo/templates/pvc.yaml +++ b/helm/silo/templates/pvc.yaml @@ -9,8 +9,12 @@ metadata: chart: {{ template "silo.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} - {{- if .Values.persistence.annotations }} - annotations: {{- toYaml .Values.persistence.annotations | nindent 4 }} + {{- with .Values.commonLabels }} + {{- tpl (toYaml .) $ | nindent 4 }} + {{- end }} + {{- with .Values.persistence.annotations }} + annotations: + {{- tpl (toYaml .) $ | nindent 4 }} {{- end }} spec: accessModes: @@ -18,11 +22,11 @@ spec: resources: requests: storage: {{ .Values.persistence.size | quote }} - {{- if .Values.persistence.storageClass }} + {{- if or .Values.persistence.storageClass .Values.global.storageClass }} {{- if (eq "-" .Values.persistence.storageClass) }} storageClassName: "" {{- else }} - storageClassName: "{{ .Values.persistence.storageClass }}" + storageClassName: "{{ .Values.persistence.storageClass | default .Values.global.storageClass }}" {{- end }} {{- end }} {{- if .Values.persistence.volumeName }} diff --git a/helm/silo/templates/secrets.yaml b/helm/silo/templates/secrets.yaml index ee2b423b74502..e12c112ea8a67 100644 --- a/helm/silo/templates/secrets.yaml +++ b/helm/silo/templates/secrets.yaml @@ -8,6 +8,9 @@ metadata: chart: {{ template "silo.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- with .Values.commonLabels }} + {{- tpl (toYaml .) $ | nindent 4 }} + {{- end }} type: Opaque data: rootUser: {{ include "silo.root.username" . | b64enc | quote }} diff --git a/helm/silo/templates/securitycontextconstraints.yaml b/helm/silo/templates/securitycontextconstraints.yaml index 9ab6fc5ebb6b6..e656068f1238d 100644 --- a/helm/silo/templates/securitycontextconstraints.yaml +++ b/helm/silo/templates/securitycontextconstraints.yaml @@ -8,6 +8,9 @@ metadata: chart: {{ template "silo.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- with .Values.commonLabels }} + {{- tpl (toYaml .) $ | nindent 4 }} + {{- end }} allowHostDirVolumePlugin: false allowHostIPC: false allowHostNetwork: false diff --git a/helm/silo/templates/service.yaml b/helm/silo/templates/service.yaml index 5f032b447f12f..87901f541148c 100644 --- a/helm/silo/templates/service.yaml +++ b/helm/silo/templates/service.yaml @@ -9,8 +9,12 @@ metadata: release: {{ .Release.Name }} heritage: {{ .Release.Service }} monitoring: "true" - {{- if .Values.service.annotations }} - annotations: {{- toYaml .Values.service.annotations | nindent 4 }} + {{- with .Values.commonLabels }} + {{- tpl (toYaml .) $ | nindent 4 }} + {{- end }} + {{- with .Values.service.annotations }} + annotations: + {{- tpl (toYaml .) $ | nindent 4 }} {{- end }} spec: type: {{ .Values.service.type }} diff --git a/helm/silo/templates/serviceaccount.yaml b/helm/silo/templates/serviceaccount.yaml index 07840153d91e4..e7086791ddf3e 100644 --- a/helm/silo/templates/serviceaccount.yaml +++ b/helm/silo/templates/serviceaccount.yaml @@ -3,4 +3,8 @@ apiVersion: v1 kind: ServiceAccount metadata: name: {{ .Values.serviceAccount.name | quote }} + {{- with .Values.commonLabels }} + labels: + {{- tpl (toYaml .) $ | nindent 4 }} + {{- end }} {{- end }} diff --git a/helm/silo/templates/servicemonitor.yaml b/helm/silo/templates/servicemonitor.yaml index 8bd15eb5b5644..4f0d51020783f 100644 --- a/helm/silo/templates/servicemonitor.yaml +++ b/helm/silo/templates/servicemonitor.yaml @@ -11,8 +11,11 @@ metadata: chart: {{ template "silo.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} - {{- if .Values.metrics.serviceMonitor.additionalLabels }} - {{- toYaml .Values.metrics.serviceMonitor.additionalLabels | nindent 4 }} + {{- with .Values.metrics.serviceMonitor.additionalLabels }} + {{- tpl (toYaml .) $ | nindent 4 }} + {{- end }} + {{- with .Values.commonLabels }} + {{- tpl (toYaml .) $ | nindent 4 }} {{- end }} {{- if .Values.metrics.serviceMonitor.annotations }} annotations: {{- toYaml .Values.metrics.serviceMonitor.annotations | nindent 4 }} @@ -39,8 +42,8 @@ spec: {{- if .Values.metrics.serviceMonitor.scrapeTimeout }} scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }} {{- end }} - {{- if .Values.metrics.serviceMonitor.relabelConfigs }} - {{- toYaml .Values.metrics.serviceMonitor.relabelConfigs | nindent 6 }} + {{- with .Values.metrics.serviceMonitor.relabelConfigs }} + {{- tpl (toYaml .) $ | nindent 6 }} {{- end }} {{- if not .Values.metrics.serviceMonitor.public }} bearerTokenSecret: @@ -55,6 +58,10 @@ spec: app: {{ include "silo.name" . }} release: {{ .Release.Name }} monitoring: "true" + {{- with .Values.metrics.serviceMonitor.targetLabels }} + targetLabels: + {{- tpl (toYaml .) $ | nindent 4 }} + {{- end }} {{- end }} {{- if .Values.metrics.serviceMonitor.enabled }} --- @@ -70,8 +77,8 @@ metadata: chart: {{ template "silo.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} - {{- if .Values.metrics.serviceMonitor.additionalLabels }} - {{- toYaml .Values.metrics.serviceMonitor.additionalLabels | nindent 4 }} + {{- with .Values.metrics.serviceMonitor.additionalLabels }} + {{- tpl (toYaml .) $ | nindent 4 }} {{- end }} spec: jobName: {{ template "silo.fullname" . }} @@ -91,13 +98,17 @@ spec: {{- else }} scheme: http {{- end }} - {{- if .Values.metrics.serviceMonitor.relabelConfigsCluster }} - {{- toYaml .Values.metrics.serviceMonitor.relabelConfigsCluster | nindent 2 }} + {{- with .Values.metrics.serviceMonitor.relabelConfigsCluster }} + {{- tpl (toYaml .) $ | nindent 2 }} {{- end }} targets: staticConfig: static: - {{ template "silo.fullname" . }}.{{ .Release.Namespace }} + {{- with .Values.metrics.serviceMonitor.probeRelabelingConfigs }} + relabelingConfigs: + {{- tpl (toYaml .) $ | nindent 8 }} + {{- end }} {{- if not .Values.metrics.serviceMonitor.public }} {{- if .Values.metrics.serviceMonitor.interval }} interval: {{ .Values.metrics.serviceMonitor.interval }} diff --git a/helm/silo/templates/statefulset.yaml b/helm/silo/templates/statefulset.yaml index 0258a7ee3c248..a730b241bc944 100644 --- a/helm/silo/templates/statefulset.yaml +++ b/helm/silo/templates/statefulset.yaml @@ -20,6 +20,9 @@ metadata: chart: {{ template "silo.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- with .Values.commonLabels }} + {{- tpl (toYaml .) $ | nindent 4 }} + {{- end }} spec: publishNotReadyAddresses: true clusterIP: None @@ -41,11 +44,15 @@ metadata: chart: {{ template "silo.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} - {{- if .Values.additionalLabels }} - {{- toYaml .Values.additionalLabels | nindent 4 }} + {{- with .Values.additionalLabels }} + {{- tpl (toYaml .) $ | nindent 4 }} + {{- end }} + {{- with .Values.commonLabels }} + {{- tpl (toYaml .) $ | nindent 4 }} {{- end }} - {{- if .Values.additionalAnnotations }} - annotations: {{- toYaml .Values.additionalAnnotations | nindent 4 }} + {{- with .Values.additionalAnnotations }} + annotations: + {{- tpl (toYaml .) $ | nindent 4 }} {{- end }} spec: updateStrategy: @@ -63,8 +70,11 @@ spec: labels: app: {{ template "silo.name" . }} release: {{ .Release.Name }} - {{- if .Values.podLabels }} - {{- toYaml .Values.podLabels | nindent 8 }} + {{- with .Values.podLabels }} + {{- tpl (toYaml .) $ | nindent 8 }} + {{- end }} + {{- with .Values.commonLabels }} + {{- tpl (toYaml .) $ | nindent 8 }} {{- end }} annotations: {{- if not .Values.ignoreChartChecksums }} @@ -90,7 +100,7 @@ spec: {{- end }} containers: - name: {{ include "silo.name" . }} - image: {{ .Values.image.repository }}:{{ .Values.image.tag }} + image: {{ tpl .Values.image.repository . }}:{{ tpl .Values.image.tag . }} imagePullPolicy: {{ .Values.image.pullPolicy }} command: [ "/bin/sh", diff --git a/helm/silo/values.yaml b/helm/silo/values.yaml index 52d8df3b150bb..2233eff30f6d4 100644 --- a/helm/silo/values.yaml +++ b/helm/silo/values.yaml @@ -37,6 +37,9 @@ additionalLabels: {} ## Additional annotations to include with deployment or statefulset additionalAnnotations: {} +## Common labels applied to all resources +commonLabels: {} + ## Typically the deployment/statefulset includes checksums of secrets/config, ## So that when these change on a subsequent helm install, the deployment/statefulset ## is restarted. This can result in unnecessary restarts under GitOps tooling such as @@ -358,6 +361,7 @@ makePolicyJob: enabled: false runAsUser: 1000 runAsGroup: 1000 + containerSecurityContext: {} resources: requests: memory: 128Mi @@ -388,6 +392,7 @@ makeUserJob: enabled: false runAsUser: 1000 runAsGroup: 1000 + containerSecurityContext: {} resources: requests: memory: 128Mi @@ -428,6 +433,7 @@ makeServiceAccountJob: enabled: false runAsUser: 1000 runAsGroup: 1000 + containerSecurityContext: {} resources: requests: memory: 128Mi @@ -465,6 +471,7 @@ makeBucketJob: enabled: false runAsUser: 1000 runAsGroup: 1000 + containerSecurityContext: {} resources: requests: memory: 128Mi @@ -483,6 +490,7 @@ customCommandJob: enabled: false runAsUser: 1000 runAsGroup: 1000 + containerSecurityContext: {} resources: requests: memory: 128Mi @@ -510,6 +518,7 @@ postJob: runAsUser: 1000 runAsGroup: 1000 fsGroup: 1000 + containerSecurityContext: {} nodeSelector: {} tolerations: [] affinity: {} @@ -532,6 +541,9 @@ extraSecret: ~ oidc: enabled: false configUrl: "https://identity-provider-url/.well-known/openid-configuration" + # Provide existing ConfigMap for the Config URL + existingConfigMapName: "" + existingConfigUrlKey: "" clientId: "silo" clientSecret: "" # Provide existing client secret from the Kubernetes Secret resource, existing secret will have priority over `clientId` and/or `clientSecret`` @@ -553,6 +565,12 @@ networkPolicy: flavor: kubernetes # Allow external access to the Silo API. allowExternal: true + # Additional from values to add to the Ingress + allowFrom: [] + ## E.X. + # - namespaceSelector: + # matchLabels: + # kubernetes.io/metadata.name: prometheus ## @params networkPolicy.egress configuration of the egress traffic egress: ## @param networkPolicy.egress.enabled When enabled, an egress network policy will be @@ -604,6 +622,8 @@ metrics: public: true additionalLabels: {} annotations: {} + # targetLabels for the ServiceMonitor + targetLabels: [] # for node metrics relabelConfigs: {} # for cluster metrics @@ -612,6 +632,8 @@ metrics: # metricRelabelings: # - regex: (server|pod) # action: labeldrop + # Probe relabelingConfigs added to the probe target + probeRelabelingConfigs: [] namespace: ~ # Scrape interval, for example `interval: 30s` interval: ~