22 lines
1.1 KiB
YAML
22 lines
1.1 KiB
YAML
|
{{ $hasConfiguredWebhookCertsUsingVault := (and .Values.global.secretsBackend.vault.enabled .Values.global.secretsBackend.vault.connectInjectRole .Values.global.secretsBackend.vault.connectInject.tlsCert.secretName .Values.global.secretsBackend.vault.connectInject.caCert.secretName .Values.global.secretsBackend.vault.controllerRole .Values.global.secretsBackend.vault.controller.tlsCert.secretName .Values.global.secretsBackend.vault.controller.caCert.secretName) -}}
|
||
|
{{- if (and .Values.connectInject.enabled (not $hasConfiguredWebhookCertsUsingVault)) }}
|
||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||
|
kind: ClusterRoleBinding
|
||
|
metadata:
|
||
|
name: {{ template "consul.fullname" . }}-webhook-cert-manager
|
||
|
labels:
|
||
|
app: {{ template "consul.name" . }}
|
||
|
chart: {{ template "consul.chart" . }}
|
||
|
heritage: {{ .Release.Service }}
|
||
|
release: {{ .Release.Name }}
|
||
|
component: webhook-cert-manager
|
||
|
roleRef:
|
||
|
apiGroup: rbac.authorization.k8s.io
|
||
|
kind: ClusterRole
|
||
|
name: {{ template "consul.fullname" . }}-webhook-cert-manager
|
||
|
subjects:
|
||
|
- kind: ServiceAccount
|
||
|
name: {{ template "consul.fullname" . }}-webhook-cert-manager
|
||
|
namespace: {{ .Release.Namespace }}
|
||
|
{{- end }}
|