安装资源监控套件-prometheus组件的镜像地址无法修改
安装完脚本后,有几个statefulset和deployment的镜像没有使用修改后的私有仓库地址,导致无法下载,必须手动修改yml.
例如: alertmanager, promethues,以及dingtalk
alertmanager, dingtalk都可以通过手动修改yml来改变镜像地址; prometheus这个sts则修改地址无效,不论是通过UI还是yml调整镜像地址,应用以后都无效,再打开会发现修改无效,还是原来的值,始终是
swr.cn-east-2.myhuaweicloud.com/kuboard-dependency/prometheus:v2.29.1
无法修改为:
**harbor-dc.xxxxxx ** 即我这边对应的私有仓库
apiVersion: apps/v1 kind: StatefulSet metadata: annotations: prometheus-operator-input-hash: '5089428222930355324' labels: app.kubernetes.io/component: prometheus app.kubernetes.io/name: prometheus app.kubernetes.io/part-of: kube-prometheus app.kubernetes.io/version: 2.29.1 k8s.kuboard.cn/name: prometheus-k8s operator.prometheus.io/name: k8s operator.prometheus.io/shard: '0' prometheus: k8s name: prometheus-k8s namespace: kuboard ownerReferences: - apiVersion: monitoring.coreos.com/v1 blockOwnerDeletion: true controller: true kind: Prometheus name: k8s uid: d910bd66-868f-4602-9202-53020c218f2c resourceVersion: '56592651' spec: podManagementPolicy: Parallel replicas: 2 revisionHistoryLimit: 10 selector: matchLabels: app: prometheus app.kubernetes.io/instance: k8s app.kubernetes.io/managed-by: prometheus-operator app.kubernetes.io/name: prometheus operator.prometheus.io/name: k8s operator.prometheus.io/shard: '0' prometheus: k8s serviceName: prometheus-operated template: metadata: annotations: kubectl.kubernetes.io/default-container: prometheus creationTimestamp: null labels: app: prometheus app.kubernetes.io/component: prometheus app.kubernetes.io/instance: k8s app.kubernetes.io/managed-by: prometheus-operator app.kubernetes.io/name: prometheus app.kubernetes.io/part-of: kube-prometheus app.kubernetes.io/version: 2.29.1 operator.prometheus.io/name: k8s operator.prometheus.io/shard: '0' prometheus: k8s spec: containers: - args: - '--web.console.templates=/etc/prometheus/consoles' - '--web.console.libraries=/etc/prometheus/console_libraries' - '--config.file=/etc/prometheus/config_out/prometheus.env.yaml' - '--storage.tsdb.path=/prometheus' - '--storage.tsdb.retention.time=15d' - '--web.enable-lifecycle' - '--web.route-prefix=/' - '--web.config.file=/etc/prometheus/web_config/web-config.yaml' - '--web.external-url=${web_external_url}' env: - name: web_external_url valueFrom: secretKeyRef: key: prometheusUrl name: alertmanager-main image: >- swr.cn-east-2.myhuaweicloud.com/kuboard-dependency/prometheus:v2.29.1 imagePullPolicy: IfNotPresent name: prometheus ports: - containerPort: 9090 name: web protocol: TCP readinessProbe: failureThreshold: 120 httpGet: path: /-/ready port: web scheme: HTTP periodSeconds: 5 successThreshold: 1 timeoutSeconds: 3 resources: requests: memory: 400Mi terminationMessagePath: /dev/termination-log terminationMessagePolicy: FallbackToLogsOnError volumeMounts: - mountPath: /etc/prometheus/config_out name: config-out readOnly: true - mountPath: /etc/prometheus/certs name: tls-assets readOnly: true - mountPath: /prometheus name: prometheus-k8s-db subPath: prometheus-db - mountPath: /etc/prometheus/rules/prometheus-k8s-rulefiles-0 name: prometheus-k8s-rulefiles-0 - mountPath: /etc/prometheus/web_config/web-config.yaml name: web-config readOnly: true subPath: web-config.yaml - args: - '--listen-address=:8080' - '--reload-url=http://localhost:9090/-/reload' - '--config-file=/etc/prometheus/config/prometheus.yaml.gz' - >- --config-envsubst-file=/etc/prometheus/config_out/prometheus.env.yaml - '--watched-dir=/etc/prometheus/rules/prometheus-k8s-rulefiles-0' command: - /bin/prometheus-config-reloader env: - name: POD_NAME valueFrom: fieldRef: apiVersion: v1 fieldPath: metadata.name - name: SHARD value: '0' image: >- harbor-dc.xxxxxxxxx/kuboard-dependency/prometheus-config-reloader:v0.49.0 imagePullPolicy: IfNotPresent name: config-reloader resources: limits: cpu: 100m memory: 50Mi requests: cpu: 100m memory: 50Mi terminationMessagePath: /dev/termination-log terminationMessagePolicy: FallbackToLogsOnError volumeMounts: - mountPath: /etc/prometheus/config name: config - mountPath: /etc/prometheus/config_out name: config-out - mountPath: /etc/prometheus/rules/prometheus-k8s-rulefiles-0 name: prometheus-k8s-rulefiles-0 dnsPolicy: ClusterFirst initContainers: - args: - '--watch-interval=0' - '--listen-address=:8080' - '--config-file=/etc/prometheus/config/prometheus.yaml.gz' - >- --config-envsubst-file=/etc/prometheus/config_out/prometheus.env.yaml - '--watched-dir=/etc/prometheus/rules/prometheus-k8s-rulefiles-0' command: - /bin/prometheus-config-reloader env: - name: POD_NAME valueFrom: fieldRef: apiVersion: v1 fieldPath: metadata.name - name: SHARD value: '0' image: >- harbor-dc.xxxxxxxxx/kuboard-dependency/prometheus-config-reloader:v0.49.0 imagePullPolicy: IfNotPresent name: init-config-reloader resources: limits: cpu: 100m memory: 50Mi requests: cpu: 100m memory: 50Mi terminationMessagePath: /dev/termination-log terminationMessagePolicy: FallbackToLogsOnError volumeMounts: - mountPath: /etc/prometheus/config name: config - mountPath: /etc/prometheus/config_out name: config-out - mountPath: /etc/prometheus/rules/prometheus-k8s-rulefiles-0 name: prometheus-k8s-rulefiles-0 nodeSelector: kubernetes.io/os: linux restartPolicy: Always schedulerName: default-scheduler securityContext: fsGroup: 2000 runAsNonRoot: true runAsUser: 1000 serviceAccount: prometheus-k8s serviceAccountName: prometheus-k8s terminationGracePeriodSeconds: 600 volumes: - name: config secret: defaultMode: 420 secretName: prometheus-k8s - name: tls-assets secret: defaultMode: 420 secretName: prometheus-k8s-tls-assets - emptyDir: {} name: config-out - configMap: defaultMode: 420 name: prometheus-k8s-rulefiles-0 name: prometheus-k8s-rulefiles-0 - name: web-config secret: defaultMode: 420 secretName: prometheus-k8s-web-config updateStrategy: type: RollingUpdate volumeClaimTemplates: - apiVersion: v1 kind: PersistentVolumeClaim metadata: creationTimestamp: null name: prometheus-k8s-db spec: accessModes: - ReadWriteOnce resources: requests: storage: 20Gi storageClassName: ceph-filesystem volumeMode: Filesystem status: phase: Pending
apiVersion: v1 kind: Service metadata: annotations: {} labels: operated-prometheus: 'true' name: prometheus-operated namespace: kuboard ownerReferences: - apiVersion: monitoring.coreos.com/v1 kind: Prometheus name: k8s uid: d910bd66-868f-4602-9202-53020c218f2c resourceVersion: '56059473' spec: clusterIP: None clusterIPs: - None internalTrafficPolicy: Cluster ipFamilies: - IPv4 ipFamilyPolicy: SingleStack ports: - name: web port: 9090 protocol: TCP targetPort: web selector: app.kubernetes.io/name: prometheus sessionAffinity: None type: ClusterIP
apiVersion: v1 kind: Service metadata: annotations: {} labels: app.kubernetes.io/component: prometheus app.kubernetes.io/name: prometheus app.kubernetes.io/part-of: kube-prometheus app.kubernetes.io/version: 2.29.1 prometheus: k8s name: prometheus-k8s namespace: kuboard resourceVersion: '56059024' spec: clusterIP: 10.68.4.166 clusterIPs: - 10.68.4.166 internalTrafficPolicy: Cluster ipFamilies: - IPv4 ipFamilyPolicy: SingleStack ports: - name: web port: 9090 protocol: TCP targetPort: web selector: app: prometheus app.kubernetes.io/component: prometheus app.kubernetes.io/name: prometheus app.kubernetes.io/part-of: kube-prometheus prometheus: k8s sessionAffinity: ClientIP sessionAffinityConfig: clientIP: timeoutSeconds: 10800 type: ClusterIP
有没有人解决过