Skip to content

Commit 3a90894

Browse files
authored
Merge pull request #361 from alanjino/main
feat: added mtls support
2 parents e2b2ab7 + 9922764 commit 3a90894

File tree

6 files changed

+103
-7
lines changed

6 files changed

+103
-7
lines changed

charts/agent/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 1.1.21
18+
version: 1.1.22
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to

charts/agent/templates/deployment.yaml

Lines changed: 55 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,16 @@ spec:
4646
# path: /
4747
# port: http
4848
env:
49+
{{- if .Values.mtls.enabled }}
50+
- name: CERT_FILE
51+
value: /etc/mtls/client-cert.pem
52+
- name: KEY_FILE
53+
value: /etc/mtls/client-key.pem
54+
- name: CA_FILE
55+
value: /etc/mtls/ca-cert.pem
56+
- name: ENABLE_MTLS_NATS
57+
value: "true"
58+
{{- end }}
4959
- name: KUBERHEALTHY_URL
5060
value: {{ .Values.kuberhealthy.url }}
5161
- name: POLL_INTERVAL
@@ -91,8 +101,13 @@ spec:
91101
value: {{ .Values.opentelemetry.url }}
92102
- name : APPLICATION_NAME
93103
value : {{ .Values.opentelemetry.appName }}
94-
{{- if .Values.persistence.enabled }}
104+
95105
volumeMounts:
106+
{{- if .Values.mtls.enabled }}
107+
- name: mtls
108+
mountPath: /etc/mtls
109+
{{- end }}
110+
{{- if .Values.persistence.enabled }}
96111
- name: data
97112
mountPath: {{ .Values.persistence.mountPath }}
98113
{{- end }}
@@ -118,6 +133,16 @@ spec:
118133
containerPort: 8081
119134
protocol: TCP
120135
env:
136+
{{- if .Values.mtls.enabled }}
137+
- name: CERT_FILE
138+
value: /etc/mtls/client-cert.pem
139+
- name: KEY_FILE
140+
value: /etc/mtls/client-key.pem
141+
- name: CA_FILE
142+
value: /etc/mtls/ca-cert.pem
143+
- name: ENABLE_MTLS_NATS
144+
value: "true"
145+
{{- end }}
121146
- name: CLUSTER_NAME
122147
value: {{ .Values.clusterName }}
123148
- name: NATS_TOKEN
@@ -137,8 +162,13 @@ spec:
137162
value: {{ .Values.opentelemetry.url }}
138163
- name : APPLICATION_NAME
139164
value : {{ .Values.opentelemetry.appName }}
140-
{{- if .Values.git_bridge.persistence.enabled }}
165+
141166
volumeMounts:
167+
{{- if .Values.mtls.enabled }}
168+
- name: mtls
169+
mountPath: /etc/mtls
170+
{{- end }}
171+
{{- if .Values.git_bridge.persistence.enabled }}
142172
- name: data
143173
mountPath: {{ .Values.git_bridge.persistence.mountPath }}
144174
{{- end }}
@@ -165,6 +195,16 @@ spec:
165195
containerPort: 8082
166196
protocol: TCP
167197
env:
198+
{{- if .Values.mtls.enabled }}
199+
- name: CERT_FILE
200+
value: /etc/mtls/client-cert.pem
201+
- name: KEY_FILE
202+
value: /etc/mtls/client-key.pem
203+
- name: CA_FILE
204+
value: /etc/mtls/ca-cert.pem
205+
- name: ENABLE_MTLS_NATS
206+
value: "true"
207+
{{- end }}
168208
- name: CLUSTER_NAME
169209
value: {{ .Values.clusterName }}
170210
- name: NATS_TOKEN
@@ -184,8 +224,13 @@ spec:
184224
value: {{ .Values.opentelemetry.url }}
185225
- name : APPLICATION_NAME
186226
value : {{ .Values.opentelemetry.appName }}
187-
{{- if .Values.container_bridge.persistence.enabled }}
227+
188228
volumeMounts:
229+
{{- if .Values.mtls.enabled }}
230+
- name: mtls
231+
mountPath: /etc/mtls
232+
{{- end }}
233+
{{- if .Values.container_bridge.persistence.enabled }}
189234
- name: data
190235
mountPath: {{ .Values.container_bridge.persistence.mountPath }}
191236
{{- end }}
@@ -203,12 +248,18 @@ spec:
203248
ephemeral-storage: {{ .Values.container_bridge.resources.requests.ephemeralstorage }}
204249
{{- end }}
205250
{{- end }}
206-
{{- if .Values.persistence.enabled }}
251+
207252
volumes:
253+
{{- if .Values.persistence.enabled }}
208254
- name: data
209255
persistentVolumeClaim:
210256
claimName: {{ include "agent.fullname" . }}-data
211257
{{- end }}
258+
{{- if .Values.mtls.enabled }}
259+
- name: mtls
260+
secret:
261+
secretName: {{ .Values.mtls.secret.name }}
262+
{{- end }}
212263
{{- with .Values.nodeSelector }}
213264
nodeSelector:
214265
{{- toYaml . | nindent 8 }}

charts/agent/values.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,3 +281,9 @@ nats:
281281
# secret:
282282
# name: ""
283283
# key: ""
284+
285+
286+
mtls:
287+
enabled: false
288+
secret:
289+
name:

charts/client/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 1.1.27
18+
version: 1.1.28
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to

charts/client/templates/deployment.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ spec:
8484
- name: http
8585
containerPort: 80
8686
protocol: TCP
87+
88+
volumeMounts:
89+
{{- if .Values.mtls.enabled }}
90+
- name: mtls
91+
mountPath: /etc/mtls
92+
{{- end }}
8793
# livenessProbe:
8894
# httpGet:
8995
# path: /
@@ -93,6 +99,16 @@ spec:
9399
# path: /
94100
# port: http
95101
env:
102+
{{- if .Values.mtls.enabled }}
103+
- name: CERT_FILE
104+
value: /etc/mtls/client-cert.pem
105+
- name: KEY_FILE
106+
value: /etc/mtls/client-key.pem
107+
- name: CA_FILE
108+
value: /etc/mtls/ca-cert.pem
109+
- name: ENABLE_MTLS_NATS
110+
value: "true"
111+
{{- end }}
96112
- name: NATS_TOKEN
97113
{{- if and .Values.nats.enabled .Values.nats.auth.enabled .Values.nats.auth.token }}
98114
value: {{ .Values.nats.auth.token }}
@@ -169,6 +185,12 @@ spec:
169185
value : {{ .Values.consumer.kuberhealthyconsumer }}
170186
resources:
171187
{{- toYaml .Values.resources | nindent 12 }}
188+
{{- if .Values.mtls.enabled }}
189+
volumes:
190+
- name: mtls
191+
secret:
192+
secretName: {{ .Values.mtls.secret.name }}
193+
{{- end }}
172194
{{- with .Values.nodeSelector }}
173195
nodeSelector:
174196
{{- toYaml . | nindent 8 }}

charts/client/values.yaml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,15 @@ nats:
9494
# secret:
9595
# name: ""
9696
# key: ""
97+
tls: {}
98+
# secret:
99+
# name:
100+
# ca: ""
101+
# cert: ""
102+
# key: ""
103+
# verify: true
104+
# verify_and_map: true
105+
97106
nats:
98107
jetstream:
99108
enabled: true
@@ -188,4 +197,12 @@ consumer:
188197
trivyconsumer: "TRIVY_CONSUMER"
189198
trivyimageconsumer: "TRIVY_IMAGE_CONSUMER"
190199
trivysbomconsumer: "TRIVY_SBOM_CONSUMER"
191-
kuberhealthyconsumer: "KUBERHEALTHY_CONSUMER"
200+
kuberhealthyconsumer: "KUBERHEALTHY_CONSUMER"
201+
202+
203+
mtls:
204+
enabled: false
205+
secret:
206+
name:
207+
208+

0 commit comments

Comments
 (0)