容器pod时间同步

[root@k8s-master-node1 ~]# docker pull nginx
[root@k8s-master-node1 ~]# kubectl run centos --image centos:latest --dry-run=client --port=80 -oyaml >nginx.yaml

yaml

bjiapiVersion: v1
kind: Pod
metadata:
  creationTimestamp: null
  labels:
	run: nginx
  name: nginx
spec:
  containers:
  - image: nginx:latest
	name: nginx
	ports:
	- containerPort: 80
	volumeMounts:
	- name: timezone 
	  mountPath: /etc/localtime
  volumes:
  - name: timezone
	hostPath: 
	  path: /etc/localtime
  dnsPolicy: ClusterFirst
  restartPolicy: Always
status: {}
[root@k8s-master-node1 ~]# kubectl apply -f nginx.yaml

 

© 版权声明
THE END
喜欢就支持一下吧
点赞5 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片快捷回复

    暂无评论内容