参考: https://docs.openshift.com/container-platform/3.11/install_config/prometheus_cluster_monitoring.html#monitoring-prerequisites
Copy openshift_cluster_monitoring_operator_alertmanager_storage_enabled=true
openshift_cluster_monitoring_operator_alertmanager_storage_class_name= custom-nas-storage
Copy oc edit configmap/cluster-monitoring-config -n openshift-monitoring
Copy alertmanagerMain:
baseImage: openshift/prometheus-alertmanager
nodeSelector:
node-role.kubernetes.io/infra: "true"
hostport: "alertmanager-main-openshift-monitoring.apps181.hisun.com"
volumeClaimTemplate:
spec:
storageClassName: custom-nas-storage
resources:
requests:
storage: 2Gi
查看prometheus-operator 日志发现 ,更新alertmanager报错,提示禁止更新除'replicas'、 'template'、 和 'updateStrategy' 之外的其他字段的statefulset spec
Copy E0320 03:55:44.263151 1 operator.go:278] Sync "openshift-monitoring/main" failed: updating statefulset failed: StatefulSet.apps "alertmanager-main" is invalid: spec: Forbidden: updates to statefulset spec for fields other than 'replicas', 'template', and 'updateStrategy' are forbidden.
Copy oc delete sts/alertmanager-main -n openshift-monitoring
Copy oc get sts/alertmanager-main -n openshift-monitoring -o yaml