Skip to content

Commit

Permalink
Add mTLS auth to the Helm chart
Browse files Browse the repository at this point in the history
This adds the ability to enable mtls-spiffe support in the Helm chart,
It will set the required config flags to the defaults as wel
as mount the spire socket to the agent pods.

Signed-off-by: Maartje Eyskens <maartje.eyskens@isovalent.com>
  • Loading branch information
meyskens committed Mar 16, 2023
1 parent b21dac4 commit d699086
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 1 deletion.
16 changes: 16 additions & 0 deletions Documentation/helm-values.rst

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion Documentation/spelling_wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,9 @@ asm
assignees
au
auth
authenticator
authMapMax
authMapMin
authenticator
autoDirectNodeRoutes
autoMount
autoProtectPortRange
Expand Down Expand Up @@ -710,6 +710,7 @@ monitorInterval
mountCgroup
mountPath
mov
mtls
mul
multi
multicore
Expand Down Expand Up @@ -947,6 +948,9 @@ sockops
sortBufferDrainTimeout
sortBufferLenMax
sourceContext
spiffe
spiffeTrustDomain
spireAdminSocketPath
src
srv
ssl
Expand Down
4 changes: 4 additions & 0 deletions install/kubernetes/cilium/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions install/kubernetes/cilium/templates/cilium-agent/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,11 @@ spec:
{{- end }}
terminationMessagePolicy: FallbackToLogsOnError
volumeMounts:
{{- if .Values.auth.mTLS.enabled }}
- name: spire-agent-socket
mountPath: {{ dir .Values.auth.mTLS.spireAdminSocketPath }}
readOnly: false
{{- end }}
{{- if not .Values.securityContext.privileged }}
# Unprivileged containers need to mount /proc/sys/net from the host
# to have write access
Expand Down Expand Up @@ -776,6 +781,12 @@ spec:
hostPath:
path: /run/xtables.lock
type: FileOrCreate
{{- if .Values.auth.mTLS.enabled }}
- name: spire-agent-socket
hostPath:
path: {{ dir .Values.auth.mTLS.spireAdminSocketPath }}
type: DirectoryOrCreate
{{- end }}
{{- if .Values.kubeConfigPath }}
- name: kube-config
hostPath:
Expand Down
6 changes: 6 additions & 0 deletions install/kubernetes/cilium/templates/cilium-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,12 @@ data:

{{- end }}

{{- if .Values.auth.mTLS.enabled }}
mesh-auth-mtls-listener-port: {{ .Values.auth.mTLS.port | quote }}
mesh-auth-spire-admin-socket: {{ .Values.auth.mTLS.spireAdminSocketPath }}
mesh-auth-spiffe-trust-domain: {{ .Values.auth.mTLS.spiffeTrustDomain }}
{{- end }}

---
{{- if and .Values.ipMasqAgent.enabled .Values.ipMasqAgent.config }}
apiVersion: v1
Expand Down
11 changes: 11 additions & 0 deletions install/kubernetes/cilium/values.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions install/kubernetes/cilium/values.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2604,3 +2604,14 @@ dnsProxy:
sctp:
# -- Enable SCTP support. NOTE: Currently, SCTP support does not support rewriting ports or multihoming.
enabled: false

auth:
mTLS:
# -- Enable mtls-spiffe authentication method in CiliumNetworkPolicy
enabled: false
# -- SPIRE socket path where the SPIRE delegated api agent is listening
spireAdminSocketPath: /run/spire/sockets/admin.sock
# -- SPIFFE trust domain to use for fetching certificates
spiffeTrustDomain: spiffe.cilium.io
# -- port on the agent which is used to mTLS handshakes on
port: 4250

0 comments on commit d699086

Please sign in to comment.