prometheus-operator / kube-prometheus

Use Prometheus to monitor Kubernetes and applications running on Kubernetes
https://prometheus-operator.dev/
Apache License 2.0
6.63k stars 1.91k forks source link

How can I adjust the resources of the config-reloader container in alertmanager? #2333

Open JokerDevops opened 7 months ago

JokerDevops commented 7 months ago

How can I adjust the resources of the config-reloader container in alertmanager?


apiVersion: monitoring.coreos.com/v1
kind: Alertmanager
metadata:
  labels:
    app.kubernetes.io/component: alert-router
    app.kubernetes.io/instance: main
    app.kubernetes.io/name: alertmanager
    app.kubernetes.io/part-of: kube-prometheus
    app.kubernetes.io/version: 0.26.0
  name: main
  namespace: monitoring
spec:
  image: quay.io/prometheus/alertmanager:v0.26.0
  nodeSelector:
    kubernetes.io/os: linux
  podMetadata:
    labels:
      app.kubernetes.io/component: alert-router
      app.kubernetes.io/instance: main
      app.kubernetes.io/name: alertmanager
      app.kubernetes.io/part-of: kube-prometheus
      app.kubernetes.io/version: 0.26.0
  replicas: 3
  resources:
    limits:
      cpu: 100m
      memory: 100Mi
    requests:
      cpu: 40m
      memory: 100Mi
  secrets: []
  securityContext:
    fsGroup: 2000
    runAsNonRoot: true
    runAsUser: 1000
  serviceAccountName: alertmanager-main
  version: 0.26.0

It is always 10m and 50Mi

...
      - args:
        - --listen-address=:8080
        - --reload-url=http://localhost:9093/-/reload
        - --config-file=/etc/alertmanager/config/alertmanager.yaml.gz
        - --config-envsubst-file=/etc/alertmanager/config_out/alertmanager.env.yaml
        - --watched-dir=/etc/alertmanager/config
        command:
        - /bin/prometheus-config-reloader
        env:
        - name: POD_NAME
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: metadata.name
        - name: SHARD
          value: "-1"
        image: quay.io/prometheus-operator/prometheus-config-reloader:v0.70.0
        imagePullPolicy: IfNotPresent
        name: config-reloader
        ports:
        - containerPort: 8080
          name: reloader-web
          protocol: TCP
        resources:
          limits:
            cpu: 10m
            memory: 50Mi
          requests:
            cpu: 10m
            memory: 50Mi
...
simonpasquier commented 7 months ago

You need to use the -config-reloader-cpu-* and -config-reloader-memory-* args of the Prometheus operator.

github-actions[bot] commented 5 months ago

This issue has been automatically marked as stale because it has not had any activity in the last 60 days. Thank you for your contributions.

joshbranham commented 4 months ago

You need to use the -config-reloader-cpu-* and -config-reloader-memory-* args of the Prometheus operator.

Does this only work after a certain version? I am running v0.67.1 and have the args set on my prometheus-operator deployment but our alertmanager config reloader container is not honoring the values. I skimmed the changelog for the operator and no mention of a bugfix or anything related to these args afaict.

  - args:
    - --kubelet-service=kube-system/kubelet
    - --prometheus-config-reloader=quay.io/prometheus-operator/prometheus-config-reloader:v0.67.1
    - --config-reloader-cpu-limit=20m
    - --config-reloader-memory-limit=50Mi
    - --config-reloader-cpu-request=20m
    - --config-reloader-memory-request=50Mi
    image: quay.io/prometheus-operator/prometheus-operator:v0.67.1
joshbranham commented 4 months ago

Nevermind, found the bugfix! https://github.com/prometheus-operator/prometheus-operator/pull/5971

github-actions[bot] commented 2 months ago

This issue has been automatically marked as stale because it has not had any activity in the last 60 days. Thank you for your contributions.