Skip to content

How to set timezone for the EMQX container? #338

Answered by jacky-xbb
jacky-xbb asked this question in Q&A
Discussion options

You must be logged in to vote
  1. Create a ConfigMap to import the time zone settings that you want to use.
    For other time zones, use the corresponding files in the /usr/share/zoneinfo/Asia/ directory. Example:

    kubectl create configmap tz --from-file=/usr/share/zoneinfo/Asia/Shanghai
    
  2. Mount the ConfigMap in a emqx yaml.

    cat << "EOF" | kubectl apply -f -
    apiVersion: apps.emqx.io/v1beta3
    kind: EmqxEnterprise
    metadata:
      name: emqx-ee
      labels:
        "foo": "bar"
    spec:
      emqxTemplate:
        image: emqx/emqx-ee:4.4.6
        extraVolumeMounts:
        - name: tz
          mountPath: /etc/localtime
          subPath: Shanghai
        extraVolumes:
        - name: tz
          configMap:
            name: tz
    EOF
    
  3. Check if the time zone validated

    kubectl exe…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jacky-xbb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant