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: ValidatingWebhookConfiguration
- 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.validating-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/validation/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.validating-webhook.stackgres.io
- sideEffects: None
- rules:
- - operations: ["CREATE", "UPDATE", "DELETE"]
- apiGroups: ["stackgres.io"]
- apiVersions: ["*"]
- resources: ["sgpgconfigs"]
- failurePolicy: Fail
- clientConfig:
- service:
- namespace: {{ .Release.Namespace }}
- name: {{ .Release.Name }}
- path: '/stackgres/validation/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.validating-webhook.stackgres.io
- sideEffects: None
- rules:
- - operations: ["CREATE", "UPDATE", "DELETE"]
- apiGroups: ["stackgres.io"]
- apiVersions: ["*"]
- resources: ["sgpoolconfigs"]
- failurePolicy: Fail
- clientConfig:
- service:
- namespace: {{ .Release.Namespace }}
- name: {{ .Release.Name }}
- path: '/stackgres/validation/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.validating-webhook.stackgres.io
- sideEffects: None
- rules:
- - operations: ["CREATE", "UPDATE", "DELETE"]
- apiGroups: ["stackgres.io"]
- apiVersions: ["*"]
- resources: ["sginstanceprofiles"]
- failurePolicy: Fail
- clientConfig:
- service:
- namespace: {{ .Release.Namespace }}
- name: {{ .Release.Name }}
- path: '/stackgres/validation/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.validating-webhook.stackgres.io
- sideEffects: None
- rules:
- - operations: ["CREATE", "UPDATE", "DELETE"]
- apiGroups: ["stackgres.io"]
- apiVersions: ["*"]
- resources: ["sgbackupconfigs"]
- failurePolicy: Fail
- clientConfig:
- service:
- namespace: {{ .Release.Namespace }}
- name: {{ .Release.Name }}
- path: '/stackgres/validation/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.validating-webhook.stackgres.io
- sideEffects: None
- rules:
- - operations: ["CREATE", "UPDATE", "DELETE"]
- apiGroups: ["stackgres.io"]
- apiVersions: ["*"]
- resources: ["sgbackups"]
- failurePolicy: Fail
- clientConfig:
- service:
- namespace: {{ .Release.Namespace }}
- name: {{ .Release.Name }}
- path: '/stackgres/validation/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.validating-webhook.stackgres.io
- sideEffects: None
- rules:
- - operations: ["CREATE", "UPDATE", "DELETE"]
- apiGroups: ["stackgres.io"]
- apiVersions: ["*"]
- resources: ["sgdistributedlogs"]
- failurePolicy: Fail
- clientConfig:
- service:
- namespace: {{ .Release.Namespace }}
- name: {{ .Release.Name }}
- path: '/stackgres/validation/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.validating-webhook.stackgres.io
- sideEffects: None
- rules:
- - operations: ["CREATE", "UPDATE", "DELETE"]
- apiGroups: ["stackgres.io"]
- apiVersions: ["*"]
- resources: ["sgdbops"]
- failurePolicy: Fail
- clientConfig:
- service:
- namespace: {{ .Release.Namespace }}
- name: {{ .Release.Name }}
- path: '/stackgres/validation/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.validating-webhook.stackgres.io
- sideEffects: None
- rules:
- - operations: ["CREATE", "UPDATE", "DELETE"]
- apiGroups: ["stackgres.io"]
- apiVersions: ["*"]
- resources: ["sgobjectstorages"]
- failurePolicy: Fail
- clientConfig:
- service:
- namespace: {{ .Release.Namespace }}
- name: {{ .Release.Name }}
- path: '/stackgres/validation/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.validating-webhook.stackgres.io
- sideEffects: None
- rules:
- - operations: ["CREATE", "UPDATE", "DELETE"]
- apiGroups: ["stackgres.io"]
- apiVersions: ["*"]
- resources: ["sgscripts"]
- failurePolicy: Fail
- clientConfig:
- service:
- namespace: {{ .Release.Namespace }}
- name: {{ .Release.Name }}
- path: '/stackgres/validation/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.validating-webhook.stackgres.io
- sideEffects: None
- rules:
- - operations: ["CREATE", "UPDATE", "DELETE"]
- apiGroups: ["stackgres.io"]
- apiVersions: ["*"]
- resources: ["sgshardedclusters"]
- failurePolicy: Fail
- clientConfig:
- service:
- namespace: {{ .Release.Namespace }}
- name: {{ .Release.Name }}
- path: '/stackgres/validation/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.validating-webhook.stackgres.io
- sideEffects: None
- rules:
- - operations: ["CREATE", "UPDATE", "DELETE"]
- apiGroups: ["stackgres.io"]
- apiVersions: ["*"]
- resources: ["sgshardedbackups"]
- failurePolicy: Fail
- clientConfig:
- service:
- namespace: {{ .Release.Namespace }}
- name: {{ .Release.Name }}
- path: '/stackgres/validation/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.validating-webhook.stackgres.io
- sideEffects: None
- rules:
- - operations: ["CREATE", "UPDATE", "DELETE"]
- apiGroups: ["stackgres.io"]
- apiVersions: ["*"]
- resources: ["sgshardeddbops"]
- failurePolicy: Fail
- clientConfig:
- service:
- namespace: {{ .Release.Namespace }}
- name: {{ .Release.Name }}
- path: '/stackgres/validation/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.validating-webhook.stackgres.io
- sideEffects: None
- rules:
- - operations: ["CREATE", "UPDATE", "DELETE"]
- apiGroups: ["stackgres.io"]
- apiVersions: ["*"]
- resources: ["sgstreams"]
- failurePolicy: Fail
- clientConfig:
- service:
- namespace: {{ .Release.Namespace }}
- name: {{ .Release.Name }}
- path: '/stackgres/validation/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 }}
-
|