一、etcd、apiserver、controller-manager、scheduler時區修改
1、修改master服務器上/etc/kubernetes/manifests/目錄下的yaml文件
[root@master ~]# ll /etc/kubernetes/manifests/ total 16 -rw------- 1 root root 2361 May 10 10:53 etcd.yaml -rw------- 1 root root 3522 May 10 10:49 kube-apiserver.yaml -rw------- 1 root root 2976 May 10 10:53 kube-controller-manager.yaml -rw------- 1 root root 1562 May 10 10:52 kube-scheduler.yaml
2、在yaml中掛載服務器的時區(內容如下)
volumeMounts: - mountPath: /etc/localtime name: host-time readOnly: true volumes: - hostPath: path: /etc/localtime name: host-time
3、查看修改后的kube-apiserver.yaml(其它幾個文件都一樣的修改)
[root@master ~]# cat /etc/kubernetes/manifests/kube-apiserver.yaml |tail -32 volumeMounts: - mountPath: /etc/ssl/certs name: ca-certs readOnly: true - mountPath: /etc/pki name: etc-pki readOnly: true - mountPath: /etc/kubernetes/pki name: k8s-certs readOnly: true - mountPath: /etc/localtime name: host-time readOnly: true hostNetwork: true priorityClassName: system-node-critical volumes: - hostPath: path: /etc/ssl/certs type: DirectoryOrCreate name: ca-certs - hostPath: path: /etc/pki type: DirectoryOrCreate name: etc-pki - hostPath: path: /etc/kubernetes/pki type: DirectoryOrCreate name: k8s-certs - hostPath: path: /etc/localtime name: host-time status: {}
二、修改kube-proxy的時區
1、直接edit kube-proxy的ds配置(掛載參數和上面一樣)
kubectl edit ds -n kube-system kube-proxy
三、修改coredns時區
1、edit coredns配置,直接掛載服務器時區
kubectl edit deploy -n kube-system coredn