解决pod时区问题

一、alertmanager-alertmanager.yaml(未生效)
问题未解决原因

apiVersion: monitoring.coreos.com/v1
kind: Alertmanager
metadata:
  labels:
    alertmanager: main
  name: main
  namespace: monitoring
spec:
  containers:
    - env:
        - name: TZ #时区设置的key
          value: Asia/Shanghai #时区设置的value
      name: alertmanager
      image: quay.io/prometheus/alertmanager:v0.21.0
      #新加
      volumeMounts:
        - name: host-time
          mountPath: /etc/localtime
          readOnly: true
  volumes:
    - name: host-time
      hostPath:
        path: /etc/timezone
  nodeSelector:
    kubernetes.io/os: linux
  replicas: 3
  securityContext:
    fsGroup: 2000
    runAsNonRoot: true
    runAsUser: 1000
  serviceAccountName: alertmanager-main
  version: v0.21.0
posted @ 2024-03-11 15:52  kht  阅读(61)  评论(0编辑  收藏  举报