1.在pod中添加如下信息。
volumeMounts:
- mountPath: /etc/localtime
name: date-config
volumes:
- name: date-config
hostPath:
path: /usr/share/zoneinfo/Asia/Shanghai
2.重新apply一下pod。
kubectl apply -f xxx.yaml
3.进入pod查看时间。
kubectl exec -it xxxxx -- /bin/sh
进入之后输入date 查看时间