Skip to content

Commit

Permalink
feat: support skip creating webhook resource when helm install (#537)
Browse files Browse the repository at this point in the history
fix: set cert secret if not create webhook resource

Co-authored-by: Aylei <[email protected]>
  • Loading branch information
loveRhythm1990 and aylei authored Aug 21, 2024
1 parent 2a36cda commit 48e809d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/matrixone-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: matrixone-operator
description: Matrixone Kubernetes Operator
type: application
version: 1.2.0-alpha.5
version: 1.2.0-alpha.6
appVersion: 0.1.0
kubeVersion: ">=1.19.0-0"
icon: https://raw.githubusercontent.com/matrixorigin/artwork/main/docs/overview/logo.png
Expand Down
6 changes: 6 additions & 0 deletions charts/matrixone-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.webhook.createResource }}
apiVersion: v1
kind: Secret
type: kubernetes.io/tls
Expand All @@ -10,6 +11,7 @@ metadata:
"helm.sh/hook-delete-policy": "before-hook-creation"
data:
{{ ( include "matrixone-operator.gen-certs" . ) | indent 2 }}
{{- end }}
---
apiVersion: apps/v1
kind: Deployment
Expand Down Expand Up @@ -85,7 +87,11 @@ spec:
volumes:
- name: certs
secret:
{{- if .Values.webhook.createResource }}
secretName: {{ template "matrixone-operator.name" . }}-certs
{{- else }}
secretName: {{ .Values.webhook.secretName }}
{{- end }}
- name: config
configMap:
name: {{ template "matrixone-operator.name" . }}-cm
2 changes: 2 additions & 0 deletions charts/matrixone-operator/templates/webhook.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.webhook.createResource }}
apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
Expand Down Expand Up @@ -235,3 +236,4 @@ webhooks:
resources:
- proxysets
sideEffects: None
{{- end}}
5 changes: 5 additions & 0 deletions charts/matrixone-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ backupRestore:
# to a private registry
globalRegistryPrefix: ""

webhook:
createResource: true
# set secret if createResource=false
secretName: ""

imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
Expand Down

0 comments on commit 48e809d

Please sign in to comment.