k8s中同步本地时区
一般从hub.docker.com下载的镜像是没有设置时区的,想让镜像与本时区一致,将本地时区文件做为volume挂载到容器中即可apiVersion: apps/v1kind: Deploymentmetadata:name: usernamespace: testlabels:app: userspec:replicas: 1selector...
·
一般从hub.docker.com下载的镜像是没有设置时区的,想让镜像与本时区一致,将本地时区文件做为volume挂载到容器中即可
apiVersion: apps/v1
kind: Deployment
metadata:
name: user
namespace: test
labels:
app: user
spec:
replicas: 1
selector:
matchLabels:
app: user
template:
metadata:
labels:
app: user
spec:
containers:
- name: user
image: sw-user:3.0
ports:
- containerPort: 8080
volumeMounts:
- name: localtime
mountPath: /etc/localtime
volumes:
- name: localtime
hostPath:
path: /etc/localtime
更多推荐
已为社区贡献1条内容
所有评论(0)