123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358 |
- {{- $cert := "Cg==" }}
- {{- $certSecret := lookup "v1" "Secret" .Release.Namespace (include "cert-name" .) }}
- {{- if $certSecret }}
- {{- if (index $certSecret.data "tls.crt") }}
- {{- $cert = (index $certSecret.data "tls.crt") }}
- {{- end }}
- {{- end }}
- apiVersion: admissionregistration.k8s.io/v1
- kind: MutatingWebhookConfiguration
- metadata:
- {{- with .Values.clusterOwnerRefereces }}
- ownerReferences:
- {{- toYaml . | nindent 4 }}
- {{- end }}
- name: {{ .Release.Name }}
- namespace: {{ .Release.Namespace }}
- {{- with (.Values.webhooks).annotations }}
- annotations:
- {{ toYaml . | nindent 4 }}
- {{- end }}
- webhooks:
- - name: sgcluster.mutating-webhook.stackgres.io
- sideEffects: None
- rules:
- - operations: ["CREATE", "UPDATE"]
- apiGroups: ["stackgres.io"]
- apiVersions: ["*"]
- resources: ["sgclusters"]
- failurePolicy: Fail
- clientConfig:
- service:
- namespace: {{ .Release.Namespace }}
- name: {{ .Release.Name }}
- path: '/stackgres/mutation/sgcluster'
- caBundle: {{ $cert }}
- admissionReviewVersions: ["v1"]
- {{- if .Values.allowedNamespaces }}
- namespaceSelector:
- matchLabels:
- stackgres.io/scope: {{ .Release.Namespace }}.{{ .Release.Name }}
- {{- else if .Values.allowedNamespaceLabelSelector }}
- namespaceSelector:
- matchLabels:
- {{ toYaml .Values.allowedNamespaceLabelSelector | nindent 8 }}
- {{- end }}
- - name: sgpgconfig.mutating-webhook.stackgres.io
- sideEffects: None
- rules:
- - operations: ["CREATE", "UPDATE"]
- apiGroups: ["stackgres.io"]
- apiVersions: ["*"]
- resources: ["sgpgconfigs"]
- failurePolicy: Fail
- clientConfig:
- service:
- namespace: {{ .Release.Namespace }}
- name: {{ .Release.Name }}
- path: '/stackgres/mutation/sgpgconfig'
- caBundle: {{ $cert }}
- admissionReviewVersions: ["v1"]
- {{- if .Values.allowedNamespaces }}
- namespaceSelector:
- matchLabels:
- stackgres.io/scope: {{ .Release.Namespace }}.{{ .Release.Name }}
- {{- else if .Values.allowedNamespaceLabelSelector }}
- namespaceSelector:
- matchLabels:
- {{ toYaml .Values.allowedNamespaceLabelSelector | nindent 8 }}
- {{- end }}
- - name: sgpoolconfig.mutating-webhook.stackgres.io
- sideEffects: None
- rules:
- - operations: ["CREATE", "UPDATE"]
- apiGroups: ["stackgres.io"]
- apiVersions: ["*"]
- resources: ["sgpoolconfigs"]
- failurePolicy: Fail
- clientConfig:
- service:
- namespace: {{ .Release.Namespace }}
- name: {{ .Release.Name }}
- path: '/stackgres/mutation/sgpoolconfig'
- caBundle: {{ $cert }}
- admissionReviewVersions: ["v1"]
- {{- if .Values.allowedNamespaces }}
- namespaceSelector:
- matchLabels:
- stackgres.io/scope: {{ .Release.Namespace }}.{{ .Release.Name }}
- {{- else if .Values.allowedNamespaceLabelSelector }}
- namespaceSelector:
- matchLabels:
- {{ toYaml .Values.allowedNamespaceLabelSelector | nindent 8 }}
- {{- end }}
- - name: sginstanceprofile.mutating-webhook.stackgres.io
- sideEffects: None
- rules:
- - operations: ["CREATE", "UPDATE"]
- apiGroups: ["stackgres.io"]
- apiVersions: ["*"]
- resources: ["sginstanceprofiles"]
- failurePolicy: Fail
- clientConfig:
- service:
- namespace: {{ .Release.Namespace }}
- name: {{ .Release.Name }}
- path: '/stackgres/mutation/sginstanceprofile'
- caBundle: {{ $cert }}
- admissionReviewVersions: ["v1"]
- {{- if .Values.allowedNamespaces }}
- namespaceSelector:
- matchLabels:
- stackgres.io/scope: {{ .Release.Namespace }}.{{ .Release.Name }}
- {{- else if .Values.allowedNamespaceLabelSelector }}
- namespaceSelector:
- matchLabels:
- {{ toYaml .Values.allowedNamespaceLabelSelector | nindent 8 }}
- {{- end }}
- - name: sgbackupconfig.mutating-webhook.stackgres.io
- sideEffects: None
- rules:
- - operations: ["CREATE", "UPDATE"]
- apiGroups: ["stackgres.io"]
- apiVersions: ["*"]
- resources: ["sgbackupconfigs"]
- failurePolicy: Fail
- clientConfig:
- service:
- namespace: {{ .Release.Namespace }}
- name: {{ .Release.Name }}
- path: '/stackgres/mutation/sgbackupconfig'
- caBundle: {{ $cert }}
- admissionReviewVersions: ["v1"]
- {{- if .Values.allowedNamespaces }}
- namespaceSelector:
- matchLabels:
- stackgres.io/scope: {{ .Release.Namespace }}.{{ .Release.Name }}
- {{- else if .Values.allowedNamespaceLabelSelector }}
- namespaceSelector:
- matchLabels:
- {{ toYaml .Values.allowedNamespaceLabelSelector | nindent 8 }}
- {{- end }}
- - name: sgbackup.mutating-webhook.stackgres.io
- sideEffects: None
- rules:
- - operations: ["CREATE", "UPDATE"]
- apiGroups: ["stackgres.io"]
- apiVersions: ["*"]
- resources: ["sgbackups"]
- failurePolicy: Fail
- clientConfig:
- service:
- namespace: {{ .Release.Namespace }}
- name: {{ .Release.Name }}
- path: '/stackgres/mutation/sgbackup'
- caBundle: {{ $cert }}
- admissionReviewVersions: ["v1"]
- {{- if .Values.allowedNamespaces }}
- namespaceSelector:
- matchLabels:
- stackgres.io/scope: {{ .Release.Namespace }}.{{ .Release.Name }}
- {{- else if .Values.allowedNamespaceLabelSelector }}
- namespaceSelector:
- matchLabels:
- {{ toYaml .Values.allowedNamespaceLabelSelector | nindent 8 }}
- {{- end }}
- - name: sgdistributedlogs.mutating-webhook.stackgres.io
- sideEffects: None
- rules:
- - operations: ["CREATE", "UPDATE"]
- apiGroups: ["stackgres.io"]
- apiVersions: ["*"]
- resources: ["sgdistributedlogs"]
- failurePolicy: Fail
- clientConfig:
- service:
- namespace: {{ .Release.Namespace }}
- name: {{ .Release.Name }}
- path: '/stackgres/mutation/sgdistributedlogs'
- caBundle: {{ $cert }}
- admissionReviewVersions: ["v1"]
- {{- if .Values.allowedNamespaces }}
- namespaceSelector:
- matchLabels:
- stackgres.io/scope: {{ .Release.Namespace }}.{{ .Release.Name }}
- {{- else if .Values.allowedNamespaceLabelSelector }}
- namespaceSelector:
- matchLabels:
- {{ toYaml .Values.allowedNamespaceLabelSelector | nindent 8 }}
- {{- end }}
- - name: sgdbops.mutating-webhook.stackgres.io
- sideEffects: None
- rules:
- - operations: ["CREATE", "UPDATE"]
- apiGroups: ["stackgres.io"]
- apiVersions: ["*"]
- resources: ["sgdbops"]
- failurePolicy: Fail
- clientConfig:
- service:
- namespace: {{ .Release.Namespace }}
- name: {{ .Release.Name }}
- path: '/stackgres/mutation/sgdbops'
- caBundle: {{ $cert }}
- admissionReviewVersions: ["v1"]
- {{- if .Values.allowedNamespaces }}
- namespaceSelector:
- matchLabels:
- stackgres.io/scope: {{ .Release.Namespace }}.{{ .Release.Name }}
- {{- else if .Values.allowedNamespaceLabelSelector }}
- namespaceSelector:
- matchLabels:
- {{ toYaml .Values.allowedNamespaceLabelSelector | nindent 8 }}
- {{- end }}
- - name: sgobjectstorage.mutating-webhook.stackgres.io
- sideEffects: None
- rules:
- - operations: ["CREATE", "UPDATE"]
- apiGroups: ["stackgres.io"]
- apiVersions: ["*"]
- resources: ["sgobjectstorages"]
- failurePolicy: Fail
- clientConfig:
- service:
- namespace: {{ .Release.Namespace }}
- name: {{ .Release.Name }}
- path: '/stackgres/mutation/sgobjectstorage'
- caBundle: {{ $cert }}
- admissionReviewVersions: ["v1"]
- {{- if .Values.allowedNamespaces }}
- namespaceSelector:
- matchLabels:
- stackgres.io/scope: {{ .Release.Namespace }}.{{ .Release.Name }}
- {{- else if .Values.allowedNamespaceLabelSelector }}
- namespaceSelector:
- matchLabels:
- {{ toYaml .Values.allowedNamespaceLabelSelector | nindent 8 }}
- {{- end }}
- - name: sgscripts.mutating-webhook.stackgres.io
- sideEffects: None
- rules:
- - operations: ["CREATE", "UPDATE"]
- apiGroups: ["stackgres.io"]
- apiVersions: ["*"]
- resources: ["sgscripts"]
- failurePolicy: Fail
- clientConfig:
- service:
- namespace: {{ .Release.Namespace }}
- name: {{ .Release.Name }}
- path: '/stackgres/mutation/sgscript'
- caBundle: {{ $cert }}
- admissionReviewVersions: ["v1"]
- {{- if .Values.allowedNamespaces }}
- namespaceSelector:
- matchLabels:
- stackgres.io/scope: {{ .Release.Namespace }}.{{ .Release.Name }}
- {{- else if .Values.allowedNamespaceLabelSelector }}
- namespaceSelector:
- matchLabels:
- {{ toYaml .Values.allowedNamespaceLabelSelector | nindent 8 }}
- {{- end }}
- - name: sgshardedclusters.mutating-webhook.stackgres.io
- sideEffects: None
- rules:
- - operations: ["CREATE", "UPDATE"]
- apiGroups: ["stackgres.io"]
- apiVersions: ["*"]
- resources: ["sgshardedclusters"]
- failurePolicy: Fail
- clientConfig:
- service:
- namespace: {{ .Release.Namespace }}
- name: {{ .Release.Name }}
- path: '/stackgres/mutation/sgshardedcluster'
- caBundle: {{ $cert }}
- admissionReviewVersions: ["v1"]
- {{- if .Values.allowedNamespaces }}
- namespaceSelector:
- matchLabels:
- stackgres.io/scope: {{ .Release.Namespace }}.{{ .Release.Name }}
- {{- else if .Values.allowedNamespaceLabelSelector }}
- namespaceSelector:
- matchLabels:
- {{ toYaml .Values.allowedNamespaceLabelSelector | nindent 8 }}
- {{- end }}
- - name: sgshardedbackups.mutating-webhook.stackgres.io
- sideEffects: None
- rules:
- - operations: ["CREATE", "UPDATE"]
- apiGroups: ["stackgres.io"]
- apiVersions: ["*"]
- resources: ["sgshardedbackups"]
- failurePolicy: Fail
- clientConfig:
- service:
- namespace: {{ .Release.Namespace }}
- name: {{ .Release.Name }}
- path: '/stackgres/mutation/sgshardedbackup'
- caBundle: {{ $cert }}
- admissionReviewVersions: ["v1"]
- {{- if .Values.allowedNamespaces }}
- namespaceSelector:
- matchLabels:
- stackgres.io/scope: {{ .Release.Namespace }}.{{ .Release.Name }}
- {{- else if .Values.allowedNamespaceLabelSelector }}
- namespaceSelector:
- matchLabels:
- {{ toYaml .Values.allowedNamespaceLabelSelector | nindent 8 }}
- {{- end }}
- - name: sgshardeddbops.mutating-webhook.stackgres.io
- sideEffects: None
- rules:
- - operations: ["CREATE", "UPDATE"]
- apiGroups: ["stackgres.io"]
- apiVersions: ["*"]
- resources: ["sgshardeddbops"]
- failurePolicy: Fail
- clientConfig:
- service:
- namespace: {{ .Release.Namespace }}
- name: {{ .Release.Name }}
- path: '/stackgres/mutation/sgshardeddbops'
- caBundle: {{ $cert }}
- admissionReviewVersions: ["v1"]
- {{- if .Values.allowedNamespaces }}
- namespaceSelector:
- matchLabels:
- stackgres.io/scope: {{ .Release.Namespace }}.{{ .Release.Name }}
- {{- else if .Values.allowedNamespaceLabelSelector }}
- namespaceSelector:
- matchLabels:
- {{ toYaml .Values.allowedNamespaceLabelSelector | nindent 8 }}
- {{- end }}
- - name: sgstreams.mutating-webhook.stackgres.io
- sideEffects: None
- rules:
- - operations: ["CREATE", "UPDATE"]
- apiGroups: ["stackgres.io"]
- apiVersions: ["*"]
- resources: ["sgstreams"]
- failurePolicy: Fail
- clientConfig:
- service:
- namespace: {{ .Release.Namespace }}
- name: {{ .Release.Name }}
- path: '/stackgres/mutation/sgstreams'
- caBundle: {{ $cert }}
- admissionReviewVersions: ["v1"]
- {{- if .Values.allowedNamespaces }}
- namespaceSelector:
- matchLabels:
- stackgres.io/scope: {{ .Release.Namespace }}.{{ .Release.Name }}
- {{- else if .Values.allowedNamespaceLabelSelector }}
- namespaceSelector:
- matchLabels:
- {{ toYaml .Values.allowedNamespaceLabelSelector | nindent 8 }}
- {{- end }}
-
|