diff --git a/connect-inject/container_init.go b/connect-inject/container_init.go index 4a0c4be63f71..1c59787e14b9 100644 --- a/connect-inject/container_init.go +++ b/connect-inject/container_init.go @@ -313,6 +313,9 @@ consul-k8s connect-init -pod-name=${POD_NAME} -pod-namespace=${POD_NAMESPACE} \ # Apply traffic redirection rules. /consul/connect-inject/consul connect redirect-traffic \ + {{- if .AuthMethod }} + -token-file="/consul/connect-inject/acl-token" \ + {{- end }} {{- if .ConsulNamespace }} -namespace="{{ .ConsulNamespace }}" \ {{- end }} diff --git a/connect-inject/container_init_test.go b/connect-inject/container_init_test.go index 8e1e4a5e8fb6..36ffce4f89f2 100644 --- a/connect-inject/container_init_test.go +++ b/connect-inject/container_init_test.go @@ -543,6 +543,7 @@ consul-k8s connect-init -pod-name=${POD_NAME} -pod-namespace=${POD_NAMESPACE} \ # Apply traffic redirection rules. /consul/connect-inject/consul connect redirect-traffic \ + -token-file="/consul/connect-inject/acl-token" \ -namespace="k8snamespace" \ -proxy-id="$(cat /consul/connect-inject/proxyid)" \ -proxy-uid=5995`,