mirror of
https://github.com/bvanroll/cicdTest.git
synced 2025-08-29 12:02:47 +00:00
31 lines
1.2 KiB
YAML
31 lines
1.2 KiB
YAML
# The MutatingWebhookConfiguration to enable the Connect injector.
|
|
{{- if (or (and (ne (.Values.connectInject.enabled | toString) "-") .Values.connectInject.enabled) (and (eq (.Values.connectInject.enabled | toString) "-") .Values.global.enabled)) }}
|
|
apiVersion: admissionregistration.k8s.io/v1beta1
|
|
kind: MutatingWebhookConfiguration
|
|
metadata:
|
|
name: {{ template "consul.fullname" . }}-connect-injector-cfg
|
|
namespace: {{ .Release.Namespace }}
|
|
labels:
|
|
app: {{ template "consul.name" . }}
|
|
chart: {{ template "consul.chart" . }}
|
|
heritage: {{ .Release.Service }}
|
|
release: {{ .Release.Name }}
|
|
webhooks:
|
|
- name: {{ template "consul.fullname" . }}-connect-injector.consul.hashicorp.com
|
|
clientConfig:
|
|
service:
|
|
name: {{ template "consul.fullname" . }}-connect-injector-svc
|
|
namespace: {{ .Release.Namespace }}
|
|
path: "/mutate"
|
|
caBundle: {{ .Values.connectInject.certs.caBundle | quote }}
|
|
rules:
|
|
- operations: [ "CREATE" ]
|
|
apiGroups: [""]
|
|
apiVersions: ["v1"]
|
|
resources: ["pods"]
|
|
{{- if .Values.connectInject.namespaceSelector }}
|
|
namespaceSelector:
|
|
{{ tpl .Values.connectInject.namespaceSelector . | indent 6 }}
|
|
{{- end }}
|
|
{{- end }}
|