Closed sona-yuan closed 1 month ago
@sona-yuan I confirmed the env written in MySQLCluster is propagated to its Pods.
MySQLCluster.spec.podTemplate
is PodSpecApplyConfiguration. Please see here for detail.
apiVersion: moco.cybozu.com/v1beta2
kind: MySQLCluster
metadata:
namespace: sandbox
name: test
spec:
replicas: 3
podTemplate:
spec:
containers:
- name: mysqld
image: ghcr.io/cybozu-go/moco/mysql:8.4.0
env:
- name: TZ
value: "Asia/Shanghai"
volumeClaimTemplates:
- metadata:
name: mysql-data
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 1Gi
$ kubectl get pod -n sandbox moco-test-0 -oyaml | yq .spec.containers[0].env
- name: TZ
value: Asia/Shanghai
$ kubectl exec -n sandbox moco-test-0 mysqld -it -- bash
I have no name!@moco-test-0:/$ echo $TZ
Asia/Shanghai
Thank you, I get it
resolve
What
Does operator and CR not support adding environment variables,such as time_zone
How
containers:
Checklist