Skip to content

Commit 52e45bc

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

File tree

4 files changed

+68
-2
lines changed

4 files changed

+68
-2
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: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,27 @@ 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+
mountPath: /etc/ssl/certs/
93+
name: cabundle
94+
readOnly: true
95+
- equal:
96+
path: spec.template.spec.volumes[?(@.name == "cabundle")].configmap
97+
value:
98+
defaultMode: 420
99+
name: cabundle
100+
optional: true
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
volumes:
2+
- name: cabundle
3+
configmap:
4+
name: cabundle
5+
optional: true
6+
defaultMode: 0644
7+
8+
volumeMounts:
9+
- name: cabundle
10+
readOnly: true
11+
mountPath: /etc/ssl/certs/

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

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ serviceAccount:
3636
podAnnotations: {}
3737

3838
# -- Optional Pod (all containers) `SecurityContext` options, see https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod.
39-
podSecurityContext: {}
39+
podSecurityContext:
40+
{}
4041
# runAsUser: 1000
4142
# runAsGroup: 3000
4243
# fsGroup: 2000
@@ -60,7 +61,7 @@ podSecurityContext: {}
6061
securityContext:
6162
capabilities:
6263
drop:
63-
- ALL
64+
- ALL
6465
readOnlyRootFilesystem: true
6566
runAsNonRoot: true
6667
runAsUser: 1000
@@ -90,6 +91,30 @@ command: []
9091
# For example `["--strict", "--oneshot"]`
9192
extraArgs: []
9293

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

0 commit comments

Comments
 (0)