1 时间介绍bash
1.1 GMT服务器
格林威治时间。即格林威治所在地的标准时间。ide
1.2 UTCspa
世界标准时间(即 GMT)。即:UTC = GMT + 0。容器中的时间就是 UTC。orm
1.3 CSTci
it
1.4 ESTclass
东部时间。EST = GMT - 5。若是当前机子所在时区是纽约,那么日期显示就是 EST。容器
2 设置pod时间云服务
一般状况云服务器的时区为世界标准时间,和中国标准时间相差8个小时。
2.1挂在宿主机的时间到容器中
volumeMounts: - mountPath: /etc/localtime name: localtime volumes: - hostPath: path: /etc/localtime type: "" name: localtime
2.2传参到pod中
spec: containers: - env: - name: TZ value: Asia/Shanghai
2.3传参到pod中
spec: containers: - env: - name: TZ value: CST-8