Configuring Time Zone Synchronization
When creating a workload, you can configure containers to use the same time zone as the node. You can enable time zone synchronization when creating a workload.
The time zone synchronization function depends on the local disk (hostPath) mounted to the container. After time zone synchronization is enabled, /etc/localtime of the node is mounted to /etc/localtime of the container in HostPath mode, in this way, the node and container use the same time zone configuration file.
kind: DeploymentapiVersion: apps/v1metadata:name: testnamespace: defaultspec:replicas: 2selector:matchLabels:app: testtemplate:metadata:labels:app: testspec:volumes:- name: vol-162979628557461404hostPath:path: /etc/localtimetype: ''containers:- name: container-0image: 'nginx:alpine'volumeMounts:- name: vol-162979628557461404readOnly: truemountPath: /etc/localtimeimagePullPolicy: IfNotPresentimagePullSecrets:- name: default-secret
Parent topic: Configuring a Workload