Skip to content

Commit bcd9ab1

Browse files
committed
helm: venafi agent: add volumes and volumeMounts for custom CA bundles
1 parent 0ed607c commit bcd9ab1

File tree

4 files changed

+78
-0
lines changed

4 files changed

+78
-0
lines changed

deploy/charts/venafi-kubernetes-agent/templates/deployment.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ spec:
7474
- name: credentials
7575
mountPath: "/etc/venafi/agent/key"
7676
readOnly: true
77+
{{- with .Values.volumeMounts }}
78+
{{- toYaml . | nindent 12 }}
79+
{{- end }}
7780
{{- with .Values.nodeSelector }}
7881
nodeSelector:
7982
{{- toYaml . | nindent 8 }}
@@ -95,3 +98,6 @@ spec:
9598
secret:
9699
secretName: {{ default "agent-credentials" .Values.authentication.secretName }}
97100
optional: false
101+
{{- with .Values.volumes }}
102+
{{- toYaml . | nindent 8 }}
103+
{{- end }}

deploy/charts/venafi-kubernetes-agent/tests/deployment_test.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,31 @@ tests:
7474
- contains:
7575
path: spec.template.spec.containers[0].command
7676
content: notpreflight
77+
78+
# Check the volumes and volumeMounts works correctly
79+
- it: Volumes and VolumeMounts added correctly
80+
set:
81+
config.organisation: test_org
82+
config.cluster: test_cluster
83+
values:
84+
- ./values/custom-volumes.yaml
85+
asserts:
86+
- isKind:
87+
of: Deployment
88+
- equal:
89+
# In template this comes after credentials and agent config volumeMounts
90+
path: spec.template.spec.containers[0].volumeMounts[?(@.name == "cabundle")]
91+
value:
92+
name: cabundle
93+
mountPath: /etc/ssl/certs/ca-certificates.crt
94+
subPath: ca-certificates.crt
95+
readOnly: true
96+
- equal:
97+
path: spec.template.spec.volumes[?(@.name == "cabundle")].configMap
98+
value:
99+
name: cabundle
100+
optional: false
101+
defaultMode: 0644
102+
items:
103+
- key: cabundle
104+
path: ca-certificates.crt
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
volumes:
2+
- name: cabundle
3+
configMap:
4+
name: cabundle
5+
optional: false
6+
defaultMode: 0644
7+
items:
8+
- key: cabundle
9+
path: ca-certificates.crt
10+
11+
volumeMounts:
12+
- name: cabundle
13+
mountPath: /etc/ssl/certs/ca-certificates.crt
14+
subPath: ca-certificates.crt
15+
readOnly: true

deploy/charts/venafi-kubernetes-agent/values.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,35 @@ command: []
9090
# For example `["--strict", "--oneshot"]`
9191
extraArgs: []
9292

93+
# -- Additional volumes to add to the Venafi Kubernetes Agent container. This is
94+
# useful for mounting a custom CA bundle. For example:
95+
#
96+
# volumes:
97+
# - name: cabundle
98+
# configMap:
99+
# name: cabundle
100+
# optional: false
101+
# defaultMode: 0644
102+
# items:
103+
# - key: cabundle
104+
# path: ca-certificates.crt
105+
#
106+
# In order to create the ConfigMap, you can use the following command:
107+
#
108+
# kubectl create configmap cabundle \
109+
# --from-file=cabundle=./your/custom/ca/bundle.pem
110+
volumes: []
111+
112+
# -- Additional volume mounts to add to the Venafi Kubernetes Agent container.
113+
# This is useful for mounting a custom CA bundle. For example:
114+
#
115+
# volumeMounts:
116+
# - name: cabundle
117+
# mountPath: /etc/ssl/certs/ca-certificates.crt
118+
# subPath: ca-certificates.crt
119+
# readOnly: true
120+
volumeMounts: []
121+
93122
# -- Authentication details for the Venafi Kubernetes Agent
94123
authentication:
95124
# -- Name of the secret containing the private key

0 commit comments

Comments
 (0)