Skip to content

Commit 895041d

Browse files
Merge pull request #96 from port-labs/PORT-7665-allow-extra-labels-for-ocean-chartgs
added extraLabels to allow setting labels to the deployments
2 parents a1e9986 + 6819743 commit 895041d

File tree

6 files changed

+17
-3
lines changed

6 files changed

+17
-3
lines changed

charts/port-agent/templates/_helpers.tpl

+3
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ helm.sh/chart: {{ include "port-agent.chart" . }}
4040
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
4141
{{- end }}
4242
app.kubernetes.io/managed-by: {{ .Release.Service }}
43+
{{- range $key, $value := .Values.extraLabels }}
44+
{{$key}}: {{ $value }}
45+
{{- end }}
4346
{{- end }}
4447

4548
{{/*

charts/port-agent/templates/deployment.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ spec:
1818
{{- toYaml . | nindent 8 }}
1919
{{- end }}
2020
labels:
21-
{{- include "port-agent.selectorLabels" . | nindent 8 }}
21+
{{- include "port-agent.labels" . | nindent 8 }}
2222
spec:
2323
{{- with .Values.imagePullSecrets }}
2424
imagePullSecrets:

charts/port-agent/values.yaml

+4-2
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,18 @@ env:
2727
PORT_CLIENT_ID: ""
2828
PORT_CLIENT_SECRET: ""
2929

30+
extraLabels: {}
31+
3032
podAnnotations: {}
3133

3234
podSecurityContext: {}
33-
# Example
35+
# Example
3436
# runAsGroup: 1001
3537
# runAsUser: 1001
3638
# fsGroup: 1001
3739
# fsGroupChangePolicy: "OnRootMismatch"
3840
containerSecurityContext: {}
39-
# Example
41+
# Example
4042
# runAsGroup: 1001
4143
# runAsUser: 1001
4244
# allowPrivilegeEscalation: false

charts/port-ocean/templates/_helpers.tpl

+3
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ helm.sh/chart: {{ include "port-ocean.chart" . }}
4040
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
4141
{{- end }}
4242
app.kubernetes.io/managed-by: {{ .Release.Service }}
43+
{{- range $key, $value := .Values.extraLabels }}
44+
{{$key}}: {{ $value }}
45+
{{- end }}
4346
{{- end }}
4447

4548
{{/*

charts/port-ocean/templates/deployment.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,21 @@ apiVersion: apps/v1
22
kind: Deployment
33
metadata:
44
name: {{ include "port-ocean.deploymentName" . }}
5+
labels:
6+
{{- include "port-ocean.labels" . | nindent 8 }}
57
spec:
68
strategy:
79
type: {{ .Values.rolloutStrategy | default "Recreate" }}
810
replicas: 1
911
selector:
1012
matchLabels:
1113
app: {{ include "port-ocean.deploymentName" . }}
14+
{{- include "port-ocean.selectorLabels" . | nindent 6 }}
1215
template:
1316
metadata:
1417
labels:
1518
app: {{ include "port-ocean.deploymentName" .}}
19+
{{- include "port-ocean.labels" . | nindent 8 }}
1620
spec:
1721
securityContext:
1822
{{- if .Values.podSecurityContext }}

charts/port-ocean/values.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ tolerations: []
4242

4343
affinity: {}
4444

45+
extraLabels: {}
46+
4547
imageRegistry: "ghcr.io/port-labs"
4648

4749
imagePullPolicy: Always

0 commit comments

Comments
 (0)