Skip to content

Commit

Permalink
Add support to set common labels
Browse files Browse the repository at this point in the history
  • Loading branch information
uzzz authored and mosabua committed Aug 11, 2023
1 parent b7e18e8 commit b87e1d9
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions charts/trino/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ The following table lists the configurable parameters of the Trino chart and the
| `worker.labels` | | `{}` |
| `kafka.mountPath` | | `"/etc/trino/schemas"` |
| `kafka.tableDescriptions` | | `{}` |
| `commonLabels` | Labels that get applied to every resource's metadata | `{}` |



Expand Down
4 changes: 4 additions & 0 deletions charts/trino/templates/autoscaler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: {{ template "trino.worker" . }}
{{- if .Values.commonLabels }}
labels:
{{- tpl (toYaml .Values.commonLabels) . | nindent 4 }}
{{- end }}
spec:
maxReplicas: {{ .Values.server.autoscaling.maxReplicas }}
minReplicas: {{ .Values.server.workers }}
Expand Down
3 changes: 3 additions & 0 deletions charts/trino/templates/configmap-catalog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ metadata:
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
role: catalogs
{{- if .Values.commonLabels }}
{{- tpl (toYaml .Values.commonLabels) . | nindent 4 }}
{{- end }}
data:
tpch.properties: |
connector.name=tpch
Expand Down
3 changes: 3 additions & 0 deletions charts/trino/templates/configmap-coordinator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ metadata:
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
component: coordinator
{{- if .Values.commonLabels }}
{{- tpl (toYaml .Values.commonLabels) . | nindent 4 }}
{{- end }}
data:
node.properties: |
node.environment={{ .Values.server.node.environment }}
Expand Down
3 changes: 3 additions & 0 deletions charts/trino/templates/configmap-worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ metadata:
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
component: worker
{{- if .Values.commonLabels }}
{{- tpl (toYaml .Values.commonLabels) . | nindent 4 }}
{{- end }}
data:
node.properties: |
node.environment={{ .Values.server.node.environment }}
Expand Down
3 changes: 3 additions & 0 deletions charts/trino/templates/deployment-coordinator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ metadata:
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
component: coordinator
{{- if .Values.commonLabels }}
{{- tpl (toYaml .Values.commonLabels) . | nindent 4 }}
{{- end }}
spec:
selector:
matchLabels:
Expand Down
3 changes: 3 additions & 0 deletions charts/trino/templates/deployment-worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ metadata:
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
component: worker
{{- if .Values.commonLabels }}
{{- tpl (toYaml .Values.commonLabels) . | nindent 4 }}
{{- end }}
spec:
replicas: {{ .Values.server.workers }}
selector:
Expand Down
2 changes: 2 additions & 0 deletions charts/trino/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -294,3 +294,5 @@ kafka:
# ]
# }
# }

commonLabels: {} # Labels that get applied to every resource's metadata

0 comments on commit b87e1d9

Please sign in to comment.