Skip to content

Commit

Permalink
Selectively disable feature gates
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <[email protected]>
  • Loading branch information
tamalsaha committed Jan 7, 2024
1 parent 0f92505 commit 42066b0
Show file tree
Hide file tree
Showing 15 changed files with 222 additions and 18 deletions.
7 changes: 4 additions & 3 deletions apis/installer/v1alpha1/kubedb_webhook_server_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ type KubedbWebhookServerSpec struct {
// +optional
License string `json:"license"`
// +optional
LicenseSecretName string `json:"licenseSecretName"`
Server Container `json:"server"`
ImagePullPolicy string `json:"imagePullPolicy"`
LicenseSecretName string `json:"licenseSecretName"`
Server Container `json:"server"`
FeatureGates map[string]bool `json:"featureGates"`
ImagePullPolicy string `json:"imagePullPolicy"`
//+optional
ImagePullSecrets []string `json:"imagePullSecrets"`
//+optional
Expand Down
7 changes: 7 additions & 0 deletions apis/installer/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions charts/kubedb-webhook-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,28 @@ The following table lists the configurable parameters of the `kubedb-webhook-ser
| server.tag | KubeDB webhook server container image tag | <code>""</code> |
| server.securityContext | Security options this container should run with | <code>{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]},"readOnlyRootFilesystem":true,"runAsNonRoot":true,"runAsUser":65534}</code> |
| server.resources | Compute Resources required by this container | <code>{}</code> |
| featureGates.Cassandra | | <code>false</code> |
| featureGates.ClickHouse | | <code>false</code> |
| featureGates.Druid | | <code>false</code> |
| featureGates.Elasticsearch | | <code>true</code> |
| featureGates.Etcd | | <code>false</code> |
| featureGates.FerretDB | | <code>false</code> |
| featureGates.Kafka | | <code>true</code> |
| featureGates.MariaDB | | <code>true</code> |
| featureGates.Memcached | | <code>true</code> |
| featureGates.MicrosoftSQLServer | | <code>false</code> |
| featureGates.MongoDB | | <code>true</code> |
| featureGates.MySQL | | <code>true</code> |
| featureGates.PerconaXtraDB | | <code>true</code> |
| featureGates.PgBouncer | | <code>true</code> |
| featureGates.PgPool | | <code>false</code> |
| featureGates.Postgres | | <code>true</code> |
| featureGates.ProxySQL | | <code>true</code> |
| featureGates.RabbitMQ | | <code>false</code> |
| featureGates.Redis | | <code>true</code> |
| featureGates.SingleStore | | <code>false</code> |
| featureGates.Solr | | <code>false</code> |
| featureGates.ZooKeeper | | <code>false</code> |
| imagePullSecrets | Specify an array of imagePullSecrets. Secrets must be manually created in the namespace. <br> Example: <br> `helm template charts/kubedb-webhook-server \` <br> `--set imagePullSecrets[0].name=sec0 \` <br> `--set imagePullSecrets[1].name=sec1` | <code>[]</code> |
| imagePullPolicy | Container image pull policy | <code>IfNotPresent</code> |
| criticalAddon | If true, installs KubeDB webhook server as critical addon | <code>false</code> |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{{ $featureGates := .Values.featureGates }}
{{- if .Values.global }}
{{ $featureGates = mergeOverwrite dict .Values.featureGates .Values.global.featureGates }}
{{- end }}

{{- if .Values.apiserver.enableMutatingWebhook }}
{{- if list "kubedb-webhook-server" "kubedb-autoscaler" | has .Values.server.repository }}

Expand All @@ -11,6 +16,7 @@ metadata:
app.kubernetes.io/component: kubedb-autoscaler
{{- include "kubedb-webhook-server.labels" . | nindent 4 }}
webhooks:
{{- if $featureGates.MongoDB }}
- name: mongodbautoscalerwebhook.mutators.autoscaling.kubedb.com
clientConfig:
service:
Expand All @@ -26,6 +32,8 @@ webhooks:
admissionReviewVersions: ["v1beta1"]
failurePolicy: {{ .Values.apiserver.webhook.failurePolicy }}
sideEffects: None
{{- end }}
{{- if $featureGates.Elasticsearch }}
- name: elasticsearchautoscalerwebhook.mutators.autoscaling.kubedb.com
clientConfig:
service:
Expand All @@ -41,6 +49,8 @@ webhooks:
admissionReviewVersions: ["v1beta1"]
failurePolicy: {{ .Values.apiserver.webhook.failurePolicy }}
sideEffects: None
{{- end }}
{{- if $featureGates.MariaDB }}
- name: mariadbautoscalerwebhook.mutators.autoscaling.kubedb.com
clientConfig:
service:
Expand All @@ -56,6 +66,8 @@ webhooks:
admissionReviewVersions: ["v1beta1"]
failurePolicy: {{ .Values.apiserver.webhook.failurePolicy }}
sideEffects: None
{{- end }}
{{- if $featureGates.MySQL }}
- name: mysqlautoscalerwebhook.mutators.autoscaling.kubedb.com
clientConfig:
service:
Expand All @@ -71,6 +83,8 @@ webhooks:
admissionReviewVersions: ["v1beta1"]
failurePolicy: {{ .Values.apiserver.webhook.failurePolicy }}
sideEffects: None
{{- end }}
{{- if $featureGates.PerconaXtraDB }}
- name: perconaxtradbautoscalerwebhook.mutators.autoscaling.kubedb.com
clientConfig:
service:
Expand All @@ -86,6 +100,8 @@ webhooks:
admissionReviewVersions: ["v1beta1"]
failurePolicy: {{ .Values.apiserver.webhook.failurePolicy }}
sideEffects: None
{{- end }}
{{- if $featureGates.Postgres }}
- name: postgresautoscalerwebhook.mutators.autoscaling.kubedb.com
clientConfig:
service:
Expand All @@ -101,6 +117,8 @@ webhooks:
admissionReviewVersions: ["v1beta1"]
failurePolicy: {{ .Values.apiserver.webhook.failurePolicy }}
sideEffects: None
{{- end }}
{{- if $featureGates.PgBouncer }}
- name: pgbouncerautoscalerwebhook.mutators.autoscaling.kubedb.com
clientConfig:
service:
Expand All @@ -116,6 +134,8 @@ webhooks:
admissionReviewVersions: ["v1beta1"]
failurePolicy: {{ .Values.apiserver.webhook.failurePolicy }}
sideEffects: None
{{- end }}
{{- if $featureGates.ProxySQL }}
- name: proxysqlautoscalerwebhook.mutators.autoscaling.kubedb.com
clientConfig:
service:
Expand All @@ -131,6 +151,8 @@ webhooks:
admissionReviewVersions: ["v1beta1"]
failurePolicy: {{ .Values.apiserver.webhook.failurePolicy }}
sideEffects: None
{{- end }}
{{- if $featureGates.Redis }}
- name: redisautoscalerwebhook.mutators.autoscaling.kubedb.com
clientConfig:
service:
Expand Down Expand Up @@ -163,4 +185,5 @@ webhooks:
sideEffects: None
{{- end }}
{{- end }}
{{- end }}

Loading

0 comments on commit 42066b0

Please sign in to comment.