diff --git a/helm-charts/seldon-core-operator/templates/webhook.yaml b/helm-charts/seldon-core-operator/templates/webhook.yaml index f77c338170..c8cb96f4a9 100644 --- a/helm-charts/seldon-core-operator/templates/webhook.yaml +++ b/helm-charts/seldon-core-operator/templates/webhook.yaml @@ -4,6 +4,20 @@ {{- $cert := genSignedCert "seldon-webhook-service" nil $altNames 365 $ca -}} --- +{{- if not .Values.certManager.enabled -}} +apiVersion: v1 +data: + ca.crt: '{{ $ca.Cert | b64enc }}' + tls.crt: '{{ $cert.Cert | b64enc }}' + tls.key: '{{ $cert.Key | b64enc }}' +kind: Secret +metadata: + name: seldon-webhook-server-cert + namespace: '{{ include "seldon.namespace" . }}' +type: kubernetes.io/tls +{{- end }} +--- + apiVersion: admissionregistration.k8s.io/v1beta1 kind: ValidatingWebhookConfiguration metadata: @@ -17,10 +31,7 @@ metadata: app.kubernetes.io/version: '{{ .Chart.Version }}' name: seldon-validating-webhook-configuration-{{ include "seldon.namespace" . }} webhooks: -- admissionReviewVersions: - - v1 - - v1beta1 - clientConfig: +- clientConfig: caBundle: '{{ $ca.Cert | b64enc }}' service: name: seldon-webhook-service @@ -173,19 +184,5 @@ webhooks: resources: - seldondeployments sideEffects: None ---- - -{{- if not .Values.certManager.enabled -}} -apiVersion: v1 -data: - ca.crt: '{{ $ca.Cert | b64enc }}' - tls.crt: '{{ $cert.Cert | b64enc }}' - tls.key: '{{ $cert.Key | b64enc }}' -kind: Secret -metadata: - name: seldon-webhook-server-cert - namespace: '{{ include "seldon.namespace" . }}' -type: kubernetes.io/tls -{{- end }} {{- end }} diff --git a/operator/Makefile b/operator/Makefile index 43e6a5fcc3..d621b59bde 100644 --- a/operator/Makefile +++ b/operator/Makefile @@ -122,8 +122,6 @@ deploy-lite: manifests # Generate manifests e.g. CRD, RBAC etc. manifests: controller-gen $(CONTROLLER_GEN) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases crd:crdVersions=v1beta1 - # temporary fix until we update to v1 webhooks by updating code to have webhookVersions=v1 - mv config/webhook/manifests.v1beta1.yaml config/webhook/manifests.yaml # Commented out alternative is looking ahead to issue that on Openshift our v1 CRD is too large # to be installed. This may also affect operator-sdk community operators. diff --git a/operator/config/webhook/manifests.yaml b/operator/config/webhook/manifests.yaml index c85967b4f0..c0bea37c6e 100644 --- a/operator/config/webhook/manifests.yaml +++ b/operator/config/webhook/manifests.yaml @@ -6,10 +6,8 @@ metadata: creationTimestamp: null name: validating-webhook-configuration webhooks: -- admissionReviewVersions: - - v1 - - v1beta1 - clientConfig: +- clientConfig: + caBundle: Cg== service: name: webhook-service namespace: system @@ -28,6 +26,7 @@ webhooks: - seldondeployments sideEffects: None - clientConfig: + caBundle: Cg== service: name: webhook-service namespace: system @@ -46,6 +45,7 @@ webhooks: - seldondeployments sideEffects: None - clientConfig: + caBundle: Cg== service: name: webhook-service namespace: system