Skip to content

Instantly share code, notes, and snippets.

@bleggett
Created February 2, 2023 16:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bleggett/d65bc29c00089d5eff4fa4d15d9a639a to your computer and use it in GitHub Desktop.
Save bleggett/d65bc29c00089d5eff4fa4d15d9a639a to your computer and use it in GitHub Desktop.
# TODO destination rules need to be created for any SPIFFE IDs that don't follow the
# format that Istio expects (ns/NAMESPACE/sa/TARGET_POD_SVC_ACCOUNT)
# because ATM Istio defaults to clientside SAN checks that assume that SPIFFE ID format
# and this is not currently configurable - however this should be resolved soonish.
# https://github.com/istio/istio/issues/28712
#
# Additionally, since DestinationRules override Istio's "default automTLS" settings, we need `mode: ISTIO_MUTUAL`
# in each DestRule to tell Istio that even though we have a custom destination config, we still want mTLS.
{{- range .Values.spireIdentities }}
---
apiVersion: networking.istio.io/v1beta1
kind: DestinationRule
metadata:
name: {{ .serviceName }}-custom-spire-destrule
spec:
host: {{ .serviceName }}
trafficPolicy:
tls:
mode: ISTIO_MUTUAL
subjectAltNames:
- spiffe://example.org/ns/{{ $.Release.Namespace }}/sa/{{ .serviceName }}/wl/foo
{{- end }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment