How to set environment variables when creating a cluster? #7502
-
How to set environment variables when creating a cluster? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
Some envs are not known till creating time. In such cases, KubeBlocks provides a way to pass them through a special annotation: e.g. when create an oceanbase cluster, we can specify the zone number , tenant info as envs in the annotation ( apiVersion: apps.kubeblocks.io/v1alpha1
kind: Cluster
metadata:
annotations:
kubeblocks.io/extra-env: '{"TENANT_NAME":"test","ZONE_COUNT":"1"}'
spec:
... And these envs wlll be saved in a configmap named after '$(KB_CLUSTER_COMP)_env'. and PODs provisioined will refer to it in |
Beta Was this translation helpful? Give feedback.
-
Which kinds of environment variables do you want to set? Could you take an example? |
Beta Was this translation helpful? Give feedback.
-
I checked the Addon and found the ENV is set in POD spec. |
Beta Was this translation helpful? Give feedback.
-
you may edit the clustedefinition first, to remove the env, and inject it during cluster annotation. |
Beta Was this translation helpful? Give feedback.
you may edit the clustedefinition first, to remove the env, and inject it during cluster annotation.