Skip to content

Commit

Permalink
feat(PLATFORM-1020): support custom volume mounts for certificate files
Browse files Browse the repository at this point in the history
This opens up supporting the use case of reading certificate files from
volumes created by the Secrets Store CSI driver for k8s.
  • Loading branch information
thefirstofthe300 committed Nov 19, 2022
1 parent 0116f63 commit cb70f27
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 2 deletions.
6 changes: 5 additions & 1 deletion gremlin/templates/chao-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,12 @@ spec:
{{- end }}
volumes:
- name: gremlin-cert
{{- if .Values.gremlin.secret.certVolume }}
{{ .Values.gremlin.secret.certVolume | toYaml | indent 8 }}
{{- else }}
secret:
secretName: {{ include "gremlin.secretName" . }}
secretName: gremlin-secret
{{- end }}
{{- if .Values.ssl.certFile }}
- name: ssl-cert-file
secret:
Expand Down
4 changes: 4 additions & 0 deletions gremlin/templates/chao-service-account.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ kind: ServiceAccount
metadata:
name: chao
namespace: {{ .Release.Namespace }}
{{ if .Values.chao.serviceAccount.annotations -}}
annotations:
{{ .Values.chao.serviceAccount.annotations | toYaml }}
{{- end }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Expand Down
6 changes: 5 additions & 1 deletion gremlin/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,12 @@ spec:
path: /proc/sysrq-trigger
{{- if (eq (include "gremlin.secretType" .) "certificate") }}
- name: gremlin-cert
{{- if .Values.gremlin.secret.certVolume }}
{{ .Values.gremlin.secret.certVolume | toYaml | indent 10}}
{{- else }}
secret:
secretName: {{ include "gremlin.secretName" . }}
secretName: gremlin-secret
{{- end }}
{{- end }}
{{- if and .Values.gremlin.podSecurity.seccomp.enabled (eq "localhost/gremlin" .Values.gremlin.podSecurity.seccomp.profile) }}
- name: seccomp-root
Expand Down
4 changes: 4 additions & 0 deletions gremlin/templates/gremlin-service-account.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ kind: ServiceAccount
metadata:
name: gremlin
namespace: {{ .Release.Namespace }}
{{ if .Values.gremlin.serviceAccount.annotations -}}
annotations:
{{ .Values.gremlin.serviceAccount.annotations | toYaml }}
{{- end }}
{{ if .Values.gremlin.podSecurity.podSecurityPolicy.create }}
---
apiVersion: rbac.authorization.k8s.io/v1
Expand Down
13 changes: 13 additions & 0 deletions gremlin/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ gremlin:
# Gremlin's requirements (see gremlin.podSecurity.podSecurityPolicy and
# gremlin.podSecurity.securityContextConstraints)
create: true
annotations: {}

podSecurity:

Expand Down Expand Up @@ -237,6 +238,7 @@ gremlin:
secret:
# Gremlin supports both `certificate` and `secret` types
# To manage secrets with helm, set `managed=true` and fill in either the certificate auth or secret auth sections
name: gremlin-secret
type: certificate
managed: false
# team identifier (e.g. 11111111-1111-1111-1111-111111111111)
Expand All @@ -250,6 +252,14 @@ gremlin:
# team private key (e.g. -----BEGIN EC PRIVATE KEY-----...-----END EC PRIVATE KEY-----)
key:

# Used to define the value of the gremlin-cert volume except the name
# This volume should always contain two files named
# - gremlin.cert
# - gremlin.key
# containing the team certificate and private key used to auth the agents
# to the gremlin API
certVolume: {}

## Secret auth requires: `teamSecret`
# team secret (e.g. 00000000-0000-0000-0000-000000000000)
teamSecret:
Expand All @@ -276,6 +286,9 @@ chao:

affinity: {}

serviceAccount:
annotations: {}

ssl:
# ssl.certFile -
# Add a certificate file to Gremlin's set of certificate authorities. This argument expects a file containing the
Expand Down

0 comments on commit cb70f27

Please sign in to comment.