apiVersion: helm.toolkit.fluxcd.io/v2beta1 kind: HelmRelease metadata: name: kube-prometheus-stack spec: interval: 5m chart: spec: version: "48.x" chart: kube-prometheus-stack sourceRef: kind: HelmRepository name: prometheus-community interval: 60m install: crds: Create upgrade: crds: CreateReplace # https://github.com/prometheus-community/helm-charts/blob/main/charts/kube-prometheus-stack/values.yaml values: alertmanager: enabled: false prometheus: prometheusSpec: retention: 24h resources: requests: cpu: 200m memory: 200Mi podMonitorNamespaceSelector: {} podMonitorSelector: matchLabels: app.kubernetes.io/component: monitoring grafana: defaultDashboardsEnabled: false kube-state-metrics: collectors: [] extraArgs: - --custom-resource-state-only=true rbac: extraRules: - apiGroups: - source.toolkit.fluxcd.io - kustomize.toolkit.fluxcd.io - helm.toolkit.fluxcd.io - image.toolkit.fluxcd.io - notification.toolkit.fluxcd.io resources: - gitrepositories - buckets - helmrepositories - helmcharts - ocirepositories - kustomizations - helmreleases - imagerepositories - imagepolicies - imageupdateautomations - alerts - providers - receivers verbs: ["list", "watch"] customResourceState: enabled: true config: spec: resources: - groupVersionKind: group: source.toolkit.fluxcd.io version: "v1" kind: GitRepository metricNamePrefix: gotk metrics: - name: "resource_info" help: "The current state of a GitOps Toolkit resource." each: type: Info info: labelsFromPath: name: [metadata, name] labelsFromPath: exported_namespace: [metadata, namespace] ready: [status, conditions, "[type=Ready]", status] - groupVersionKind: group: source.toolkit.fluxcd.io version: "v1beta2" kind: Bucket metricNamePrefix: gotk metrics: - name: "resource_info" help: "The current state of a GitOps Toolkit resource." each: type: Info info: labelsFromPath: name: [metadata, name] labelsFromPath: exported_namespace: [metadata, namespace] ready: [status, conditions, "[type=Ready]", status] - groupVersionKind: group: source.toolkit.fluxcd.io version: "v1beta2" kind: HelmRepository metricNamePrefix: gotk metrics: - name: "resource_info" help: "The current state of a GitOps Toolkit resource." each: type: Info info: labelsFromPath: name: [metadata, name] labelsFromPath: exported_namespace: [metadata, namespace] type: [spec, type] ready: [status, conditions, "[type=Ready]", status] - groupVersionKind: group: source.toolkit.fluxcd.io version: "v1beta2" kind: HelmChart metricNamePrefix: gotk metrics: - name: "resource_info" help: "The current state of a GitOps Toolkit resource." each: type: Info info: labelsFromPath: name: [metadata, name] labelsFromPath: exported_namespace: [metadata, namespace] ready: [status, conditions, "[type=Ready]", status] - groupVersionKind: group: source.toolkit.fluxcd.io version: "v1beta2" kind: OCIRepository metricNamePrefix: gotk metrics: - name: "resource_info" help: "The current state of a GitOps Toolkit resource." each: type: Info info: labelsFromPath: name: [metadata, name] labelsFromPath: exported_namespace: [metadata, namespace] ready: [status, conditions, "[type=Ready]", status] - groupVersionKind: group: kustomize.toolkit.fluxcd.io version: "v1" kind: Kustomization metricNamePrefix: gotk metrics: - name: "resource_info" help: "The current state of a GitOps Toolkit resource." each: type: Info info: labelsFromPath: name: [metadata, name] labelsFromPath: exported_namespace: [metadata, namespace] ready: [status, conditions, "[type=Ready]", status] - groupVersionKind: group: helm.toolkit.fluxcd.io version: "v2beta1" kind: HelmRelease metricNamePrefix: gotk metrics: - name: "resource_info" help: "The current state of a GitOps Toolkit resource." each: type: Info info: labelsFromPath: name: [metadata, name] labelsFromPath: exported_namespace: [metadata, namespace] ready: [status, conditions, "[type=Ready]", status] - groupVersionKind: group: image.toolkit.fluxcd.io version: "v1beta2" kind: ImageRepository metricNamePrefix: gotk metrics: - name: "resource_info" help: "The current state of a GitOps Toolkit resource." each: type: Info info: labelsFromPath: name: [metadata, name] labelsFromPath: exported_namespace: [metadata, namespace] ready: [status, conditions, "[type=Ready]", status] - groupVersionKind: group: image.toolkit.fluxcd.io version: "v1beta2" kind: ImagePolicy metricNamePrefix: gotk metrics: - name: "resource_info" help: "The current state of a GitOps Toolkit resource." each: type: Info info: labelsFromPath: name: [metadata, name] labelsFromPath: exported_namespace: [metadata, namespace] ready: [status, conditions, "[type=Ready]", status] - groupVersionKind: group: image.toolkit.fluxcd.io version: "v1beta1" kind: ImageUpdateAutomation metricNamePrefix: gotk metrics: - name: "resource_info" help: "The current state of a GitOps Toolkit resource." each: type: Info info: labelsFromPath: name: [metadata, name] labelsFromPath: exported_namespace: [metadata, namespace] ready: [status, conditions, "[type=Ready]", status] - groupVersionKind: group: notification.toolkit.fluxcd.io version: "v1beta2" kind: Alert metricNamePrefix: gotk metrics: - name: "resource_info" help: "The current state of a GitOps Toolkit resource." each: type: Info info: labelsFromPath: name: [metadata, name] labelsFromPath: exported_namespace: [metadata, namespace] ready: [status, conditions, "[type=Ready]", status] - groupVersionKind: group: notification.toolkit.fluxcd.io version: "v1beta2" kind: Provider metricNamePrefix: gotk metrics: - name: "resource_info" help: "The current state of a GitOps Toolkit resource." each: type: Info info: labelsFromPath: name: [metadata, name] labelsFromPath: exported_namespace: [metadata, namespace] ready: [status, conditions, "[type=Ready]", status] - groupVersionKind: group: notification.toolkit.fluxcd.io version: "v1" kind: Receiver metricNamePrefix: gotk metrics: - name: "resource_info" help: "The current state of a GitOps Toolkit resource." each: type: Info info: labelsFromPath: name: [metadata, name] labelsFromPath: exported_namespace: [metadata, namespace] ready: [status, conditions, "[type=Ready]", status] postRenderers: - kustomize: patches: - target: # Ignore these objects from Flux diff as they are mutated from chart hooks kind: (ValidatingWebhookConfiguration|MutatingWebhookConfiguration) name: kube-prometheus-stack-admission patch: | - op: add path: /metadata/annotations/helm.toolkit.fluxcd.io~1driftDetection value: disabled - target: # Ignore these objects from Flux diff as they are mutated at apply time but not at dry-run time kind: PrometheusRule patch: | - op: add path: /metadata/annotations/helm.toolkit.fluxcd.io~1driftDetection value: disabled