Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fuzzy-shoes-mate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@openproject/helm-charts": minor
---

Allow commonLabels and custom labels on deployments
7 changes: 5 additions & 2 deletions charts/openproject/templates/cron-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }}
kind: Deployment
metadata:
name: {{ include "common.names.fullname" . }}-cron
labels:
{{- include "common.labels.standard" . | nindent 4 }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
openproject/process: cron
{{- if or .Values.cron.annotations .Values.commonAnnotations }}
{{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.cron.annotations .Values.commonAnnotations ) "context" . ) }}
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
{{- end }}
spec:
replicas: {{ if .Values.cron.enabled }}{{- 1 }}{{ else }}{{- 0 }}{{ end }}
strategy:
Expand Down
9 changes: 4 additions & 5 deletions charts/openproject/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ apiVersion: {{ include "common.capabilities.ingress.apiVersion" . }}
kind: Ingress
metadata:
name: {{ include "common.names.fullname" . }}
labels:
{{- include "common.labels.standard" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- if or .Values.ingress.annotations .Values.commonAnnotations }}
{{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.ingress.annotations .Values.commonAnnotations ) "context" . ) }}
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.ingressClassName }}
Expand Down
9 changes: 4 additions & 5 deletions charts/openproject/templates/persistentvolumeclaim.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ apiVersion: "v1"
kind: "PersistentVolumeClaim"
metadata:
name: {{ include "common.names.fullname" . }}
labels:
{{- include "common.labels.standard" . | nindent 4 }}
{{- with .Values.persistence.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- if or .Values.persistence.annotations .Values.commonAnnotations }}
{{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.persistence.annotations .Values.commonAnnotations ) "context" . ) }}
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
{{- end }}
spec:
accessModes: {{ .Values.persistence.accessModes }}
Expand Down
6 changes: 4 additions & 2 deletions charts/openproject/templates/secret_core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ apiVersion: "v1"
kind: "Secret"
metadata:
name: "{{ include "common.names.fullname" . }}-core"
labels:
{{- include "common.labels.standard" . | nindent 4 }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
data: # reset data to make sure only keys defined below remain
stringData:
{{- if .Values.postgresql.bundled }}
Expand Down
6 changes: 4 additions & 2 deletions charts/openproject/templates/secret_cron_environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ apiVersion: "v1"
kind: "Secret"
metadata:
name: "{{ include "common.names.fullname" . }}-cron-environment"
labels:
{{- include "common.labels.standard" . | nindent 4 }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
data: # reset data to make sure only keys defined below remain
stringData:
# Additional environment variables
Expand Down
6 changes: 4 additions & 2 deletions charts/openproject/templates/secret_environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ apiVersion: "v1"
kind: "Secret"
metadata:
name: "{{ include "common.names.fullname" . }}-environment"
labels:
{{- include "common.labels.standard" . | nindent 4 }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
data: # reset data to make sure only keys defined below remain
stringData:
# Additional environment variables
Expand Down
6 changes: 4 additions & 2 deletions charts/openproject/templates/secret_memcached.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ apiVersion: "v1"
kind: "Secret"
metadata:
name: "{{ include "common.names.fullname" . }}-memcached"
labels:
{{- include "common.labels.standard" . | nindent 4 }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
data: # reset data to make sure only keys defined below remain
stringData:
{{- if .Values.memcached.bundled }}
Expand Down
6 changes: 4 additions & 2 deletions charts/openproject/templates/secret_oidc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ apiVersion: "v1"
kind: "Secret"
metadata:
name: "{{ include "common.names.fullname" . }}-oidc"
labels:
{{- include "common.labels.standard" . | nindent 4 }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
data: # reset data to make sure only keys defined below remain
stringData:
# OpenID Connect settings
Expand Down
6 changes: 4 additions & 2 deletions charts/openproject/templates/secret_s3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ apiVersion: "v1"
kind: "Secret"
metadata:
name: "{{ include "common.names.fullname" . }}-s3"
labels:
{{- include "common.labels.standard" . | nindent 4 }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
data: # reset data to make sure only keys defined below remain
stringData:
OPENPROJECT_ATTACHMENTS__STORAGE: fog
Expand Down
11 changes: 5 additions & 6 deletions charts/openproject/templates/seeder-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ apiVersion: batch/v1
kind: Job
metadata:
name: {{ include "common.names.fullname" . }}-seeder-{{ .Release.Revision }}
labels:
{{- include "common.labels.standard" . | nindent 4 }}
{{- with .Values.seederJob.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- if or .Values.seederJob.annotations .Values.commonAnnotations }}
{{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.seederJob.annotations .Values.commonAnnotations ) "context" . ) }}
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
{{- end }}
spec:
{{- if .Values.cleanup.deletePodsOnSuccess }}
Expand All @@ -15,7 +14,7 @@ spec:
template:
metadata:
labels:
{{- include "common.labels.standard" . | nindent 8 }}
{{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 8 }}
openproject/process: seeder
{{- with .Values.seederJob.annotations }}
annotations:
Expand Down
6 changes: 4 additions & 2 deletions charts/openproject/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ apiVersion: "v1"
kind: "Service"
metadata:
name: {{ include "common.names.fullname" . }}
labels:
{{- include "common.labels.standard" . | nindent 4 }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.service.type }}
{{- if eq .Values.service.type "LoadBalancer" }}
Expand Down
9 changes: 4 additions & 5 deletions charts/openproject/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ apiVersion: "v1"
kind: "ServiceAccount"
metadata:
name: {{ include "common.names.fullname" . }}
labels:
{{- include "common.labels.standard" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- if or .Values.serviceAccount.annotations .Values.commonAnnotations }}
{{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.serviceAccount.annotations .Values.commonAnnotations ) "context" . ) }}
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
{{- end }}
...
{{- end }}
10 changes: 8 additions & 2 deletions charts/openproject/templates/web-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@ apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }}
kind: Deployment
metadata:
name: {{ include "common.names.fullname" . }}-web
labels:
{{- include "common.labels.standard" . | nindent 4 }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- range $key, $value := .Values.web.labels }}
{{ $key }}: {{ $value | quote }}
{{- end }}
openproject/process: web
{{- if or .Values.web.annotations .Values.openproject.annotations .Values.commonAnnotations }}
{{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.web.annotations .Values.openproject.annotations .Values.commonAnnotations ) "context" . ) }}
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
{{- end }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
Expand Down
12 changes: 9 additions & 3 deletions charts/openproject/templates/worker-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@ apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }}
kind: Deployment
metadata:
name: {{ include "common.names.fullname" . }}-worker-{{ $workerName }}
labels:
{{- include "common.labels.standard" . | nindent 4 }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- range $key, $value := .Values.worker.labels }}
{{ $key }}: {{ $value | quote }}
{{- end }}
openproject/process: worker-{{ $workerName }}
{{- if or .Values.worker.annotations .Values.openproject.annotations .Values.commonAnnotations }}
{{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.worker.annotations .Values.openproject.annotations .Values.commonAnnotations ) "context" . ) }}
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
{{- end }}
spec:
replicas: {{( kindIs "invalid" $workerValues.replicaCount) | ternary .Values.backgroundReplicaCount $workerValues.replicaCount }}
strategy:
Expand All @@ -24,7 +30,7 @@ spec:
{{- end }}
{{- include "openproject.envChecksums" . | nindent 8 }}
labels:
{{- include "common.labels.standard" . | nindent 8 }}
{{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 8 }}
openproject/process: worker-{{ $workerName }}
spec:
{{- include "openproject.imagePullSecrets" . | indent 6 }}
Expand Down
35 changes: 35 additions & 0 deletions charts/openproject/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ global:
## - myRegistryKeySecretName
#
imagePullSecrets: []
## Add labels to all the deployed resources
commonLabels: {}
## Add annotations to all the deployed resources
commonAnnotations: {}

## Affinity for pod assignment.
##
Expand Down Expand Up @@ -236,6 +240,9 @@ memcached:
readOnlyRootFilesystem: true
runAsNonRoot: true

## @param commonLabels Add labels to all the deployed resources
##
commonLabels: {}
## When "bundled" is set to false, you need to define the memcached connection details.
#
connection:
Expand Down Expand Up @@ -272,13 +279,29 @@ web:
#
topologySpreadConstraints: []

## Define custom web deployment labels:
##
labels: {}

## Define custom web deployment annotations:
##
annotations: {}

## Node labels for worker pod assignment.
## If not specified, falls back to the global nodeSelector above.
##
## Ref: https://kubernetes.io/docs/user-guide/node-selection/
#
worker:
nodeSelector: {}

## Define custom worker deployment labels:
##
labels: {}

## Define custom worker deployment annotations:
##
annotations: {}
## Topology spread constraints for worker pod assignment.
## If not specified, falls back to the global topologySpreadConstraints above.
##
Expand Down Expand Up @@ -320,6 +343,10 @@ cron:
IMAP_PASSWORD:
IMAP_PORT: 993

## Define custom cron deployment annotations:
##
annotations: {}

## To avoid having sensitive credentials in your values.yaml, the preferred way is to
## use an existing secret containing the IMAP credentials.
## Specify the name of this existing secret here.
Expand Down Expand Up @@ -440,6 +467,10 @@ openproject:
#
postgresStatementTimeout: 120s

## Define custom web/worker deployment annotations:
##
annotations: {}

## Whether or not to use ephemeral volumes for /app/tmp and /tmp.
## Falls back to a sensible default if undefined.
#
Expand Down Expand Up @@ -601,6 +632,10 @@ postgresql:
readOnlyRootFilesystem: true
runAsNonRoot: true

## @param commonLabels Add labels to all the deployed resources
##
commonLabels: {}

## When "bundled" is set to false, you need to define the database connection details.
#
connection:
Expand Down
Loading