Skip to content

Instantly share code, notes, and snippets.

@bleggett
Created February 2, 2023 17:04
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/f9644544f7cdf0633827a2cb399ea7f3 to your computer and use it in GitHub Desktop.
Save bleggett/f9644544f7cdf0633827a2cb399ea7f3 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.
#
# https://github.com/istio/istio/issues/43105
#
# 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.
---
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/{{ .Namespace }}/sa/{{ .serviceName }}/wl/foo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment