diff --git a/charts/mysql-operator/templates/deployment.yaml b/charts/mysql-operator/templates/deployment.yaml index e05a828d3..f43f08fbd 100644 --- a/charts/mysql-operator/templates/deployment.yaml +++ b/charts/mysql-operator/templates/deployment.yaml @@ -26,6 +26,13 @@ spec: secret: defaultMode: 420 secretName: "{{ template "webhook.name" . }}-certs" + - name: timezone + hostPath: + {{- if (empty .Values.timeZone) }} + path: /etc/localtime + {{- else }} + path: /usr/share/zoneinfo/{{ .Values.timeZone }} + {{- end }} containers: {{- if .Values.rbacProxy.create }} - name: kube-rbac-proxy @@ -42,6 +49,9 @@ spec: ports: - containerPort: 8443 name: https + volumeMounts: + - name: timezone + mountPath: /etc/localtime {{- end }} - name: manager ports: @@ -52,6 +62,8 @@ spec: - name: cert mountPath: /tmp/k8s-webhook-server/serving-certs/ readOnly: true + - name: timezone + mountPath: /etc/localtime command: - /manager args: diff --git a/charts/mysql-operator/values.yaml b/charts/mysql-operator/values.yaml index b0abac3b7..d0f6b778f 100644 --- a/charts/mysql-operator/values.yaml +++ b/charts/mysql-operator/values.yaml @@ -13,6 +13,9 @@ imagePullPolicy: IfNotPresent nameOverride: "" fullnameOverride: "" imagePrefix: "" +## Mount the host time zone by default. +## You can refer to the time zone listed in `/usr/share/zoneinfo/` to specify timezone, like `Asia/Shanghai`. +timeZone: "" ## node.kubernetes.io/not-ready:NoExecute ## node.kubernetes.io/unreachable:NoExecute