diff --git a/charts/linkerd/templates/_validate.tpl b/charts/linkerd/templates/_validate.tpl new file mode 100644 index 0000000000000..959a98a6bd696 --- /dev/null +++ b/charts/linkerd/templates/_validate.tpl @@ -0,0 +1,9 @@ +{{- define "linkerd.proxy.validation" -}} +{{- if .DisableIdentity -}} +{{- fail (printf "Can't disable identity mTLS for %s. Set '.Values.Proxy.DisableIdentity' to 'false'" .Component) -}} +{{- end -}} + +{{- if .DisableTap -}} +{{- fail (printf "Can't disable tap for %s. Set '.Values.Proxy.DisableTap' to 'false'" .Component) -}} +{{- end -}} +{{- end -}} diff --git a/charts/linkerd/templates/controller.yaml b/charts/linkerd/templates/controller.yaml index cef302f278e55..4ecdb89c1df50 100644 --- a/charts/linkerd/templates/controller.yaml +++ b/charts/linkerd/templates/controller.yaml @@ -47,6 +47,7 @@ spec: {{ end -}} {{ $_ := set .Proxy "WorkloadKind" "deployment" -}} {{ $_ := set .Proxy "Component" "linkerd-controller" -}} +{{ include "linkerd.proxy.validation" .Proxy -}} apiVersion: apps/v1 kind: Deployment metadata: diff --git a/charts/linkerd/templates/grafana.yaml b/charts/linkerd/templates/grafana.yaml index 9ef2f73d76547..acf196cd28251 100644 --- a/charts/linkerd/templates/grafana.yaml +++ b/charts/linkerd/templates/grafana.yaml @@ -88,6 +88,7 @@ spec: {{ end -}} {{ $_ := set .Proxy "WorkloadKind" "deployment" -}} {{ $_ := set .Proxy "Component" "linkerd-grafana" -}} +{{ include "linkerd.proxy.validation" .Proxy -}} apiVersion: apps/v1 kind: Deployment metadata: diff --git a/charts/linkerd/templates/identity.yaml b/charts/linkerd/templates/identity.yaml index a381a6b219871..082ebe323c528 100644 --- a/charts/linkerd/templates/identity.yaml +++ b/charts/linkerd/templates/identity.yaml @@ -48,6 +48,7 @@ spec: {{ end -}} {{ $_ := set .Proxy "WorkloadKind" "deployment" -}} {{ $_ := set .Proxy "Component" "linkerd-identity" -}} +{{ include "linkerd.proxy.validation" .Proxy -}} apiVersion: apps/v1 kind: Deployment metadata: diff --git a/charts/linkerd/templates/prometheus.yaml b/charts/linkerd/templates/prometheus.yaml index 8cb392d12edb8..a4be3ad9d1797 100644 --- a/charts/linkerd/templates/prometheus.yaml +++ b/charts/linkerd/templates/prometheus.yaml @@ -117,6 +117,7 @@ spec: {{ end -}} {{ $_ := set .Proxy "WorkloadKind" "deployment" -}} {{ $_ := set .Proxy "Component" "linkerd-prometheus" -}} +{{ include "linkerd.proxy.validation" .Proxy -}} apiVersion: apps/v1 kind: Deployment metadata: diff --git a/charts/linkerd/templates/proxy-injector.yaml b/charts/linkerd/templates/proxy-injector.yaml index 93e90165f9300..289cd5e433da0 100644 --- a/charts/linkerd/templates/proxy-injector.yaml +++ b/charts/linkerd/templates/proxy-injector.yaml @@ -9,6 +9,7 @@ {{ end -}} {{ $_ := set .Proxy "WorkloadKind" "deployment" -}} {{ $_ := set .Proxy "Component" "linkerd-proxy-injector" -}} +{{ include "linkerd.proxy.validation" .Proxy -}} apiVersion: apps/v1 kind: Deployment metadata: diff --git a/charts/linkerd/templates/sp-validator.yaml b/charts/linkerd/templates/sp-validator.yaml index b8145fff4d4fc..25766e22c6db5 100644 --- a/charts/linkerd/templates/sp-validator.yaml +++ b/charts/linkerd/templates/sp-validator.yaml @@ -28,6 +28,7 @@ spec: {{ end -}} {{ $_ := set .Proxy "WorkloadKind" "deployment" -}} {{ $_ := set .Proxy "Component" "linkerd-sp-validator" -}} +{{ include "linkerd.proxy.validation" .Proxy -}} apiVersion: apps/v1 kind: Deployment metadata: diff --git a/charts/linkerd/templates/tap.yaml b/charts/linkerd/templates/tap.yaml index bcf13050e488c..846ea94485dac 100644 --- a/charts/linkerd/templates/tap.yaml +++ b/charts/linkerd/templates/tap.yaml @@ -28,6 +28,7 @@ spec: {{ end -}} {{ $_ := set .Proxy "WorkloadKind" "deployment" -}} {{ $_ := set .Proxy "Component" "linkerd-tap" -}} +{{ include "linkerd.proxy.validation" .Proxy -}} apiVersion: apps/v1 kind: Deployment metadata: diff --git a/charts/linkerd/templates/web.yaml b/charts/linkerd/templates/web.yaml index 3d1e215c3ba60..213046aebf750 100644 --- a/charts/linkerd/templates/web.yaml +++ b/charts/linkerd/templates/web.yaml @@ -31,6 +31,7 @@ spec: {{ end -}} {{ $_ := set .Proxy "WorkloadKind" "deployment" -}} {{ $_ := set .Proxy "Component" "linkerd-web" -}} +{{ include "linkerd.proxy.validation" .Proxy -}} apiVersion: apps/v1 kind: Deployment metadata: