From eeda19a87d84ba15042d4b20d4f1114c0f9fbb8f Mon Sep 17 00:00:00 2001 From: Pritam Das Date: Fri, 8 Nov 2024 19:07:49 +0600 Subject: [PATCH] Configure webhook for solr autoscaler (#1365) Signed-off-by: pritamdas99 --- .../templates/autoscaler/mutating-webhook.yaml | 17 +++++++++++++++++ .../autoscaler/validating-webhook.yaml | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/charts/kubedb-webhook-server/templates/autoscaler/mutating-webhook.yaml b/charts/kubedb-webhook-server/templates/autoscaler/mutating-webhook.yaml index cc1f7475a..6710ae7e3 100644 --- a/charts/kubedb-webhook-server/templates/autoscaler/mutating-webhook.yaml +++ b/charts/kubedb-webhook-server/templates/autoscaler/mutating-webhook.yaml @@ -286,6 +286,23 @@ webhooks: failurePolicy: {{ .Values.apiserver.webhook.failurePolicy }} sideEffects: None {{- end }} +{{- if $featureGates.Solr }} +- name: solrautoscalerwebhook.mutators.autoscaling.kubedb.com + clientConfig: + service: + namespace: default + name: kubernetes + path: /apis/mutators.autoscaling.kubedb.com/v1alpha1/solrautoscalerwebhooks + caBundle: {{ $caCrt }} + rules: + - apiGroups: ["autoscaling.kubedb.com"] + apiVersions: ["*"] + resources: ["solrautoscalers"] + operations: ["CREATE", "UPDATE"] + admissionReviewVersions: ["v1beta1"] + failurePolicy: {{ .Values.apiserver.webhook.failurePolicy }} + sideEffects: None +{{- end }} {{- end }} {{- end }} diff --git a/charts/kubedb-webhook-server/templates/autoscaler/validating-webhook.yaml b/charts/kubedb-webhook-server/templates/autoscaler/validating-webhook.yaml index 7d5b4612e..7c207d216 100644 --- a/charts/kubedb-webhook-server/templates/autoscaler/validating-webhook.yaml +++ b/charts/kubedb-webhook-server/templates/autoscaler/validating-webhook.yaml @@ -286,6 +286,23 @@ webhooks: failurePolicy: {{ .Values.apiserver.webhook.failurePolicy }} sideEffects: None {{- end }} +{{- if $featureGates.Solr }} +- name: solrautoscalerwebhook.validators.autoscaling.kubedb.com + clientConfig: + service: + namespace: default + name: kubernetes + path: /apis/validators.autoscaling.kubedb.com/v1alpha1/solrautoscalerwebhooks + caBundle: {{ $caCrt }} + rules: + - apiGroups: ["autoscaling.kubedb.com"] + apiVersions: ["*"] + resources: ["solrautoscalers"] + operations: ["CREATE", "UPDATE"] + admissionReviewVersions: ["v1beta1"] + failurePolicy: {{ .Values.apiserver.webhook.failurePolicy }} + sideEffects: None +{{- end }} {{- end }} {{- end }}