Kubernetes CornJob时区问题

2021-12-27  本文已影响0人  橘子基因

CornJob发送时间为kube-controller-manager组件的时间,修改/etc/kubernetes/manifests/kube-controller-manager.yaml文件,挂载节点的localtime到kube-controller-manager组件容器里即可。

修改vim /etc/kubernetes/manifests/kube-controller-manager.yaml文件

    volumeMounts:
    - mountPath: /etc/ssl/certs
      name: ca-certs
      readOnly: true
    - mountPath: /etc/pki
      name: etc-pki
      readOnly: true
    - mountPath: /usr/libexec/kubernetes/kubelet-plugins/volume/exec
      name: flexvolume-dir
    - mountPath: /etc/kubernetes/pki
      name: k8s-certs
      readOnly: true
    - mountPath: /etc/kubernetes/controller-manager.conf
      name: kubeconfig
      readOnly: true
    - mountPath: /etc/localtime ##挂载localtime到容器里
      name: localtime
      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: /usr/libexec/kubernetes/kubelet-plugins/volume/exec
      type: DirectoryOrCreate
    name: flexvolume-dir
  - hostPath:
      path: /etc/kubernetes/pki
      type: DirectoryOrCreate
    name: k8s-certs
  - hostPath:
      path: /etc/kubernetes/controller-manager.conf
      type: FileOrCreate
    name: kubeconfig
  - hostPath:  ##当前节点localtime
      path: /etc/localtime 
    name: localtime
status: {}
上一篇下一篇

猜你喜欢

热点阅读