From a0db11d2a67e6d84ac2d61eb3023e301717c3037 Mon Sep 17 00:00:00 2001 From: Quentin Bisson Date: Mon, 18 Mar 2024 15:54:52 +0100 Subject: [PATCH] Remove azure provider (#1572) --- .circleci/config.yml | 15 - CHANGELOG.md | 4 + Documentation/targets.md | 11 - .../additional-scrape-configs.template.yaml | 6 - .../templates/configmap.yaml | 2 +- .../input/vintage/case-4-azure-v18.golden | 14 - .../vintage/case-4-azure-v18.golden | 483 --------- .../classic/vintage/case-4-azure-v18.golden | 69 -- .../vintage/case-4-azure-v18.golden | 70 -- .../test/vintage/case-4-azure-v18.golden | 6 - .../test/vintage/case-4-azure-v18.golden | 32 - .../default/vintage/case-4-azure-v18.golden | 29 - .../vintage/case-4-azure-v18.golden | 32 - .../vintage/case-4-azure-v18.golden | 31 - .../vintage/case-4-azure-v18.golden | 30 - .../classic/vintage/case-4-azure-v18.golden | 125 --- .../vintage/case-4-azure-v18.golden | 112 --- .../default/vintage/case-4-azure-v18.golden | 32 - .../vintage/case-4-azure-v18.golden | 34 - .../monitoring/scrapeconfigs/resource_test.go | 108 -- .../test/aws/case-1-vintage-mc.golden | 6 - .../test/aws/case-2-aws-v16.golden | 6 - .../test/aws/case-3-aws-v18.golden | 6 - .../test/aws/case-4-azure-v18.golden | 912 ----------------- .../test/azure/case-4-azure-v18.golden | 933 ------------------ .../test/capa/case-1-capa-mc.golden | 6 - .../test/capa/case-2-capa.golden | 6 - .../test/capa/case-3-capz.golden | 6 - .../scrapeconfigs/test/capa/case-4-eks.golden | 6 - .../scrapeconfigs/test/capa/case-5-gcp.golden | 6 - .../test/capz/case-1-capa-mc.golden | 6 - .../test/capz/case-2-capa.golden | 6 - .../test/capz/case-3-capz.golden | 6 - .../scrapeconfigs/test/capz/case-4-eks.golden | 6 - .../scrapeconfigs/test/capz/case-5-gcp.golden | 6 - .../test/gcp/case-1-capa-mc.golden | 6 - .../scrapeconfigs/test/gcp/case-2-capa.golden | 6 - .../scrapeconfigs/test/gcp/case-3-capz.golden | 6 - .../scrapeconfigs/test/gcp/case-4-eks.golden | 6 - .../scrapeconfigs/test/gcp/case-5-gcp.golden | 6 - .../test/vintage/case-4-azure-v18.golden | 28 - .../test/vintage/case-4-azure-v18.golden | 12 - 42 files changed, 5 insertions(+), 3233 deletions(-) delete mode 100644 pkg/unittest/input/vintage/case-4-azure-v18.golden delete mode 100644 service/controller/resource/alerting/alertmanagerconfig/test/alertmanager-config/vintage/case-4-azure-v18.golden delete mode 100644 service/controller/resource/alerting/alertmanagerconfig/test/notification-template/classic/vintage/case-4-azure-v18.golden delete mode 100644 service/controller/resource/alerting/alertmanagerconfig/test/notification-template/mimir-enabled/vintage/case-4-azure-v18.golden delete mode 100644 service/controller/resource/alerting/alertmanagerwiring/test/vintage/case-4-azure-v18.golden delete mode 100644 service/controller/resource/alerting/heartbeatwebhookconfig/test/vintage/case-4-azure-v18.golden delete mode 100644 service/controller/resource/monitoring/ingress/test/default/vintage/case-4-azure-v18.golden delete mode 100644 service/controller/resource/monitoring/ingress/test/externaldns-with-restricted-access/vintage/case-4-azure-v18.golden delete mode 100644 service/controller/resource/monitoring/ingress/test/externaldns/vintage/case-4-azure-v18.golden delete mode 100644 service/controller/resource/monitoring/ingress/test/restricted-access/vintage/case-4-azure-v18.golden delete mode 100644 service/controller/resource/monitoring/prometheus/test/classic/vintage/case-4-azure-v18.golden delete mode 100644 service/controller/resource/monitoring/prometheus/test/mimir-enabled/vintage/case-4-azure-v18.golden delete mode 100644 service/controller/resource/monitoring/remotewriteingress/test/default/vintage/case-4-azure-v18.golden delete mode 100644 service/controller/resource/monitoring/remotewriteingress/test/externaldns/vintage/case-4-azure-v18.golden delete mode 100644 service/controller/resource/monitoring/scrapeconfigs/test/aws/case-4-azure-v18.golden delete mode 100644 service/controller/resource/monitoring/scrapeconfigs/test/azure/case-4-azure-v18.golden delete mode 100644 service/controller/resource/monitoring/verticalpodautoscaler/test/vintage/case-4-azure-v18.golden delete mode 100644 service/controller/resource/namespace/test/vintage/case-4-azure-v18.golden diff --git a/.circleci/config.yml b/.circleci/config.yml index cd509070b..b3aad122c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -49,21 +49,6 @@ workflows: tags: only: /^v.*/ - - architect/push-to-app-collection: - name: azure-app-collection - context: "architect" - app_name: "prometheus-meta-operator" - app_namespace: "monitoring" - app_collection_repo: "azure-app-collection" - requires: - - app-catalog - - push-to-registries - filters: - branches: - ignore: /.*/ - tags: - only: /^v.*/ - - architect/push-to-app-collection: context: architect name: push-to-capa-app-collection diff --git a/CHANGELOG.md b/CHANGELOG.md index 202444e1e..d57d30e64 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Removed + +- Remove the `azure` provider. + ## [4.70.3] - 2024-03-18 ### Fixed diff --git a/Documentation/targets.md b/Documentation/targets.md index 4e0b45f8f..bf6168361 100644 --- a/Documentation/targets.md +++ b/Documentation/targets.md @@ -45,17 +45,11 @@ - aws-operator - cluster-autoscaler -### Azure specific - -- azure-operator -- cluster-autoscaler - ## Missing - prometheus-operator-app - CP prometheus - TC prometheus -- azure-collector ## Not scraped @@ -76,11 +70,6 @@ - kiam - opa-mutator-app -### Azure specific - -- azure-admission-controller -- calico-typha - ## Unscrapeable * happa: not exposing any metrics diff --git a/files/templates/scrapeconfigs/additional-scrape-configs.template.yaml b/files/templates/scrapeconfigs/additional-scrape-configs.template.yaml index 54a609529..c451bac08 100644 --- a/files/templates/scrapeconfigs/additional-scrape-configs.template.yaml +++ b/files/templates/scrapeconfigs/additional-scrape-configs.template.yaml @@ -611,12 +611,6 @@ target_label: nodepool replacement: ${1} action: replace - # Override with label for Azure clusters if exists. - - source_labels: [app,label_giantswarm_io_machine_pool] - regex: kube-state-metrics;(.+) - target_label: nodepool - replacement: ${1} - action: replace - action: labeldrop regex: label_giantswarm_io_machine_pool|label_giantswarm_io_machine_deployment [[- if eq .ClusterType "management_cluster" ]] diff --git a/helm/prometheus-meta-operator/templates/configmap.yaml b/helm/prometheus-meta-operator/templates/configmap.yaml index 7f0d62960..6f76be78e 100644 --- a/helm/prometheus-meta-operator/templates/configmap.yaml +++ b/helm/prometheus-meta-operator/templates/configmap.yaml @@ -59,7 +59,7 @@ data: customer: {{ .Values.managementCluster.customer }} name: {{ .Values.managementCluster.name }} pipeline: {{ .Values.managementCluster.pipeline }} - {{- $providers := list "aws" "azure" "gcp" "capa" "capz" }} + {{- $providers := list "aws" "gcp" "capa" "capz" }} {{- if has .Values.managementCluster.provider.kind $providers }} region: {{ .Values.managementCluster.provider.region }} {{- else }} diff --git a/pkg/unittest/input/vintage/case-4-azure-v18.golden b/pkg/unittest/input/vintage/case-4-azure-v18.golden deleted file mode 100644 index dd4a3f0c4..000000000 --- a/pkg/unittest/input/vintage/case-4-azure-v18.golden +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: cluster.x-k8s.io/v1beta1 -kind: Cluster -metadata: - labels: - "giantswarm.io/service-priority": "medium" - "release.giantswarm.io/version": 18.0.0 - name: foo - namespace: org-my-organization -spec: - controlPlaneEndpoint: - host: master.foo - port: 443 - infrastructureRef: - kind: AzureCluster diff --git a/service/controller/resource/alerting/alertmanagerconfig/test/alertmanager-config/vintage/case-4-azure-v18.golden b/service/controller/resource/alerting/alertmanagerconfig/test/alertmanager-config/vintage/case-4-azure-v18.golden deleted file mode 100644 index 8ca7e00bb..000000000 --- a/service/controller/resource/alerting/alertmanagerconfig/test/alertmanager-config/vintage/case-4-azure-v18.golden +++ /dev/null @@ -1,483 +0,0 @@ -global: - resolve_timeout: 5m - slack_api_url: https://slack - -templates: -- '/etc/alertmanager/config/*.tmpl' - -route: - group_by: [alertname, cluster_id, installation, status, team] - group_interval: 15m - group_wait: 5m - repeat_interval: 4h - receiver: root - - routes: - - # Falco noise Slack - - receiver: falco_noise_slack - matchers: - - alertname=~"Falco.*" - continue: false - - - receiver: team_tinkerers_slack - repeat_interval: 14d - matchers: - - severity=~"page|notify" - - team="tinkerers" - continue: false - - # Team Ops Opsgenie - - receiver: opsgenie_router - matchers: - - severity="page" - continue: true - - # Team Atlas Slack - - receiver: team_atlas_slack - matchers: - - severity=~"page|notify" - - team="atlas" - - type!="heartbeat" - - alertname!~"Inhibition.*" - continue: false - - # Team Celestial Slack - - receiver: team_phoenix_slack - matchers: - - severity=~"page|notify" - - team="celestial" - - sloth_severity=~"page|ticket" - continue: false - - # Team Firecracker Slack - - receiver: team_phoenix_slack - matchers: - - severity=~"page|notify" - - team="firecracker" - - sloth_severity=~"page|ticket" - continue: false - - # Team Phoenix Slack - - receiver: team_phoenix_slack - matchers: - - team="phoenix" - - sloth_severity="page" - - silence="true" - continue: false - - # Team Shield Slack - - receiver: team_shield_slack - matchers: - - severity=~"page|notify" - - team="shield" - continue: false - - # Team BigMac Slack - - receiver: team_bigmac_slack - matchers: - - severity=~"page|notify" - - team="bigmac" - continue: false - - # Team Clippy Slack - # ReRoute to `phoenix` until we change all team ownership labels - - receiver: team_phoenix_slack - matchers: - - severity=~"page|notify" - - team="clippy" - continue: false - - # Team Rocket Slack - - receiver: team_rocket_slack - matchers: - - severity=~"page|notify" - - team="rocket" - continue: false - - # Team Ops Slack - - receiver: team_ops_slack - matchers: - - severity=~"page|notify" - continue: true - - # Team Turtles Slack - - receiver: team_turtles_slack - matchers: - - severity=~"page|notify" - - team="turtles" - continue: false - -receivers: -- name: root - -- name: falco_noise_slack - slack_configs: - - channel: '#noise-falco' - send_resolved: true - actions: - - type: button - text: ':green_book: OpsRecipe' - url: '{{ template "__runbookurl" . }}' - style: '{{ if eq .Status "firing" }}primary{{ else }}default{{ end }}' - - type: button - text: ':coffin: Linked PMs' - url: '{{ template "__alert_linked_postmortems" . }}' - - type: button - text: ':mag: Query' - url: '{{ template "__prometheusurl" . }}' - - type: button - text: ':grafana: Dashboard' - url: '{{ template "__dashboardurl" . }}' - - type: button - text: ':no_bell: Silence' - url: '{{ template "__alert_silence_link" .}}' - style: '{{ if eq .Status "firing" }}danger{{ else }}default{{ end }}' - -- name: team_atlas_slack - slack_configs: - - channel: '#alert-atlas-test' - send_resolved: true - actions: - - type: button - text: ':green_book: OpsRecipe' - url: '{{ template "__runbookurl" . }}' - style: '{{ if eq .Status "firing" }}primary{{ else }}default{{ end }}' - - type: button - text: ':coffin: Linked PMs' - url: '{{ template "__alert_linked_postmortems" . }}' - - type: button - text: ':mag: Query' - url: '{{ template "__prometheusurl" . }}' - - type: button - text: ':grafana: Dashboard' - url: '{{ template "__dashboardurl" . }}' - - type: button - text: ':no_bell: Silence' - url: '{{ template "__alert_silence_link" .}}' - style: '{{ if eq .Status "firing" }}danger{{ else }}default{{ end }}' - -- name: team_phoenix_slack - slack_configs: - - channel: '#alert-phoenix-test' - send_resolved: true - actions: - - type: button - text: ':green_book: OpsRecipe' - url: '{{ template "__runbookurl" . }}' - style: '{{ if eq .Status "firing" }}primary{{ else }}default{{ end }}' - - type: button - text: ':coffin: Linked PMs' - url: '{{ template "__alert_linked_postmortems" . }}' - - type: button - text: ':mag: Query' - url: '{{ template "__prometheusurl" . }}' - - type: button - text: ':grafana: Dashboard' - url: '{{ template "__dashboardurl" . }}' - - type: button - text: ':no_bell: Silence' - url: '{{ template "__alert_silence_link" . }}' - style: '{{ if eq .Status "firing" }}danger{{ else }}default{{ end }}' - -- name: team_bigmac_slack - slack_configs: - - channel: '#alert-bigmac-test' - send_resolved: true - actions: - - type: button - text: ':green_book: OpsRecipe' - url: '{{ template "__runbookurl" . }}' - style: '{{ if eq .Status "firing" }}primary{{ else }}default{{ end }}' - - type: button - text: ':coffin: Linked PMs' - url: '{{ template "__alert_linked_postmortems" . }}' - - type: button - text: ':mag: Query' - url: '{{ template "__prometheusurl" . }}' - - type: button - text: ':grafana: Dashboard' - url: '{{ template "__dashboardurl" . }}' - - type: button - text: ':no_bell: Silence' - url: '{{ template "__alert_silence_link" . }}' - style: '{{ if eq .Status "firing" }}danger{{ else }}default{{ end }}' - -- name: team_rocket_slack - slack_configs: - - channel: '#alert-rocket-test' - send_resolved: true - actions: - - type: button - text: ':green_book: OpsRecipe' - url: '{{ template "__runbookurl" . }}' - style: '{{ if eq .Status "firing" }}primary{{ else }}default{{ end }}' - - type: button - text: ':coffin: Linked PMs' - url: '{{ template "__alert_linked_postmortems" . }}' - - type: button - text: ':mag: Query' - url: '{{ template "__prometheusurl" . }}' - - type: button - text: ':grafana: Dashboard' - url: '{{ template "__dashboardurl" . }}' - - type: button - text: ':no_bell: Silence' - url: '{{ template "__alert_silence_link" . }}' - style: '{{ if eq .Status "firing" }}danger{{ else }}default{{ end }}' - -- name: team_shield_slack - slack_configs: - - channel: '#alert-shield' - send_resolved: true - actions: - - type: button - text: ':green_book: OpsRecipe' - url: '{{ template "__runbookurl" . }}' - style: '{{ if eq .Status "firing" }}primary{{ else }}default{{ end }}' - - type: button - text: ':coffin: Linked PMs' - url: '{{ template "__alert_linked_postmortems" . }}' - - type: button - text: ':mag: Query' - url: '{{ template "__prometheusurl" . }}' - - type: button - text: ':grafana: Dashboard' - url: '{{ template "__dashboardurl" . }}' - - type: button - text: ':no_bell: Silence' - url: '{{ template "__alert_silence_link" .}}' - style: '{{ if eq .Status "firing" }}danger{{ else }}default{{ end }}' - -- name: team_turtles_slack - slack_configs: - - channel: '#alert-turtles-test' - send_resolved: true - actions: - - type: button - text: ':green_book: OpsRecipe' - url: '{{ template "__runbookurl" . }}' - style: '{{ if eq .Status "firing" }}primary{{ else }}default{{ end }}' - - type: button - text: ':coffin: Linked PMs' - url: '{{ template "__alert_linked_postmortems" . }}' - - type: button - text: ':mag: Query' - url: '{{ template "__prometheusurl" . }}' - - type: button - text: ':grafana: Dashboard' - url: '{{ template "__dashboardurl" . }}' - - type: button - text: ':no_bell: Silence' - url: '{{ template "__alert_silence_link" . }}' - style: '{{ if eq .Status "firing" }}danger{{ else }}default{{ end }}' - -- name: team_tinkerers_slack - slack_configs: - - channel: '#alert-tinkerers' - send_resolved: true - actions: - - type: button - text: ':green_book: OpsRecipe' - url: '{{ template "__runbookurl" . }}' - style: '{{ if eq .Status "firing" }}primary{{ else }}default{{ end }}' - - type: button - text: ':coffin: Linked PMs' - url: '{{ template "__alert_linked_postmortems" . }}' - - type: button - text: ':mag: Query' - url: '{{ template "__prometheusurl" . }}' - - type: button - text: ':grafana: Dashboard' - url: '{{ template "__dashboardurl" . }}' - - type: button - text: ':no_bell: Silence' - url: '{{ template "__alert_silence_link" .}}' - style: '{{ if eq .Status "firing" }}danger{{ else }}default{{ end }}' - -- name: opsgenie_router - opsgenie_configs: - - api_key: opsgenie-key - tags: "{{ (index .Alerts 0).Labels.alertname }},{{ (index .Alerts 0).Labels.cluster_type }},{{ (index .Alerts 0).Labels.severity }},{{ (index .Alerts 0).Labels.team }},{{ (index .Alerts 0).Labels.area }},{{ (index .Alerts 0).Labels.service_priority }},{{ (index .Alerts 0).Labels.provider }},{{ (index .Alerts 0).Labels.installation }},{{ (index .Alerts 0).Labels.pipeline }}" - -- name: team_ops_slack - slack_configs: - - channel: '#alert-test-test-installation' - send_resolved: true - actions: - - type: button - text: ':green_book: OpsRecipe' - url: '{{ template "__runbookurl" . }}' - style: '{{ if eq .Status "firing" }}primary{{ else }}default{{ end }}' - - type: button - text: ':coffin: Linked PMs' - url: '{{ template "__alert_linked_postmortems" . }}' - - type: button - text: ':mag: Query' - url: '{{ template "__prometheusurl" . }}' - - type: button - text: ':grafana: Dashboard' - url: '{{ template "__dashboardurl" . }}' - - type: button - text: ':no_bell: Silence' - url: '{{ template "__alert_silence_link" . }}' - style: '{{ if eq .Status "firing" }}danger{{ else }}default{{ end }}' - -inhibit_rules: -- source_matchers: - - inhibit_kube_state_metrics_down=true - target_matchers: - - cancel_if_kube_state_metrics_down=true - equal: [cluster_id] - -- source_matchers: - - inhibit_kube_state_metrics_down=true - - cluster_id=test-installation - target_matchers: - - cancel_if_mc_kube_state_metrics_down=true - -- source_matchers: - - inhibit_kube_state_metrics_down=true - target_matchers: - - cancel_if_any_kube_state_metrics_down=true - -- source_matchers: - - cluster_status_creating=true - target_matchers: - - cancel_if_cluster_status_creating=true - equal: [cluster_id] - -- source_matchers: - - cluster_status_created=true - target_matchers: - - cancel_if_cluster_status_created=true - equal: [cluster_id] - -- source_matchers: - - cluster_status_updating=true - target_matchers: - - cancel_if_cluster_status_updating=true - equal: [cluster_id] - -- source_matchers: - - cluster_status_updated=true - target_matchers: - - cancel_if_cluster_status_updated=true - equal: [cluster_id] - -- source_matchers: - - cluster_status_deleting=true - target_matchers: - - cancel_if_cluster_status_deleting=true - equal: [cluster_id] - -- source_matchers: - - cluster_with_no_nodepools=true - target_matchers: - - cancel_if_cluster_with_no_nodepools=true - equal: [cluster_id] - -- source_matchers: - - cluster_with_scaling_nodepools=true - target_matchers: - - cancel_if_cluster_with_scaling_nodepools=true - equal: [cluster_id] - -- source_matchers: - - cluster_with_notready_nodepools=true - target_matchers: - - cancel_if_cluster_with_notready_nodepools=true - equal: [cluster_id] - -- source_matchers: - - instance_state_not_running=true - target_matchers: - - cancel_if_instance_state_not_running=true - equal: [node] - -- source_matchers: - - kiam_has_errors=true - target_matchers: - - cancel_if_kiam_has_errors=true - equal: [cluster_id] - -- source_matchers: - - kubelet_down=true - target_matchers: - - cancel_if_kubelet_down=true - equal: [cluster_id, ip] - -- source_matchers: - - kubelet_down=true - target_matchers: - - cancel_if_any_kubelet_down=true - equal: [cluster_id] - -- source_matchers: - - kubelet_not_ready=true - target_matchers: - - cancel_if_kubelet_not_ready=true - equal: [cluster_id, ip] - -- source_matchers: - - kubelet_not_ready=true - target_matchers: - - cancel_if_any_kubelet_not_ready=true - equal: [cluster_id] - -- source_matchers: - - nodes_down=true - target_matchers: - - cancel_if_nodes_down=true - equal: [cluster_id] - -- source_matchers: - - scrape_timeout=true - target_matchers: - - cancel_if_scrape_timeout=true - equal: [cluster_id, instance] - -- source_matchers: - - control_plane_node_down=true - target_matchers: - - cancel_if_control_plane_node_down=true - equal: [cluster_id] - -- source_matchers: - - apiserver_down=true - target_matchers: - - cancel_if_apiserver_down=true - equal: [cluster_id] - -- source_matchers: - - apiserver_down=true - target_matchers: - - cancel_if_any_apiserver_down=true - -- source_matchers: - - outside_working_hours=true - target_matchers: - - cancel_if_outside_working_hours=true - -- source_matchers: - - has_worker_nodes=false - target_matchers: - - cancel_if_cluster_has_no_workers=true - equal: [cluster_id] - -- source_matchers: - - cluster_is_not_running_prometheus_agent=true - target_matchers: - - cancel_if_cluster_is_not_running_prometheus_agent=true - equal: [cluster_id] - -- source_matchers: - - inhibit_prometheus_agent_down=true - target_matchers: - - cancel_if_prometheus_agent_down=true - equal: [cluster_id] - -- source_matchers: - - stack_failed=true - target_matchers: - - cancel_if_stack_failed=true diff --git a/service/controller/resource/alerting/alertmanagerconfig/test/notification-template/classic/vintage/case-4-azure-v18.golden b/service/controller/resource/alerting/alertmanagerconfig/test/notification-template/classic/vintage/case-4-azure-v18.golden deleted file mode 100644 index 4399e1855..000000000 --- a/service/controller/resource/alerting/alertmanagerconfig/test/notification-template/classic/vintage/case-4-azure-v18.golden +++ /dev/null @@ -1,69 +0,0 @@ -{{ define "__alertmanager" }}Alertmanager{{ end }} -{{ define "__alertmanagerurl" }}{{ .ExternalURL }}/#/alerts?receiver={{ .Receiver }}&silenced=false&inhibited=false&active=true&filter=%7Balertname%3D%22{{ .CommonLabels.alertname }}%22%7D{{ end }} -{{ define "__dashboardurl" -}}{{ if match "^https://.+" (index .Alerts 0).Annotations.dashboard }}{{ (index .Alerts 0).Annotations.dashboard }}{{ else }}https://grafana/d/{{ (index .Alerts 0).Annotations.dashboard }}{{ end }}{{- end }} -{{ define "__runbookurl" -}}https://intranet.giantswarm.io/docs/support-and-ops/ops-recipes/{{ (index .Alerts 0).Annotations.opsrecipe }}{{- end }} -{{ define "__prometheusurl" }}{{ (index .Alerts 0).GeneratorURL }}{{end}} - -{{ define "slack.default.title" }}{{ .Status | toUpper }}[{{ if eq .Status "firing" }}{{ .Alerts.Firing | len }}{{- else }}{{ .Alerts.Resolved | len }}{{- end }}] {{ (index .Alerts 0).Labels.alertname }} - Team {{ (index .Alerts 0).Labels.team }}{{ end }} -{{ define "slack.default.username" }}{{ template "__alertmanager" . }}{{ end }} -{{ define "slack.default.fallback" }}{{ template "slack.default.title" . }} | {{ template "slack.default.titlelink" . }}{{ end }} -{{ define "slack.default.pretext" }}{{ end }} -{{ define "slack.default.titlelink" }}{{ template "__alertmanagerurl" . }}{{ end }} -{{ define "slack.default.iconemoji" }}{{ end }} -{{ define "slack.default.iconurl" }}{{ end }} -{{ define "slack.default.text" }}*Cluster:* {{ (index .Alerts 0).Labels.installation }}{{ if (index .Alerts 0).Labels.cluster_id }} / {{ (index .Alerts 0).Labels.cluster_id }}{{ end }}{{ if (index .Alerts 0).Labels.service }} / {{ (index .Alerts 0).Labels.service }}{{ end }} -*Area:* {{ (index .Alerts 0).Labels.area }} / {{ (index .Alerts 0).Labels.topic }} -{{- if (index .Alerts 0).Annotations.description }} -*Instances* -{{ if eq .Status "firing" }} -{{ range .Alerts.Firing }} -:fire: {{ if .Labels.instance }}{{ .Labels.instance }}: {{ end }}{{ .Annotations.description }}{{- end }} -{{ else }} -{{ range .Alerts.Resolved }} -:success: {{ if .Labels.instance }}{{ .Labels.instance }}: {{ end }}{{ .Annotations.description }}{{- end }} -{{ end }} -{{- end }} -{{ end }} - -{{ define "opsgenie.default.message" }}{{ .GroupLabels.installation }} / {{ .GroupLabels.cluster_id }}{{ if (index .Alerts 0).Labels.service }} / {{ (index .Alerts 0).Labels.service }}{{ end }} - {{ index (index .Alerts.Firing 0).Labels `alertname`}}{{ end }} -{{ define "opsgenie.default.source" }}{{ template "__alertmanager" . }}{{ end }} -{{ define "opsgenie.default.description" }}* Team: {{ (index .Alerts 0).Labels.team }} -* Area: {{ (index .Alerts 0).Labels.area }} / {{ (index .Alerts 0).Labels.topic }} - -* Instances:{{ range .Alerts.Firing }} -🔥 {{ if .Labels.instance }}{{ .Labels.instance }}: {{ end }}{{ .Annotations.description }}{{ end }} - ---- - -{{ if (index .Alerts 0).Annotations.opsrecipe -}} -📗 Runbook: {{ template "__runbookurl" . }} -{{ end -}} -🔔 Alertmanager {{ template "__alertmanagerurl" . }} -{{ if (index .Alerts 0).Annotations.dashboard -}} -📈 Dashboard: {{ template "__dashboardurl" . }} -{{ end -}} -👀 Prometheus: {{ template "__prometheusurl" . }} - ---- - -{{ if not (index .Alerts 0).Annotations.opsrecipe }}⚠️ There is no **runbook** for this alert, time to get your pen.{{- end }} -{{ if not (index .Alerts 0).Annotations.dashboard }}⚠️ There is no **dashboard** for this alert, time to sketch.{{- end }} -{{- end }} - -# This builds the silence URL. We exclude the alertname in the range -# to avoid the issue of having trailing comma separator (%2C) at the end -# of the generated URL -{{ define "__alert_silence_link" -}} - {{ .ExternalURL }}/#/silences/new?filter=%7B - {{- range .CommonLabels.SortedPairs -}} - {{- if ne .Name "alertname" -}} - {{- .Name }}%3D"{{- .Value -}}"%2C%20 - {{- end -}} - {{- end -}} - alertname%3D"{{ .CommonLabels.alertname }}"%7D -{{- end }} - -# Link to related PMs -{{ define "__alert_linked_postmortems" -}} -https://github.com/giantswarm/giantswarm/issues?q=is%3Aissue+is%3Aopen+label%3Apostmortem+label%3Aalert%2F{{ .CommonLabels.alertname }} -{{- end }} diff --git a/service/controller/resource/alerting/alertmanagerconfig/test/notification-template/mimir-enabled/vintage/case-4-azure-v18.golden b/service/controller/resource/alerting/alertmanagerconfig/test/notification-template/mimir-enabled/vintage/case-4-azure-v18.golden deleted file mode 100644 index 0b0aae88a..000000000 --- a/service/controller/resource/alerting/alertmanagerconfig/test/notification-template/mimir-enabled/vintage/case-4-azure-v18.golden +++ /dev/null @@ -1,70 +0,0 @@ -{{ define "__alertmanager" }}Alertmanager{{ end }} -{{ define "__alertmanagerurl" }}{{ .ExternalURL }}/#/alerts?receiver={{ .Receiver }}&silenced=false&inhibited=false&active=true&filter=%7Balertname%3D%22{{ .CommonLabels.alertname }}%22%7D{{ end }} -{{ define "__dashboardurl" -}}{{ if match "^https://.+" (index .Alerts 0).Annotations.dashboard }}{{ (index .Alerts 0).Annotations.dashboard }}{{ else }}https://grafana/d/{{ (index .Alerts 0).Annotations.dashboard }}{{ end }}{{- end }} -{{ define "__runbookurl" -}}https://intranet.giantswarm.io/docs/support-and-ops/ops-recipes/{{ (index .Alerts 0).Annotations.opsrecipe }}{{- end }} -{{ define "__prometheus_query_cluster_id" }}{{ if (index .Alerts 0).Labels.cluster_id }}{{ (index .Alerts 0).Labels.cluster_id }}{{ else }}{{ (index .Alerts 0).Labels.installation }}{{ end }}{{ end }} -{{ define "__prometheusurl" }}https://prometheus.installation-prometheus.svc/{{ template "__prometheus_query_cluster_id" . }}{{ (index .Alerts 0).GeneratorURL }}{{end}} - -{{ define "slack.default.title" }}{{ .Status | toUpper }}[{{ if eq .Status "firing" }}{{ .Alerts.Firing | len }}{{- else }}{{ .Alerts.Resolved | len }}{{- end }}] {{ (index .Alerts 0).Labels.alertname }} - Team {{ (index .Alerts 0).Labels.team }}{{ end }} -{{ define "slack.default.username" }}{{ template "__alertmanager" . }}{{ end }} -{{ define "slack.default.fallback" }}{{ template "slack.default.title" . }} | {{ template "slack.default.titlelink" . }}{{ end }} -{{ define "slack.default.pretext" }}{{ end }} -{{ define "slack.default.titlelink" }}{{ template "__alertmanagerurl" . }}{{ end }} -{{ define "slack.default.iconemoji" }}{{ end }} -{{ define "slack.default.iconurl" }}{{ end }} -{{ define "slack.default.text" }}*Cluster:* {{ (index .Alerts 0).Labels.installation }}{{ if (index .Alerts 0).Labels.cluster_id }} / {{ (index .Alerts 0).Labels.cluster_id }}{{ end }}{{ if (index .Alerts 0).Labels.service }} / {{ (index .Alerts 0).Labels.service }}{{ end }} -*Area:* {{ (index .Alerts 0).Labels.area }} / {{ (index .Alerts 0).Labels.topic }} -{{- if (index .Alerts 0).Annotations.description }} -*Instances* -{{ if eq .Status "firing" }} -{{ range .Alerts.Firing }} -:fire: {{ if .Labels.instance }}{{ .Labels.instance }}: {{ end }}{{ .Annotations.description }}{{- end }} -{{ else }} -{{ range .Alerts.Resolved }} -:success: {{ if .Labels.instance }}{{ .Labels.instance }}: {{ end }}{{ .Annotations.description }}{{- end }} -{{ end }} -{{- end }} -{{ end }} - -{{ define "opsgenie.default.message" }}{{ .GroupLabels.installation }} / {{ .GroupLabels.cluster_id }}{{ if (index .Alerts 0).Labels.service }} / {{ (index .Alerts 0).Labels.service }}{{ end }} - {{ index (index .Alerts.Firing 0).Labels `alertname`}}{{ end }} -{{ define "opsgenie.default.source" }}{{ template "__alertmanager" . }}{{ end }} -{{ define "opsgenie.default.description" }}* Team: {{ (index .Alerts 0).Labels.team }} -* Area: {{ (index .Alerts 0).Labels.area }} / {{ (index .Alerts 0).Labels.topic }} - -* Instances:{{ range .Alerts.Firing }} -🔥 {{ if .Labels.instance }}{{ .Labels.instance }}: {{ end }}{{ .Annotations.description }}{{ end }} - ---- - -{{ if (index .Alerts 0).Annotations.opsrecipe -}} -📗 Runbook: {{ template "__runbookurl" . }} -{{ end -}} -🔔 Alertmanager {{ template "__alertmanagerurl" . }} -{{ if (index .Alerts 0).Annotations.dashboard -}} -📈 Dashboard: {{ template "__dashboardurl" . }} -{{ end -}} -👀 Prometheus: {{ template "__prometheusurl" . }} - ---- - -{{ if not (index .Alerts 0).Annotations.opsrecipe }}⚠️ There is no **runbook** for this alert, time to get your pen.{{- end }} -{{ if not (index .Alerts 0).Annotations.dashboard }}⚠️ There is no **dashboard** for this alert, time to sketch.{{- end }} -{{- end }} - -# This builds the silence URL. We exclude the alertname in the range -# to avoid the issue of having trailing comma separator (%2C) at the end -# of the generated URL -{{ define "__alert_silence_link" -}} - {{ .ExternalURL }}/#/silences/new?filter=%7B - {{- range .CommonLabels.SortedPairs -}} - {{- if ne .Name "alertname" -}} - {{- .Name }}%3D"{{- .Value -}}"%2C%20 - {{- end -}} - {{- end -}} - alertname%3D"{{ .CommonLabels.alertname }}"%7D -{{- end }} - -# Link to related PMs -{{ define "__alert_linked_postmortems" -}} -https://github.com/giantswarm/giantswarm/issues?q=is%3Aissue+is%3Aopen+label%3Apostmortem+label%3Aalert%2F{{ .CommonLabels.alertname }} -{{- end }} diff --git a/service/controller/resource/alerting/alertmanagerwiring/test/vintage/case-4-azure-v18.golden b/service/controller/resource/alerting/alertmanagerwiring/test/vintage/case-4-azure-v18.golden deleted file mode 100644 index 423d6dbad..000000000 --- a/service/controller/resource/alerting/alertmanagerwiring/test/vintage/case-4-azure-v18.golden +++ /dev/null @@ -1,6 +0,0 @@ -- static_configs: - - targets: - - alertmanager-operated.monitoring.svc:9093 - scheme: http - timeout: 10s - api_version: v2 diff --git a/service/controller/resource/alerting/heartbeatwebhookconfig/test/vintage/case-4-azure-v18.golden b/service/controller/resource/alerting/heartbeatwebhookconfig/test/vintage/case-4-azure-v18.golden deleted file mode 100644 index b3f219c58..000000000 --- a/service/controller/resource/alerting/heartbeatwebhookconfig/test/vintage/case-4-azure-v18.golden +++ /dev/null @@ -1,32 +0,0 @@ -metadata: - creationTimestamp: null - labels: - app.kubernetes.io/instance: alertmanager - app.kubernetes.io/managed-by: prometheus-meta-operator - app.kubernetes.io/name: alertmanager - name: foo - namespace: monitoring -spec: - receivers: - - name: heartbeat_test-installation_foo - webhookConfigs: - - httpConfig: - authorization: - credentials: - key: opsGenieApiKey - name: alertmanager-global - type: GenieKey - sendResolved: false - url: https://api.opsgenie.com/v2/heartbeats/test-installation-foo/ping - route: - groupInterval: 30s - groupWait: 30s - matchers: - - name: cluster_id - value: foo - - name: installation - value: test-installation - - name: type - value: heartbeat - receiver: heartbeat_test-installation_foo - repeatInterval: 15m diff --git a/service/controller/resource/monitoring/ingress/test/default/vintage/case-4-azure-v18.golden b/service/controller/resource/monitoring/ingress/test/default/vintage/case-4-azure-v18.golden deleted file mode 100644 index a6ded9353..000000000 --- a/service/controller/resource/monitoring/ingress/test/default/vintage/case-4-azure-v18.golden +++ /dev/null @@ -1,29 +0,0 @@ -apiVersion: v1 -kind: Ingress -metadata: - annotations: - nginx.ingress.kubernetes.io/auth-signin: https://$host/oauth2/start?rd=$escaped_request_uri - nginx.ingress.kubernetes.io/auth-url: https://$host/oauth2/auth - creationTimestamp: null - labels: - app.kubernetes.io/instance: foo - app.kubernetes.io/managed-by: prometheus-meta-operator - app.kubernetes.io/name: prometheus - giantswarm.io/cluster: foo - name: prometheus-foo - namespace: foo-prometheus -spec: - ingressClassName: nginx - rules: - - host: prometheus - http: - paths: - - backend: - service: - name: prometheus-operated - port: - number: 9090 - path: /foo - pathType: ImplementationSpecific -status: - loadBalancer: {} diff --git a/service/controller/resource/monitoring/ingress/test/externaldns-with-restricted-access/vintage/case-4-azure-v18.golden b/service/controller/resource/monitoring/ingress/test/externaldns-with-restricted-access/vintage/case-4-azure-v18.golden deleted file mode 100644 index b7e8c632f..000000000 --- a/service/controller/resource/monitoring/ingress/test/externaldns-with-restricted-access/vintage/case-4-azure-v18.golden +++ /dev/null @@ -1,32 +0,0 @@ -apiVersion: v1 -kind: Ingress -metadata: - annotations: - external-dns.alpha.kubernetes.io/hostname: prometheus.3lkdj.test.gigantic.io - giantswarm.io/external-dns: managed - nginx.ingress.kubernetes.io/auth-signin: https://$host/oauth2/start?rd=$escaped_request_uri - nginx.ingress.kubernetes.io/auth-url: https://$host/oauth2/auth - nginx.ingress.kubernetes.io/whitelist-source-range: 21.10.178/24 - creationTimestamp: null - labels: - app.kubernetes.io/instance: foo - app.kubernetes.io/managed-by: prometheus-meta-operator - app.kubernetes.io/name: prometheus - giantswarm.io/cluster: foo - name: prometheus-foo - namespace: foo-prometheus -spec: - ingressClassName: nginx - rules: - - host: prometheus.3lkdj.test.gigantic.io - http: - paths: - - backend: - service: - name: prometheus-operated - port: - number: 9090 - path: /foo - pathType: ImplementationSpecific -status: - loadBalancer: {} diff --git a/service/controller/resource/monitoring/ingress/test/externaldns/vintage/case-4-azure-v18.golden b/service/controller/resource/monitoring/ingress/test/externaldns/vintage/case-4-azure-v18.golden deleted file mode 100644 index a7cf784f0..000000000 --- a/service/controller/resource/monitoring/ingress/test/externaldns/vintage/case-4-azure-v18.golden +++ /dev/null @@ -1,31 +0,0 @@ -apiVersion: v1 -kind: Ingress -metadata: - annotations: - external-dns.alpha.kubernetes.io/hostname: prometheus - giantswarm.io/external-dns: managed - nginx.ingress.kubernetes.io/auth-signin: https://$host/oauth2/start?rd=$escaped_request_uri - nginx.ingress.kubernetes.io/auth-url: https://$host/oauth2/auth - creationTimestamp: null - labels: - app.kubernetes.io/instance: foo - app.kubernetes.io/managed-by: prometheus-meta-operator - app.kubernetes.io/name: prometheus - giantswarm.io/cluster: foo - name: prometheus-foo - namespace: foo-prometheus -spec: - ingressClassName: nginx - rules: - - host: prometheus - http: - paths: - - backend: - service: - name: prometheus-operated - port: - number: 9090 - path: /foo - pathType: ImplementationSpecific -status: - loadBalancer: {} diff --git a/service/controller/resource/monitoring/ingress/test/restricted-access/vintage/case-4-azure-v18.golden b/service/controller/resource/monitoring/ingress/test/restricted-access/vintage/case-4-azure-v18.golden deleted file mode 100644 index 0a6927223..000000000 --- a/service/controller/resource/monitoring/ingress/test/restricted-access/vintage/case-4-azure-v18.golden +++ /dev/null @@ -1,30 +0,0 @@ -apiVersion: v1 -kind: Ingress -metadata: - annotations: - nginx.ingress.kubernetes.io/auth-signin: https://$host/oauth2/start?rd=$escaped_request_uri - nginx.ingress.kubernetes.io/auth-url: https://$host/oauth2/auth - nginx.ingress.kubernetes.io/whitelist-source-range: 21.10.178/24 - creationTimestamp: null - labels: - app.kubernetes.io/instance: foo - app.kubernetes.io/managed-by: prometheus-meta-operator - app.kubernetes.io/name: prometheus - giantswarm.io/cluster: foo - name: prometheus-foo - namespace: foo-prometheus -spec: - ingressClassName: nginx - rules: - - host: prometheus - http: - paths: - - backend: - service: - name: prometheus-operated - port: - number: 9090 - path: /foo - pathType: ImplementationSpecific -status: - loadBalancer: {} diff --git a/service/controller/resource/monitoring/prometheus/test/classic/vintage/case-4-azure-v18.golden b/service/controller/resource/monitoring/prometheus/test/classic/vintage/case-4-azure-v18.golden deleted file mode 100644 index 3a199121e..000000000 --- a/service/controller/resource/monitoring/prometheus/test/classic/vintage/case-4-azure-v18.golden +++ /dev/null @@ -1,125 +0,0 @@ -metadata: - creationTimestamp: null - labels: - app.kubernetes.io/instance: foo - app.kubernetes.io/managed-by: prometheus-meta-operator - app.kubernetes.io/name: prometheus - giantswarm.io/cluster: foo - name: foo - namespace: foo-prometheus -spec: - additionalAlertManagerConfigs: - key: alertmanager-additional.yaml - name: alertmanager-config - additionalScrapeConfigs: - key: prometheus-additional.yaml - name: additional-scrape-configs - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: node-role.kubernetes.io/control-plane - operator: DoesNotExist - apiserverConfig: - authorization: - credentialsFile: /etc/prometheus/secrets/cluster-certificates/token - host: https://master.foo:443 - tlsConfig: - ca: {} - caFile: /etc/prometheus/secrets/cluster-certificates/ca - cert: {} - arbitraryFSAccessThroughSMs: {} - enableRemoteWriteReceiver: true - evaluationInterval: 60s - externalLabels: - cluster_id: foo - cluster_type: workload_cluster - customer: Giant Swarm - installation: test-installation - pipeline: testing - provider: aws - region: onprem - externalUrl: http://prometheus/foo - image: quay.io/giantswarm/prometheus:v2.28.1 - keepDroppedTargets: 5 - logLevel: debug - podMetadata: - labels: - app.kubernetes.io/instance: foo - app.kubernetes.io/managed-by: prometheus-meta-operator - app.kubernetes.io/name: prometheus - giantswarm.io/cluster: foo - giantswarm.io/monitoring: "true" - priorityClassName: prometheus - replicas: 1 - resources: - limits: - cpu: 150m - memory: "1073741824" - requests: - cpu: 100m - memory: "1073741824" - retentionSize: 85GiB - routePrefix: /foo - ruleNamespaceSelector: - matchExpressions: - - key: kubernetes.io/metadata.name - operator: Exists - ruleSelector: - matchExpressions: - - key: cluster_type - operator: NotIn - values: - - management_cluster - - key: application.giantswarm.io/team - operator: Exists - rules: - alert: {} - scrapeInterval: 60s - secrets: - - cluster-certificates - securityContext: - fsGroup: 2000 - runAsGroup: 65534 - runAsNonRoot: true - runAsUser: 1000 - seccompProfile: - type: RuntimeDefault - serviceMonitorNamespaceSelector: - matchExpressions: - - key: nonexistentkey - operator: Exists - serviceMonitorSelector: - matchExpressions: - - key: nonexistentkey - operator: Exists - shards: 1 - storage: - volumeClaimTemplate: - metadata: {} - spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 100Gi - status: {} - topologySpreadConstraints: - - labelSelector: - matchLabels: - app.kubernetes.io/name: prometheus - maxSkew: 1 - topologyKey: kubernetes.io/hostname - whenUnsatisfiable: ScheduleAnyway - tsdb: {} - version: v2.28.1 - walCompression: true - web: - pageTitle: test-installation/foo Prometheus -status: - availableReplicas: 0 - paused: false - replicas: 0 - unavailableReplicas: 0 - updatedReplicas: 0 diff --git a/service/controller/resource/monitoring/prometheus/test/mimir-enabled/vintage/case-4-azure-v18.golden b/service/controller/resource/monitoring/prometheus/test/mimir-enabled/vintage/case-4-azure-v18.golden deleted file mode 100644 index d721b411e..000000000 --- a/service/controller/resource/monitoring/prometheus/test/mimir-enabled/vintage/case-4-azure-v18.golden +++ /dev/null @@ -1,112 +0,0 @@ -metadata: - creationTimestamp: null - labels: - app.kubernetes.io/instance: foo - app.kubernetes.io/managed-by: prometheus-meta-operator - app.kubernetes.io/name: prometheus - giantswarm.io/cluster: foo - name: foo - namespace: foo-prometheus -spec: - additionalScrapeConfigs: - key: prometheus-additional.yaml - name: additional-scrape-configs - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: node-role.kubernetes.io/control-plane - operator: DoesNotExist - apiserverConfig: - authorization: - credentialsFile: /etc/prometheus/secrets/cluster-certificates/token - host: https://master.foo:443 - tlsConfig: - ca: {} - caFile: /etc/prometheus/secrets/cluster-certificates/ca - cert: {} - arbitraryFSAccessThroughSMs: {} - enableRemoteWriteReceiver: true - evaluationInterval: 60s - externalLabels: - cluster_id: foo - cluster_type: workload_cluster - customer: Giant Swarm - installation: test-installation - pipeline: testing - provider: aws - region: onprem - externalUrl: http://prometheus/foo - image: quay.io/giantswarm/prometheus:v2.28.1 - keepDroppedTargets: 5 - logLevel: debug - podMetadata: - labels: - app.kubernetes.io/instance: foo - app.kubernetes.io/managed-by: prometheus-meta-operator - app.kubernetes.io/name: prometheus - giantswarm.io/cluster: foo - giantswarm.io/monitoring: "true" - priorityClassName: prometheus - prometheusExternalLabelName: "" - replicaExternalLabelName: "" - replicas: 1 - resources: - limits: - cpu: 150m - memory: "1073741824" - requests: - cpu: 100m - memory: "1073741824" - retentionSize: 85GiB - routePrefix: /foo - rules: - alert: {} - scrapeInterval: 60s - secrets: - - cluster-certificates - securityContext: - fsGroup: 2000 - runAsGroup: 65534 - runAsNonRoot: true - runAsUser: 1000 - seccompProfile: - type: RuntimeDefault - serviceMonitorNamespaceSelector: - matchExpressions: - - key: nonexistentkey - operator: Exists - serviceMonitorSelector: - matchExpressions: - - key: nonexistentkey - operator: Exists - shards: 1 - storage: - volumeClaimTemplate: - metadata: {} - spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 100Gi - status: {} - topologySpreadConstraints: - - labelSelector: - matchLabels: - app.kubernetes.io/name: prometheus - maxSkew: 1 - topologyKey: kubernetes.io/hostname - whenUnsatisfiable: ScheduleAnyway - tsdb: {} - version: v2.28.1 - walCompression: true - web: - pageTitle: test-installation/foo Prometheus -status: - availableReplicas: 0 - paused: false - replicas: 0 - unavailableReplicas: 0 - updatedReplicas: 0 diff --git a/service/controller/resource/monitoring/remotewriteingress/test/default/vintage/case-4-azure-v18.golden b/service/controller/resource/monitoring/remotewriteingress/test/default/vintage/case-4-azure-v18.golden deleted file mode 100644 index a564d8650..000000000 --- a/service/controller/resource/monitoring/remotewriteingress/test/default/vintage/case-4-azure-v18.golden +++ /dev/null @@ -1,32 +0,0 @@ -apiVersion: v1 -kind: Ingress -metadata: - annotations: - nginx.ingress.kubernetes.io/auth-realm: Authentication Required - nginx.ingress.kubernetes.io/auth-secret: remote-write-ingress-auth - nginx.ingress.kubernetes.io/auth-type: basic - nginx.ingress.kubernetes.io/client-body-buffer-size: 50m - nginx.ingress.kubernetes.io/proxy-body-size: 50m - creationTimestamp: null - labels: - app.kubernetes.io/instance: foo - app.kubernetes.io/managed-by: prometheus-meta-operator - app.kubernetes.io/name: prometheus - giantswarm.io/cluster: foo - name: prometheus-foo-remote-write - namespace: foo-prometheus -spec: - ingressClassName: nginx - rules: - - host: prometheus - http: - paths: - - backend: - service: - name: prometheus-operated - port: - number: 9090 - path: /foo/api/v1/write - pathType: ImplementationSpecific -status: - loadBalancer: {} diff --git a/service/controller/resource/monitoring/remotewriteingress/test/externaldns/vintage/case-4-azure-v18.golden b/service/controller/resource/monitoring/remotewriteingress/test/externaldns/vintage/case-4-azure-v18.golden deleted file mode 100644 index 6d4221035..000000000 --- a/service/controller/resource/monitoring/remotewriteingress/test/externaldns/vintage/case-4-azure-v18.golden +++ /dev/null @@ -1,34 +0,0 @@ -apiVersion: v1 -kind: Ingress -metadata: - annotations: - external-dns.alpha.kubernetes.io/hostname: prometheus - giantswarm.io/external-dns: managed - nginx.ingress.kubernetes.io/auth-realm: Authentication Required - nginx.ingress.kubernetes.io/auth-secret: remote-write-ingress-auth - nginx.ingress.kubernetes.io/auth-type: basic - nginx.ingress.kubernetes.io/client-body-buffer-size: 50m - nginx.ingress.kubernetes.io/proxy-body-size: 50m - creationTimestamp: null - labels: - app.kubernetes.io/instance: foo - app.kubernetes.io/managed-by: prometheus-meta-operator - app.kubernetes.io/name: prometheus - giantswarm.io/cluster: foo - name: prometheus-foo-remote-write - namespace: foo-prometheus -spec: - ingressClassName: nginx - rules: - - host: prometheus - http: - paths: - - backend: - service: - name: prometheus-operated - port: - number: 9090 - path: /foo/api/v1/write - pathType: ImplementationSpecific -status: - loadBalancer: {} diff --git a/service/controller/resource/monitoring/scrapeconfigs/resource_test.go b/service/controller/resource/monitoring/scrapeconfigs/resource_test.go index 79fad0a6f..131dd6dcb 100644 --- a/service/controller/resource/monitoring/scrapeconfigs/resource_test.go +++ b/service/controller/resource/monitoring/scrapeconfigs/resource_test.go @@ -155,114 +155,6 @@ func TestAWSScrapeconfigs(t *testing.T) { } } -func TestAzureScrapeconfigs(t *testing.T) { - var err error - var logger micrologger.Logger - { - c := micrologger.Config{} - - logger, err = micrologger.New(c) - if err != nil { - t.Fatal(err) - } - } - - var testFunc unittest.TestFunc - { - path := path.Join(unittest.ProjectRoot(), templatePath) - - var client client.Client - { - schemeBuilder := runtime.SchemeBuilder(k8sclient.SchemeBuilder{ - apiextensionsv1.AddToScheme, - appsv1alpha1.AddToScheme, - }) - - err := schemeBuilder.AddToScheme(scheme.Scheme) - if err != nil { - t.Fatal(err) - } - - client = fake.NewClientBuilder(). - WithScheme(scheme.Scheme). - WithRuntimeObjects(). - Build() - } - - testFunc = func(v interface{}) (interface{}, error) { - testCluster, err := key.ToCluster(v) - if err != nil { - t.Fatal(err) - } - var secret runtime.Object - { - secret = &corev1.Secret{ - ObjectMeta: metav1.ObjectMeta{ - Name: "cluster-certificates", - Namespace: key.Namespace(testCluster), - }, - Data: map[string][]byte{ - "crt": []byte("crt"), - "key": []byte("key"), - }, - } - } - - var k8sClient k8sclient.Interface - { - c := k8sclient.ClientsConfig{ - Logger: logger, - SchemeBuilder: k8sclient.SchemeBuilder(corev1.SchemeBuilder), - } - k8sClient, err = fakek8sclient.NewClients(c, secret) - if err != nil { - t.Fatal(err) - } - } - - config := Config{ - TemplatePath: path, - OrganizationReader: FakeReader{}, - Provider: cluster.Provider{ - Kind: "azure", - Flavor: "vintage", - }, - Pipeline: "test-pipeline", - Region: "eu-central-1", - Customer: "pmo", - K8sClient: k8sClient, - Vault: "vault1.some-installation.test", - Installation: "test-installation", - Logger: logger, - } - return toData(context.Background(), client, v, config) - } - } - - outputDir, err := filepath.Abs("./test/azure") - if err != nil { - t.Fatal(err) - } - - c := unittest.Config{ - Flavor: "vintage", - OutputDir: outputDir, - T: t, - TestFunc: testFunc, - TestFuncReturnsBytes: true, - Update: *update, - } - runner, err := unittest.NewRunner(c) - if err != nil { - t.Fatal(err) - } - - err = runner.Run() - if err != nil { - t.Fatal(err) - } -} - func TestCAPZScrapeconfigs(t *testing.T) { var err error var logger micrologger.Logger diff --git a/service/controller/resource/monitoring/scrapeconfigs/test/aws/case-1-vintage-mc.golden b/service/controller/resource/monitoring/scrapeconfigs/test/aws/case-1-vintage-mc.golden index 25b7e9e76..ed8a8617c 100644 --- a/service/controller/resource/monitoring/scrapeconfigs/test/aws/case-1-vintage-mc.golden +++ b/service/controller/resource/monitoring/scrapeconfigs/test/aws/case-1-vintage-mc.golden @@ -985,12 +985,6 @@ target_label: nodepool replacement: ${1} action: replace - # Override with label for Azure clusters if exists. - - source_labels: [app,label_giantswarm_io_machine_pool] - regex: kube-state-metrics;(.+) - target_label: nodepool - replacement: ${1} - action: replace - action: labeldrop regex: label_giantswarm_io_machine_pool|label_giantswarm_io_machine_deployment # cert-operator (missing label) (versionned so it needs to be kept) diff --git a/service/controller/resource/monitoring/scrapeconfigs/test/aws/case-2-aws-v16.golden b/service/controller/resource/monitoring/scrapeconfigs/test/aws/case-2-aws-v16.golden index 54866bc86..e4754aa4c 100644 --- a/service/controller/resource/monitoring/scrapeconfigs/test/aws/case-2-aws-v16.golden +++ b/service/controller/resource/monitoring/scrapeconfigs/test/aws/case-2-aws-v16.golden @@ -1043,12 +1043,6 @@ target_label: nodepool replacement: ${1} action: replace - # Override with label for Azure clusters if exists. - - source_labels: [app,label_giantswarm_io_machine_pool] - regex: kube-state-metrics;(.+) - target_label: nodepool - replacement: ${1} - action: replace - action: labeldrop regex: label_giantswarm_io_machine_pool|label_giantswarm_io_machine_deployment # prometheus diff --git a/service/controller/resource/monitoring/scrapeconfigs/test/aws/case-3-aws-v18.golden b/service/controller/resource/monitoring/scrapeconfigs/test/aws/case-3-aws-v18.golden index 2b2f68918..c8dff83d7 100644 --- a/service/controller/resource/monitoring/scrapeconfigs/test/aws/case-3-aws-v18.golden +++ b/service/controller/resource/monitoring/scrapeconfigs/test/aws/case-3-aws-v18.golden @@ -865,12 +865,6 @@ target_label: nodepool replacement: ${1} action: replace - # Override with label for Azure clusters if exists. - - source_labels: [app,label_giantswarm_io_machine_pool] - regex: kube-state-metrics;(.+) - target_label: nodepool - replacement: ${1} - action: replace - action: labeldrop regex: label_giantswarm_io_machine_pool|label_giantswarm_io_machine_deployment # prometheus diff --git a/service/controller/resource/monitoring/scrapeconfigs/test/aws/case-4-azure-v18.golden b/service/controller/resource/monitoring/scrapeconfigs/test/aws/case-4-azure-v18.golden deleted file mode 100644 index ed3e63b63..000000000 --- a/service/controller/resource/monitoring/scrapeconfigs/test/aws/case-4-azure-v18.golden +++ /dev/null @@ -1,912 +0,0 @@ -- job_name: foo-prometheus/kubernetes-apiserver-foo/0 - honor_labels: true - scheme: https - kubernetes_sd_configs: - - role: endpoints - api_server: https://master.foo:443 - bearer_token_file: /etc/prometheus/secrets/cluster-certificates/token - tls_config: - ca_file: /etc/prometheus/secrets/cluster-certificates/ca - insecure_skip_verify: false - bearer_token_file: /etc/prometheus/secrets/cluster-certificates/token - tls_config: - ca_file: /etc/prometheus/secrets/cluster-certificates/ca - insecure_skip_verify: true - relabel_configs: - - source_labels: [__meta_kubernetes_service_label_component] - regex: apiserver - action: keep - - source_labels: [__meta_kubernetes_endpoint_port_name] - regex: https - action: keep - - target_label: app - replacement: kubernetes - # Add cluster_id label. - - target_label: cluster_id - replacement: foo - # Add cluster_type label. - - target_label: cluster_type - replacement: workload_cluster - # Add customer label. - - target_label: customer - replacement: pmo - # Add installation label. - - target_label: installation - replacement: test-installation - # Add organization label. - - target_label: organization - replacement: my-organization - # Add pipeline label. - - target_label: pipeline - replacement: test-pipeline - # Add provider label. - - target_label: provider - replacement: aws - # Add provider label. - - target_label: region - replacement: eu-central-1 - # Add priority label. - - target_label: service_priority - replacement: medium - # Add role label. - - source_labels: [__meta_kubernetes_node_label_role] - target_label: role -# Add scrape configuration for docker -- job_name: foo-prometheus/docker-foo/0 - honor_labels: true - scheme: https - kubernetes_sd_configs: - - role: node - api_server: https://master.foo:443 - bearer_token_file: /etc/prometheus/secrets/cluster-certificates/token - tls_config: - ca_file: /etc/prometheus/secrets/cluster-certificates/ca - insecure_skip_verify: false - bearer_token_file: /etc/prometheus/secrets/cluster-certificates/token - tls_config: - ca_file: /etc/prometheus/secrets/cluster-certificates/ca - insecure_skip_verify: false - relabel_configs: - - target_label: __address__ - replacement: master.foo:443 - - source_labels: [__meta_kubernetes_node_name] - target_label: __metrics_path__ - replacement: /api/v1/nodes/${1}:9323/proxy/metrics - - target_label: app - replacement: docker - - source_labels: [__meta_kubernetes_node_address_InternalIP] - replacement: ${1}:9323 - target_label: instance - # Add cluster_id label. - - target_label: cluster_id - replacement: foo - # Add cluster_type label. - - target_label: cluster_type - replacement: workload_cluster - # Add customer label. - - target_label: customer - replacement: pmo - # Add installation label. - - target_label: installation - replacement: test-installation - # Add organization label. - - target_label: organization - replacement: my-organization - # Add pipeline label. - - target_label: pipeline - replacement: test-pipeline - # Add provider label. - - target_label: provider - replacement: aws - # Add provider label. - - target_label: region - replacement: eu-central-1 - # Add priority label. - - target_label: service_priority - replacement: medium - # Add role label. - - source_labels: [__meta_kubernetes_node_label_role] - target_label: role - metric_relabel_configs: - - source_labels: [__name__] - regex: (engine_daemon_image_actions_seconds_count|process_virtual_memory_bytes|process_resident_memory_bytes) - action: keep -# Add kubelet configuration -- job_name: foo-prometheus/kubelet-foo/0 - honor_labels: true - scheme: https - kubernetes_sd_configs: - - role: node - api_server: https://master.foo:443 - bearer_token_file: /etc/prometheus/secrets/cluster-certificates/token - tls_config: - ca_file: /etc/prometheus/secrets/cluster-certificates/ca - insecure_skip_verify: false - bearer_token_file: /etc/prometheus/secrets/cluster-certificates/token - tls_config: - ca_file: /etc/prometheus/secrets/cluster-certificates/ca - insecure_skip_verify: true - relabel_configs: - - target_label: app - replacement: kubelet - - source_labels: [__address__] - target_label: instance - - target_label: __address__ - replacement: master.foo:443 - - source_labels: [__meta_kubernetes_node_name] - target_label: __metrics_path__ - replacement: /api/v1/nodes/${1}:10250/proxy/metrics - - source_labels: [__meta_kubernetes_node_name] - target_label: node - # Add cluster_id label. - - target_label: cluster_id - replacement: foo - # Add cluster_type label. - - target_label: cluster_type - replacement: workload_cluster - # Add customer label. - - target_label: customer - replacement: pmo - # Add installation label. - - target_label: installation - replacement: test-installation - # Add organization label. - - target_label: organization - replacement: my-organization - # Add pipeline label. - - target_label: pipeline - replacement: test-pipeline - # Add provider label. - - target_label: provider - replacement: aws - # Add provider label. - - target_label: region - replacement: eu-central-1 - # Add priority label. - - target_label: service_priority - replacement: medium - # Add role label. - - source_labels: [__meta_kubernetes_node_label_role] - target_label: role - metric_relabel_configs: - # drop unused rest client metrics - - source_labels: [__name__] - regex: rest_client_(rate_limiter_duration_seconds_bucket|request_size_bytes_bucket|response_size_bytes_bucket) - action: drop - # drop uid label from kubelet - - action: labeldrop - regex: uid -# Add scrape configuration for cadvisor -- job_name: foo-prometheus/cadvisor-foo/0 - honor_labels: true - scheme: https - kubernetes_sd_configs: - - role: node - api_server: https://master.foo:443 - bearer_token_file: /etc/prometheus/secrets/cluster-certificates/token - tls_config: - ca_file: /etc/prometheus/secrets/cluster-certificates/ca - insecure_skip_verify: false - bearer_token_file: /etc/prometheus/secrets/cluster-certificates/token - tls_config: - ca_file: /etc/prometheus/secrets/cluster-certificates/ca - insecure_skip_verify: false - relabel_configs: - - source_labels: [__address__] - target_label: instance - - target_label: __address__ - replacement: master.foo:443 - - source_labels: [__meta_kubernetes_node_name] - target_label: __metrics_path__ - replacement: /api/v1/nodes/${1}:10250/proxy/metrics/cadvisor - - target_label: app - replacement: cadvisor - # Add node name. - - source_labels: [__meta_kubernetes_node_label_kubernetes_io_hostname] - target_label: node - # Add cluster_id label. - - target_label: cluster_id - replacement: foo - # Add cluster_type label. - - target_label: cluster_type - replacement: workload_cluster - # Add customer label. - - target_label: customer - replacement: pmo - # Add installation label. - - target_label: installation - replacement: test-installation - # Add organization label. - - target_label: organization - replacement: my-organization - # Add pipeline label. - - target_label: pipeline - replacement: test-pipeline - # Add provider label. - - target_label: provider - replacement: aws - # Add provider label. - - target_label: region - replacement: eu-central-1 - # Add priority label. - - target_label: service_priority - replacement: medium - # Add role label. - - source_labels: [__meta_kubernetes_node_label_role] - target_label: role - metric_relabel_configs: - # drop id and name labels from cAdvisor as they do not provide value but use a lot of RAM - - action: labeldrop - regex: id|name - # dropping explained here https://github.com/giantswarm/giantswarm/issues/26361 - - source_labels: [__name__] - regex: container_(blkio_device_usage_total|network_transmit_errors_total|network_receive_errors_total|tasks_state|memory_failures_total|memory_max_usage_bytes|cpu_load_average_10s|memory_failcnt|cpu_system_seconds_total) - action: drop - - source_labels: [namespace] - regex: (kube-system|giantswarm.*|kong.*|kyverno) - action: keep -# calico-node -- job_name: foo-prometheus/calico-node-foo/0 - honor_labels: true - scheme: https - kubernetes_sd_configs: - - role: pod - api_server: https://master.foo:443 - bearer_token_file: /etc/prometheus/secrets/cluster-certificates/token - tls_config: - ca_file: /etc/prometheus/secrets/cluster-certificates/ca - insecure_skip_verify: false - bearer_token_file: /etc/prometheus/secrets/cluster-certificates/token - tls_config: - ca_file: /etc/prometheus/secrets/cluster-certificates/ca - insecure_skip_verify: false - relabel_configs: - - source_labels: [__address__] - replacement: ${1}:9091 - target_label: instance - - target_label: __address__ - replacement: master.foo:443 - - source_labels: [__meta_kubernetes_pod_name] - regex: (calico-node.*) - target_label: __metrics_path__ - replacement: /api/v1/namespaces/kube-system/pods/${1}:9091/proxy/metrics - - source_labels: [__meta_kubernetes_namespace, __meta_kubernetes_pod_name] - regex: kube-system;calico-node.* - action: keep - - source_labels: [__meta_kubernetes_pod_container_name] - target_label: app - # Add namespace label. - - source_labels: [__meta_kubernetes_namespace] - target_label: namespace - # Add pod label. - - source_labels: [__meta_kubernetes_pod_name] - target_label: pod - # Add container label. - - source_labels: [__meta_kubernetes_pod_container_name] - target_label: container - # Add node label. - - source_labels: [__meta_kubernetes_pod_node_name] - target_label: node - # Add role label. - - source_labels: [__meta_kubernetes_node_label_role] - target_label: role - # Add cluster_id label. - - target_label: cluster_id - replacement: foo - # Add cluster_type label. - - target_label: cluster_type - replacement: workload_cluster - # Add customer label. - - target_label: customer - replacement: pmo - # Add installation label. - - target_label: installation - replacement: test-installation - # Add organization label. - - target_label: organization - replacement: my-organization - # Add pipeline label. - - target_label: pipeline - replacement: test-pipeline - # Add provider label. - - target_label: provider - replacement: aws - # Add provider label. - - target_label: region - replacement: eu-central-1 - # Add priority label. - - target_label: service_priority - replacement: medium -# Add etcd configuration -- job_name: foo-prometheus/etcd-foo/0 - honor_labels: true - scheme: https - kubernetes_sd_configs: - - role: node - api_server: https://master.foo:443 - bearer_token_file: /etc/prometheus/secrets/cluster-certificates/token - tls_config: - ca_file: /etc/prometheus/secrets/cluster-certificates/ca - insecure_skip_verify: false - tls_config: - ca_file: /etc/prometheus/secrets/cluster-certificates/ca - cert_file: /etc/prometheus/secrets/cluster-certificates/crt - key_file: /etc/prometheus/secrets/cluster-certificates/key - insecure_skip_verify: true - relabel_configs: - - source_labels: [__meta_kubernetes_node_label_role] - regex: control-plane|master - action: keep - # by default use node address - - source_labels: [__address__] - regex: (.*):10250 - target_label: __address__ - replacement: ${1}:2379 - action: replace - - target_label: app - replacement: etcd - - source_labels: [__address__] - target_label: instance - # Add ip label. - - target_label: ip - source_labels: [__meta_kubernetes_node_address_InternalIP] - # Add cluster_id label. - - target_label: cluster_id - replacement: foo - # Add cluster_type label. - - target_label: cluster_type - replacement: workload_cluster - # Add customer label. - - target_label: customer - replacement: pmo - # Add installation label. - - target_label: installation - replacement: test-installation - # Add organization label. - - target_label: organization - replacement: my-organization - # Add pipeline label. - - target_label: pipeline - replacement: test-pipeline - # Add provider label. - - target_label: provider - replacement: aws - # Add provider label. - - target_label: region - replacement: eu-central-1 - # Add priority label. - - target_label: service_priority - replacement: medium - # Add role label. - - source_labels: [__meta_kubernetes_node_label_role] - target_label: role -# kube-proxy -- job_name: foo-prometheus/kube-proxy-foo/0 - honor_labels: true - scheme: https - kubernetes_sd_configs: - - role: pod - namespaces: - names: - - kube-system - api_server: https://master.foo:443 - bearer_token_file: /etc/prometheus/secrets/cluster-certificates/token - tls_config: - ca_file: /etc/prometheus/secrets/cluster-certificates/ca - insecure_skip_verify: false - bearer_token_file: /etc/prometheus/secrets/cluster-certificates/token - tls_config: - ca_file: /etc/prometheus/secrets/cluster-certificates/ca - insecure_skip_verify: true - relabel_configs: - - source_labels: [__address__] - replacement: $1:10249 - target_label: instance - - source_labels: [__meta_kubernetes_pod_name] - regex: (kube-proxy.*) - action: keep - - target_label: __address__ - replacement: master.foo:443 - - source_labels: [__meta_kubernetes_pod_name] - regex: (kube-proxy.*) - target_label: __metrics_path__ - replacement: /api/v1/namespaces/kube-system/pods/${1}:10249/proxy/metrics - - target_label: app - replacement: kube-proxy - # Add namespace label. - - source_labels: [__meta_kubernetes_namespace] - target_label: namespace - # Add pod label. - - source_labels: [__meta_kubernetes_pod_name] - target_label: pod - # Add container label. - - source_labels: [__meta_kubernetes_pod_container_name] - target_label: container - # Add node label. - - source_labels: [__meta_kubernetes_pod_node_name] - target_label: node - # Add role label. - - source_labels: [__meta_kubernetes_node_label_role] - target_label: role - # Add cluster_id label. - - target_label: cluster_id - replacement: foo - # Add cluster_type label. - - target_label: cluster_type - replacement: workload_cluster - # Add customer label. - - target_label: customer - replacement: pmo - # Add installation label. - - target_label: installation - replacement: test-installation - # Add organization label. - - target_label: organization - replacement: my-organization - # Add pipeline label. - - target_label: pipeline - replacement: test-pipeline - # Add provider label. - - target_label: provider - replacement: aws - # Add provider label. - - target_label: region - replacement: eu-central-1 - # Add priority label. - - target_label: service_priority - replacement: medium - metric_relabel_configs: - # drop unused rest client metrics - - source_labels: [__name__] - regex: rest_client_(rate_limiter_duration_seconds_bucket|request_size_bytes_bucket|response_size_bytes_bucket) - action: drop -# coredns -- job_name: foo-prometheus/coredns-foo/0 - honor_labels: true - scheme: https - kubernetes_sd_configs: - - role: endpoints - namespaces: - names: - - kube-system - api_server: https://master.foo:443 - bearer_token_file: /etc/prometheus/secrets/cluster-certificates/token - tls_config: - ca_file: /etc/prometheus/secrets/cluster-certificates/ca - insecure_skip_verify: false - bearer_token_file: /etc/prometheus/secrets/cluster-certificates/token - tls_config: - ca_file: /etc/prometheus/secrets/cluster-certificates/ca - insecure_skip_verify: true - relabel_configs: - - source_labels: [__address__] - target_label: instance - - source_labels: [__meta_kubernetes_pod_container_name] - regex: coredns - action: keep - - target_label: __address__ - replacement: master.foo:443 - - source_labels: [__meta_kubernetes_pod_name] - regex: (coredns.*) - target_label: __metrics_path__ - replacement: /api/v1/namespaces/kube-system/pods/${1}:9153/proxy/metrics - - source_labels: [__meta_kubernetes_pod_container_name] - target_label: app - - source_labels: [__meta_kubernetes_service_annotationpresent_giantswarm_io_monitoring, __meta_kubernetes_service_labelpresent_giantswarm_io_monitoring] - regex: .*(true).* - action: drop - # Add namespace label. - - source_labels: [__meta_kubernetes_namespace] - target_label: namespace - # Add pod label. - - source_labels: [__meta_kubernetes_pod_name] - target_label: pod - # Add container label. - - source_labels: [__meta_kubernetes_pod_container_name] - target_label: container - # Add node label. - - source_labels: [__meta_kubernetes_pod_node_name] - target_label: node - # Add role label. - - source_labels: [__meta_kubernetes_node_label_role] - target_label: role - # Add cluster_id label. - - target_label: cluster_id - replacement: foo - # Add cluster_type label. - - target_label: cluster_type - replacement: workload_cluster - # Add customer label. - - target_label: customer - replacement: pmo - # Add installation label. - - target_label: installation - replacement: test-installation - # Add organization label. - - target_label: organization - replacement: my-organization - # Add pipeline label. - - target_label: pipeline - replacement: test-pipeline - # Add provider label. - - target_label: provider - replacement: aws - # Add provider label. - - target_label: region - replacement: eu-central-1 - # Add priority label. - - target_label: service_priority - replacement: medium - metric_relabel_configs: - # drop unused coredns metrics with the highest cardinality as they increase Prometheus memory usage - - source_labels: [__name__] - regex: coredns_dns_(response_size_bytes_bucket|request_size_bytes_bucket) - action: drop -# cert-exporter -- job_name: foo-prometheus/cert-exporter-foo/0 - honor_labels: true - scheme: https - kubernetes_sd_configs: - - role: endpoints - namespaces: - names: - - kube-system - api_server: https://master.foo:443 - bearer_token_file: /etc/prometheus/secrets/cluster-certificates/token - tls_config: - ca_file: /etc/prometheus/secrets/cluster-certificates/ca - insecure_skip_verify: false - bearer_token_file: /etc/prometheus/secrets/cluster-certificates/token - tls_config: - ca_file: /etc/prometheus/secrets/cluster-certificates/ca - insecure_skip_verify: true - relabel_configs: - - source_labels: [__address__] - target_label: instance - - source_labels: [__meta_kubernetes_service_label_app] - regex: cert-exporter - action: keep - - target_label: __address__ - replacement: master.foo:443 - - source_labels: [__meta_kubernetes_pod_name] - regex: (cert-exporter.*) - target_label: __metrics_path__ - replacement: /api/v1/namespaces/kube-system/pods/${1}:9005/proxy/metrics - - source_labels: [__meta_kubernetes_service_label_app] - target_label: app - - source_labels: [__meta_kubernetes_service_annotationpresent_giantswarm_io_monitoring, __meta_kubernetes_service_labelpresent_giantswarm_io_monitoring] - regex: .*(true).* - action: drop - # Add namespace label. - - source_labels: [__meta_kubernetes_namespace] - target_label: namespace - # Add pod label. - - source_labels: [__meta_kubernetes_pod_name] - target_label: pod - # Add container label. - - source_labels: [__meta_kubernetes_pod_container_name] - target_label: container - # Add node label. - - source_labels: [__meta_kubernetes_pod_node_name] - target_label: node - # Add role label. - - source_labels: [__meta_kubernetes_node_label_role] - target_label: role - # Add cluster_id label. - - target_label: cluster_id - replacement: foo - # Add cluster_type label. - - target_label: cluster_type - replacement: workload_cluster - # Add customer label. - - target_label: customer - replacement: pmo - # Add installation label. - - target_label: installation - replacement: test-installation - # Add organization label. - - target_label: organization - replacement: my-organization - # Add pipeline label. - - target_label: pipeline - replacement: test-pipeline - # Add provider label. - - target_label: provider - replacement: aws - # Add provider label. - - target_label: region - replacement: eu-central-1 - # Add priority label. - - target_label: service_priority - replacement: medium -# node-exporter -- job_name: foo-prometheus/node-exporter-foo/0 - honor_labels: true - scheme: https - kubernetes_sd_configs: - - role: pod - api_server: https://master.foo:443 - bearer_token_file: /etc/prometheus/secrets/cluster-certificates/token - tls_config: - ca_file: /etc/prometheus/secrets/cluster-certificates/ca - insecure_skip_verify: false - bearer_token_file: /etc/prometheus/secrets/cluster-certificates/token - tls_config: - ca_file: /etc/prometheus/secrets/cluster-certificates/ca - insecure_skip_verify: true - relabel_configs: - - target_label: __address__ - replacement: master.foo:443 - - source_labels: [__meta_kubernetes_pod_name] - regex: (node-exporter.*) - target_label: __metrics_path__ - replacement: /api/v1/namespaces/kube-system/pods/${1}:10300/proxy/metrics - - source_labels: [__meta_kubernetes_namespace, __meta_kubernetes_pod_name] - regex: kube-system;node-exporter.* - action: keep - - source_labels: [__meta_kubernetes_pod_container_name] - target_label: app - - source_labels: [__meta_kubernetes_pod_annotationpresent_giantswarm_io_monitoring, __meta_kubernetes_pod_labelpresent_giantswarm_io_monitoring] - regex: .*(true).* - action: drop - - source_labels: [__meta_kubernetes_pod_node_name] - target_label: node - # Add cluster_id label. - - target_label: cluster_id - replacement: foo - # Add cluster_type label. - - target_label: cluster_type - replacement: workload_cluster - # Add customer label. - - target_label: customer - replacement: pmo - # Add installation label. - - target_label: installation - replacement: test-installation - # Add organization label. - - target_label: organization - replacement: my-organization - # Add pipeline label. - - target_label: pipeline - replacement: test-pipeline - # Add provider label. - - target_label: provider - replacement: aws - # Add provider label. - - target_label: region - replacement: eu-central-1 - # Add priority label. - - target_label: service_priority - replacement: medium - metric_relabel_configs: - # drop unused metrics with the highest cardinality as they increase Prometheus memory usage - - source_labels: [__name__] - regex: node_(filesystem_files|filesystem_readonly|nfs_requests_total|network_carrier|network_transmit_colls_total|network_carrier_changes_total|network_transmit_packets_total|network_carrier_down_changes_total|network_carrier_up_changes_total|network_iface_id|xfs_.+|ethtool_.+) - action: drop -- job_name: foo-prometheus/workload-foo/0 - honor_labels: true - scheme: https - kubernetes_sd_configs: - - role: endpoints - api_server: https://master.foo:443 - bearer_token_file: /etc/prometheus/secrets/cluster-certificates/token - tls_config: - ca_file: /etc/prometheus/secrets/cluster-certificates/ca - insecure_skip_verify: false - bearer_token_file: /etc/prometheus/secrets/cluster-certificates/token - tls_config: - ca_file: /etc/prometheus/secrets/cluster-certificates/ca - insecure_skip_verify: true - relabel_configs: - - source_labels: [__meta_kubernetes_service_annotationpresent_giantswarm_io_monitoring, __meta_kubernetes_service_labelpresent_giantswarm_io_monitoring] - regex: .*(true).* - action: keep - # if __meta_kubernetes_service_annotation_giantswarm_io_monitoring_path is present, we use it as the metrics path - - source_labels: [__meta_kubernetes_service_annotation_giantswarm_io_monitoring_path] - action: replace - target_label: __metrics_path__ - regex: (.+) - # if __meta_kubernetes_service_annotation_giantswarm_io_monitoring_port, we use it as the metrics port - - source_labels: [__address__, __meta_kubernetes_service_annotation_giantswarm_io_monitoring_port] - action: replace - target_label: __address__ - regex: ([^:]+):(\d+);(\d+) - replacement: $1:$3 - # if the protocol is empty, we set it to http by default, this allows to override the protocol for services using https like prometheus operator - - source_labels: [__address__, __meta_kubernetes_service_annotation_giantswarm_io_monitoring_protocol] - action: replace - target_label: __meta_kubernetes_service_annotation_giantswarm_io_monitoring_protocol - regex: (.*); - replacement: "http" - - source_labels: [__meta_kubernetes_pod_ip, __address__] - regex: (.*);([^:]+):(\d+) - replacement: $1:$3 - target_label: instance - - source_labels: [__meta_kubernetes_namespace, __meta_kubernetes_service_annotation_giantswarm_io_monitoring_protocol, __meta_kubernetes_pod_name, __address__, __metrics_path__] - regex: (.*);(.*);(.*);(.+:)(\d+);(.*) - target_label: __metrics_path__ - replacement: /api/v1/namespaces/${1}/pods/${2}:${3}:${5}/proxy${6} - action: replace - - regex: (.*) - target_label: __address__ - replacement: master.foo:443 - action: replace - - source_labels: [__meta_kubernetes_service_name] - regex: (.*) - target_label: app - action: replace - - source_labels: [__meta_kubernetes_service_annotation_giantswarm_io_monitoring_app_label] - regex: (.+) - target_label: app - action: replace - # Add namespace label. - - source_labels: [__meta_kubernetes_namespace] - target_label: namespace - # Add pod label. - - source_labels: [__meta_kubernetes_pod_name] - target_label: pod - # Add container label. - - source_labels: [__meta_kubernetes_pod_container_name] - target_label: container - # Add node label. - - source_labels: [__meta_kubernetes_pod_node_name] - target_label: node - # Add role label. - - source_labels: [__meta_kubernetes_node_label_role] - target_label: role - # Add cluster_id label. - - target_label: cluster_id - replacement: foo - # Add cluster_type label. - - target_label: cluster_type - replacement: workload_cluster - # Add customer label. - - target_label: customer - replacement: pmo - # Add installation label. - - target_label: installation - replacement: test-installation - # Add organization label. - - target_label: organization - replacement: my-organization - # Add pipeline label. - - target_label: pipeline - replacement: test-pipeline - # Add provider label. - - target_label: provider - replacement: aws - # Add provider label. - - target_label: region - replacement: eu-central-1 - # Add priority label. - - target_label: service_priority - replacement: medium - metric_relabel_configs: - # drop unused nginx metrics with the highest cardinality as they increase Prometheus memory usage - - source_labels: [__name__] - regex: nginx_ingress_controller_(bytes_sent_bucket|request_size_bucket|response_duration_seconds_bucket|response_size_bucket|request_duration_seconds_count|connect_duration_seconds_bucket|header_duration_seconds_bucket|bytes_sent_count|request_duration_seconds_sum|bytes_sent_sum|request_size_count|response_size_count|response_duration_seconds_sum|response_duration_seconds_count|ingress_upstream_latency_seconds|ingress_upstream_latency_seconds_sum|ingress_upstream_latency_seconds_count) - action: drop - # drop unused kong metrics with the highest cardinality as they increase Prometheus memory usage - - source_labels: [__name__] - regex: kong_(upstream_target_health|latency_bucket|latency_count|latency_sum) - action: drop - # drop unused kube-state-metrics metrics with the highest cardinality as they increase Prometheus memory usage - - source_labels: [__name__] - regex: kube_(.+_annotations|secret_type|pod_status_qos_class|pod_tolerations|pod_status_scheduled|replicaset_metadata_generation|replicaset_status_observed_generation|replicaset_annotations|replicaset_status_fully_labeled_replicas|.+_metadata_resource_version) - action: drop - # drop unused promtail/loki metrics - - source_labels: [__name__] - regex: promtail_request_duration_seconds_bucket|loki_request_duration_seconds_bucket - action: drop - # drop unused rest client metrics - - source_labels: [__name__] - regex: rest_client_(rate_limiter_duration_seconds_bucket|request_size_bytes_bucket|response_size_bytes_bucket) - action: drop - # drop image_id label from kube-state-metrics - - source_labels: [app,image_id] - separator: ; - regex: kube-state-metrics;(.+) - replacement: "" - action: replace - target_label: image_id - - source_labels: [app,deployment] - separator: ; - regex: kube-state-metrics;(.+) - target_label: workload_type - replacement: deployment - action: replace - - source_labels: [app,daemonset] - separator: ; - regex: kube-state-metrics;(.+) - target_label: workload_type - replacement: daemonset - action: replace - - source_labels: [app,statefulset] - separator: ; - regex: kube-state-metrics;(.+) - target_label: workload_type - replacement: statefulset - action: replace - - source_labels: [app,deployment] - separator: ; - regex: kube-state-metrics;(.+) - target_label: workload_name - replacement: ${1} - action: replace - - source_labels: [app,daemonset] - separator: ; - regex: kube-state-metrics;(.+) - target_label: workload_name - replacement: ${1} - action: replace - - source_labels: [app,statefulset] - separator: ; - regex: kube-state-metrics;(.+) - target_label: workload_name - replacement: ${1} - action: replace - - source_labels: [app,label_topology_kubernetes_io_region] - separator: ; - regex: kube-state-metrics;(.+) - target_label: region - replacement: ${1} - action: replace - - source_labels: [app,label_topology_kubernetes_io_zone] - separator: ; - regex: kube-state-metrics;(.+) - target_label: zone - replacement: ${1} - action: replace - - action: labeldrop - regex: label_topology_kubernetes_io_region|label_topology_kubernetes_io_zone - # Override with label for AWS clusters if exists. - - source_labels: [app,label_giantswarm_io_machine_deployment] - regex: kube-state-metrics;(.+) - target_label: nodepool - replacement: ${1} - action: replace - # Override with label for Azure clusters if exists. - - source_labels: [app,label_giantswarm_io_machine_pool] - regex: kube-state-metrics;(.+) - target_label: nodepool - replacement: ${1} - action: replace - - action: labeldrop - regex: label_giantswarm_io_machine_pool|label_giantswarm_io_machine_deployment -# prometheus -- job_name: foo-prometheus/prometheus-foo/0 - honor_labels: true - scheme: http - metrics_path: /foo/metrics - static_configs: - - targets: ['localhost:9090'] - relabel_configs: - - replacement: prometheus - target_label: app - # Add cluster_id label. - - target_label: cluster_id - replacement: foo - # Add cluster_type label. - - target_label: cluster_type - replacement: workload_cluster - # Add customer label. - - target_label: customer - replacement: pmo - # Add installation label. - - target_label: installation - replacement: test-installation - # Add organization label. - - target_label: organization - replacement: my-organization - # Add pipeline label. - - target_label: pipeline - replacement: test-pipeline - # Add provider label. - - target_label: provider - replacement: aws - # Add provider label. - - target_label: region - replacement: eu-central-1 - # Add priority label. - - target_label: service_priority - replacement: medium diff --git a/service/controller/resource/monitoring/scrapeconfigs/test/azure/case-4-azure-v18.golden b/service/controller/resource/monitoring/scrapeconfigs/test/azure/case-4-azure-v18.golden deleted file mode 100644 index 43f58171e..000000000 --- a/service/controller/resource/monitoring/scrapeconfigs/test/azure/case-4-azure-v18.golden +++ /dev/null @@ -1,933 +0,0 @@ -- job_name: foo-prometheus/kubernetes-apiserver-foo/0 - honor_labels: true - scheme: https - kubernetes_sd_configs: - - role: endpoints - api_server: https://master.foo:443 - tls_config: - ca_file: /etc/prometheus/secrets/cluster-certificates/ca - cert_file: /etc/prometheus/secrets/cluster-certificates/crt - key_file: /etc/prometheus/secrets/cluster-certificates/key - insecure_skip_verify: false - tls_config: - ca_file: /etc/prometheus/secrets/cluster-certificates/ca - cert_file: /etc/prometheus/secrets/cluster-certificates/crt - key_file: /etc/prometheus/secrets/cluster-certificates/key - insecure_skip_verify: true - relabel_configs: - - source_labels: [__meta_kubernetes_service_label_component] - regex: apiserver - action: keep - - source_labels: [__meta_kubernetes_endpoint_port_name] - regex: https - action: keep - - target_label: app - replacement: kubernetes - # Add cluster_id label. - - target_label: cluster_id - replacement: foo - # Add cluster_type label. - - target_label: cluster_type - replacement: workload_cluster - # Add customer label. - - target_label: customer - replacement: pmo - # Add installation label. - - target_label: installation - replacement: test-installation - # Add organization label. - - target_label: organization - replacement: my-organization - # Add pipeline label. - - target_label: pipeline - replacement: test-pipeline - # Add provider label. - - target_label: provider - replacement: azure - # Add provider label. - - target_label: region - replacement: eu-central-1 - # Add priority label. - - target_label: service_priority - replacement: medium - # Add role label. - - source_labels: [__meta_kubernetes_node_label_role] - target_label: role -# Add scrape configuration for docker -- job_name: foo-prometheus/docker-foo/0 - honor_labels: true - scheme: https - kubernetes_sd_configs: - - role: node - api_server: https://master.foo:443 - tls_config: - ca_file: /etc/prometheus/secrets/cluster-certificates/ca - cert_file: /etc/prometheus/secrets/cluster-certificates/crt - key_file: /etc/prometheus/secrets/cluster-certificates/key - insecure_skip_verify: false - tls_config: - ca_file: /etc/prometheus/secrets/cluster-certificates/ca - cert_file: /etc/prometheus/secrets/cluster-certificates/crt - key_file: /etc/prometheus/secrets/cluster-certificates/key - insecure_skip_verify: false - relabel_configs: - - target_label: __address__ - replacement: master.foo:443 - - source_labels: [__meta_kubernetes_node_name] - target_label: __metrics_path__ - replacement: /api/v1/nodes/${1}:9323/proxy/metrics - - target_label: app - replacement: docker - - source_labels: [__meta_kubernetes_node_address_InternalIP] - replacement: ${1}:9323 - target_label: instance - # Add cluster_id label. - - target_label: cluster_id - replacement: foo - # Add cluster_type label. - - target_label: cluster_type - replacement: workload_cluster - # Add customer label. - - target_label: customer - replacement: pmo - # Add installation label. - - target_label: installation - replacement: test-installation - # Add organization label. - - target_label: organization - replacement: my-organization - # Add pipeline label. - - target_label: pipeline - replacement: test-pipeline - # Add provider label. - - target_label: provider - replacement: azure - # Add provider label. - - target_label: region - replacement: eu-central-1 - # Add priority label. - - target_label: service_priority - replacement: medium - # Add role label. - - source_labels: [__meta_kubernetes_node_label_role] - target_label: role - metric_relabel_configs: - - source_labels: [__name__] - regex: (engine_daemon_image_actions_seconds_count|process_virtual_memory_bytes|process_resident_memory_bytes) - action: keep -# Add kubelet configuration -- job_name: foo-prometheus/kubelet-foo/0 - honor_labels: true - scheme: https - kubernetes_sd_configs: - - role: node - api_server: https://master.foo:443 - tls_config: - ca_file: /etc/prometheus/secrets/cluster-certificates/ca - cert_file: /etc/prometheus/secrets/cluster-certificates/crt - key_file: /etc/prometheus/secrets/cluster-certificates/key - insecure_skip_verify: false - tls_config: - ca_file: /etc/prometheus/secrets/cluster-certificates/ca - cert_file: /etc/prometheus/secrets/cluster-certificates/crt - key_file: /etc/prometheus/secrets/cluster-certificates/key - insecure_skip_verify: true - relabel_configs: - - target_label: app - replacement: kubelet - - source_labels: [__address__] - target_label: instance - - target_label: __address__ - replacement: master.foo:443 - - source_labels: [__meta_kubernetes_node_name] - target_label: __metrics_path__ - replacement: /api/v1/nodes/${1}:10250/proxy/metrics - - source_labels: [__meta_kubernetes_node_name] - target_label: node - # Add cluster_id label. - - target_label: cluster_id - replacement: foo - # Add cluster_type label. - - target_label: cluster_type - replacement: workload_cluster - # Add customer label. - - target_label: customer - replacement: pmo - # Add installation label. - - target_label: installation - replacement: test-installation - # Add organization label. - - target_label: organization - replacement: my-organization - # Add pipeline label. - - target_label: pipeline - replacement: test-pipeline - # Add provider label. - - target_label: provider - replacement: azure - # Add provider label. - - target_label: region - replacement: eu-central-1 - # Add priority label. - - target_label: service_priority - replacement: medium - # Add role label. - - source_labels: [__meta_kubernetes_node_label_role] - target_label: role - metric_relabel_configs: - # drop unused rest client metrics - - source_labels: [__name__] - regex: rest_client_(rate_limiter_duration_seconds_bucket|request_size_bytes_bucket|response_size_bytes_bucket) - action: drop - # drop uid label from kubelet - - action: labeldrop - regex: uid -# Add scrape configuration for cadvisor -- job_name: foo-prometheus/cadvisor-foo/0 - honor_labels: true - scheme: https - kubernetes_sd_configs: - - role: node - api_server: https://master.foo:443 - tls_config: - ca_file: /etc/prometheus/secrets/cluster-certificates/ca - cert_file: /etc/prometheus/secrets/cluster-certificates/crt - key_file: /etc/prometheus/secrets/cluster-certificates/key - insecure_skip_verify: false - tls_config: - ca_file: /etc/prometheus/secrets/cluster-certificates/ca - cert_file: /etc/prometheus/secrets/cluster-certificates/crt - key_file: /etc/prometheus/secrets/cluster-certificates/key - insecure_skip_verify: false - relabel_configs: - - source_labels: [__address__] - target_label: instance - - target_label: __address__ - replacement: master.foo:443 - - source_labels: [__meta_kubernetes_node_name] - target_label: __metrics_path__ - replacement: /api/v1/nodes/${1}:10250/proxy/metrics/cadvisor - - target_label: app - replacement: cadvisor - # Add node name. - - source_labels: [__meta_kubernetes_node_label_kubernetes_io_hostname] - target_label: node - # Add cluster_id label. - - target_label: cluster_id - replacement: foo - # Add cluster_type label. - - target_label: cluster_type - replacement: workload_cluster - # Add customer label. - - target_label: customer - replacement: pmo - # Add installation label. - - target_label: installation - replacement: test-installation - # Add organization label. - - target_label: organization - replacement: my-organization - # Add pipeline label. - - target_label: pipeline - replacement: test-pipeline - # Add provider label. - - target_label: provider - replacement: azure - # Add provider label. - - target_label: region - replacement: eu-central-1 - # Add priority label. - - target_label: service_priority - replacement: medium - # Add role label. - - source_labels: [__meta_kubernetes_node_label_role] - target_label: role - metric_relabel_configs: - # drop id and name labels from cAdvisor as they do not provide value but use a lot of RAM - - action: labeldrop - regex: id|name - # dropping explained here https://github.com/giantswarm/giantswarm/issues/26361 - - source_labels: [__name__] - regex: container_(blkio_device_usage_total|network_transmit_errors_total|network_receive_errors_total|tasks_state|memory_failures_total|memory_max_usage_bytes|cpu_load_average_10s|memory_failcnt|cpu_system_seconds_total) - action: drop - - source_labels: [namespace] - regex: (kube-system|giantswarm.*|kong.*|kyverno) - action: keep -# calico-node -- job_name: foo-prometheus/calico-node-foo/0 - honor_labels: true - scheme: https - kubernetes_sd_configs: - - role: pod - api_server: https://master.foo:443 - tls_config: - ca_file: /etc/prometheus/secrets/cluster-certificates/ca - cert_file: /etc/prometheus/secrets/cluster-certificates/crt - key_file: /etc/prometheus/secrets/cluster-certificates/key - insecure_skip_verify: false - tls_config: - ca_file: /etc/prometheus/secrets/cluster-certificates/ca - cert_file: /etc/prometheus/secrets/cluster-certificates/crt - key_file: /etc/prometheus/secrets/cluster-certificates/key - insecure_skip_verify: false - relabel_configs: - - source_labels: [__address__] - replacement: ${1}:9091 - target_label: instance - - target_label: __address__ - replacement: master.foo:443 - - source_labels: [__meta_kubernetes_pod_name] - regex: (calico-node.*) - target_label: __metrics_path__ - replacement: /api/v1/namespaces/kube-system/pods/${1}:9091/proxy/metrics - - source_labels: [__meta_kubernetes_namespace, __meta_kubernetes_pod_name] - regex: kube-system;calico-node.* - action: keep - - source_labels: [__meta_kubernetes_pod_container_name] - target_label: app - # Add namespace label. - - source_labels: [__meta_kubernetes_namespace] - target_label: namespace - # Add pod label. - - source_labels: [__meta_kubernetes_pod_name] - target_label: pod - # Add container label. - - source_labels: [__meta_kubernetes_pod_container_name] - target_label: container - # Add node label. - - source_labels: [__meta_kubernetes_pod_node_name] - target_label: node - # Add role label. - - source_labels: [__meta_kubernetes_node_label_role] - target_label: role - # Add cluster_id label. - - target_label: cluster_id - replacement: foo - # Add cluster_type label. - - target_label: cluster_type - replacement: workload_cluster - # Add customer label. - - target_label: customer - replacement: pmo - # Add installation label. - - target_label: installation - replacement: test-installation - # Add organization label. - - target_label: organization - replacement: my-organization - # Add pipeline label. - - target_label: pipeline - replacement: test-pipeline - # Add provider label. - - target_label: provider - replacement: azure - # Add provider label. - - target_label: region - replacement: eu-central-1 - # Add priority label. - - target_label: service_priority - replacement: medium -# Add etcd configuration -- job_name: foo-prometheus/etcd-foo/0 - honor_labels: true - scheme: https - kubernetes_sd_configs: - - role: node - api_server: https://master.foo:443 - tls_config: - ca_file: /etc/prometheus/secrets/cluster-certificates/ca - cert_file: /etc/prometheus/secrets/cluster-certificates/crt - key_file: /etc/prometheus/secrets/cluster-certificates/key - insecure_skip_verify: false - tls_config: - ca_file: /etc/prometheus/secrets/cluster-certificates/ca - cert_file: /etc/prometheus/secrets/cluster-certificates/crt - key_file: /etc/prometheus/secrets/cluster-certificates/key - insecure_skip_verify: true - relabel_configs: - - source_labels: [__meta_kubernetes_node_label_role] - regex: control-plane|master - action: keep - # by default use node address - - source_labels: [__address__] - regex: (.*):10250 - target_label: __address__ - replacement: ${1}:2379 - action: replace - - target_label: app - replacement: etcd - - source_labels: [__address__] - target_label: instance - # Add ip label. - - target_label: ip - source_labels: [__meta_kubernetes_node_address_InternalIP] - # Add cluster_id label. - - target_label: cluster_id - replacement: foo - # Add cluster_type label. - - target_label: cluster_type - replacement: workload_cluster - # Add customer label. - - target_label: customer - replacement: pmo - # Add installation label. - - target_label: installation - replacement: test-installation - # Add organization label. - - target_label: organization - replacement: my-organization - # Add pipeline label. - - target_label: pipeline - replacement: test-pipeline - # Add provider label. - - target_label: provider - replacement: azure - # Add provider label. - - target_label: region - replacement: eu-central-1 - # Add priority label. - - target_label: service_priority - replacement: medium - # Add role label. - - source_labels: [__meta_kubernetes_node_label_role] - target_label: role -# kube-proxy -- job_name: foo-prometheus/kube-proxy-foo/0 - honor_labels: true - scheme: https - kubernetes_sd_configs: - - role: pod - namespaces: - names: - - kube-system - api_server: https://master.foo:443 - tls_config: - ca_file: /etc/prometheus/secrets/cluster-certificates/ca - cert_file: /etc/prometheus/secrets/cluster-certificates/crt - key_file: /etc/prometheus/secrets/cluster-certificates/key - insecure_skip_verify: false - tls_config: - ca_file: /etc/prometheus/secrets/cluster-certificates/ca - cert_file: /etc/prometheus/secrets/cluster-certificates/crt - key_file: /etc/prometheus/secrets/cluster-certificates/key - insecure_skip_verify: true - relabel_configs: - - source_labels: [__address__] - replacement: $1:10249 - target_label: instance - - source_labels: [__meta_kubernetes_pod_name] - regex: (kube-proxy.*) - action: keep - - target_label: __address__ - replacement: master.foo:443 - - source_labels: [__meta_kubernetes_pod_name] - regex: (kube-proxy.*) - target_label: __metrics_path__ - replacement: /api/v1/namespaces/kube-system/pods/${1}:10249/proxy/metrics - - target_label: app - replacement: kube-proxy - # Add namespace label. - - source_labels: [__meta_kubernetes_namespace] - target_label: namespace - # Add pod label. - - source_labels: [__meta_kubernetes_pod_name] - target_label: pod - # Add container label. - - source_labels: [__meta_kubernetes_pod_container_name] - target_label: container - # Add node label. - - source_labels: [__meta_kubernetes_pod_node_name] - target_label: node - # Add role label. - - source_labels: [__meta_kubernetes_node_label_role] - target_label: role - # Add cluster_id label. - - target_label: cluster_id - replacement: foo - # Add cluster_type label. - - target_label: cluster_type - replacement: workload_cluster - # Add customer label. - - target_label: customer - replacement: pmo - # Add installation label. - - target_label: installation - replacement: test-installation - # Add organization label. - - target_label: organization - replacement: my-organization - # Add pipeline label. - - target_label: pipeline - replacement: test-pipeline - # Add provider label. - - target_label: provider - replacement: azure - # Add provider label. - - target_label: region - replacement: eu-central-1 - # Add priority label. - - target_label: service_priority - replacement: medium - metric_relabel_configs: - # drop unused rest client metrics - - source_labels: [__name__] - regex: rest_client_(rate_limiter_duration_seconds_bucket|request_size_bytes_bucket|response_size_bytes_bucket) - action: drop -# coredns -- job_name: foo-prometheus/coredns-foo/0 - honor_labels: true - scheme: https - kubernetes_sd_configs: - - role: endpoints - namespaces: - names: - - kube-system - api_server: https://master.foo:443 - tls_config: - ca_file: /etc/prometheus/secrets/cluster-certificates/ca - cert_file: /etc/prometheus/secrets/cluster-certificates/crt - key_file: /etc/prometheus/secrets/cluster-certificates/key - insecure_skip_verify: false - tls_config: - ca_file: /etc/prometheus/secrets/cluster-certificates/ca - cert_file: /etc/prometheus/secrets/cluster-certificates/crt - key_file: /etc/prometheus/secrets/cluster-certificates/key - insecure_skip_verify: true - relabel_configs: - - source_labels: [__address__] - target_label: instance - - source_labels: [__meta_kubernetes_pod_container_name] - regex: coredns - action: keep - - target_label: __address__ - replacement: master.foo:443 - - source_labels: [__meta_kubernetes_pod_name] - regex: (coredns.*) - target_label: __metrics_path__ - replacement: /api/v1/namespaces/kube-system/pods/${1}:9153/proxy/metrics - - source_labels: [__meta_kubernetes_pod_container_name] - target_label: app - - source_labels: [__meta_kubernetes_service_annotationpresent_giantswarm_io_monitoring, __meta_kubernetes_service_labelpresent_giantswarm_io_monitoring] - regex: .*(true).* - action: drop - # Add namespace label. - - source_labels: [__meta_kubernetes_namespace] - target_label: namespace - # Add pod label. - - source_labels: [__meta_kubernetes_pod_name] - target_label: pod - # Add container label. - - source_labels: [__meta_kubernetes_pod_container_name] - target_label: container - # Add node label. - - source_labels: [__meta_kubernetes_pod_node_name] - target_label: node - # Add role label. - - source_labels: [__meta_kubernetes_node_label_role] - target_label: role - # Add cluster_id label. - - target_label: cluster_id - replacement: foo - # Add cluster_type label. - - target_label: cluster_type - replacement: workload_cluster - # Add customer label. - - target_label: customer - replacement: pmo - # Add installation label. - - target_label: installation - replacement: test-installation - # Add organization label. - - target_label: organization - replacement: my-organization - # Add pipeline label. - - target_label: pipeline - replacement: test-pipeline - # Add provider label. - - target_label: provider - replacement: azure - # Add provider label. - - target_label: region - replacement: eu-central-1 - # Add priority label. - - target_label: service_priority - replacement: medium - metric_relabel_configs: - # drop unused coredns metrics with the highest cardinality as they increase Prometheus memory usage - - source_labels: [__name__] - regex: coredns_dns_(response_size_bytes_bucket|request_size_bytes_bucket) - action: drop -# cert-exporter -- job_name: foo-prometheus/cert-exporter-foo/0 - honor_labels: true - scheme: https - kubernetes_sd_configs: - - role: endpoints - namespaces: - names: - - kube-system - api_server: https://master.foo:443 - tls_config: - ca_file: /etc/prometheus/secrets/cluster-certificates/ca - cert_file: /etc/prometheus/secrets/cluster-certificates/crt - key_file: /etc/prometheus/secrets/cluster-certificates/key - insecure_skip_verify: false - tls_config: - ca_file: /etc/prometheus/secrets/cluster-certificates/ca - cert_file: /etc/prometheus/secrets/cluster-certificates/crt - key_file: /etc/prometheus/secrets/cluster-certificates/key - insecure_skip_verify: true - relabel_configs: - - source_labels: [__address__] - target_label: instance - - source_labels: [__meta_kubernetes_service_label_app] - regex: cert-exporter - action: keep - - target_label: __address__ - replacement: master.foo:443 - - source_labels: [__meta_kubernetes_pod_name] - regex: (cert-exporter.*) - target_label: __metrics_path__ - replacement: /api/v1/namespaces/kube-system/pods/${1}:9005/proxy/metrics - - source_labels: [__meta_kubernetes_service_label_app] - target_label: app - - source_labels: [__meta_kubernetes_service_annotationpresent_giantswarm_io_monitoring, __meta_kubernetes_service_labelpresent_giantswarm_io_monitoring] - regex: .*(true).* - action: drop - # Add namespace label. - - source_labels: [__meta_kubernetes_namespace] - target_label: namespace - # Add pod label. - - source_labels: [__meta_kubernetes_pod_name] - target_label: pod - # Add container label. - - source_labels: [__meta_kubernetes_pod_container_name] - target_label: container - # Add node label. - - source_labels: [__meta_kubernetes_pod_node_name] - target_label: node - # Add role label. - - source_labels: [__meta_kubernetes_node_label_role] - target_label: role - # Add cluster_id label. - - target_label: cluster_id - replacement: foo - # Add cluster_type label. - - target_label: cluster_type - replacement: workload_cluster - # Add customer label. - - target_label: customer - replacement: pmo - # Add installation label. - - target_label: installation - replacement: test-installation - # Add organization label. - - target_label: organization - replacement: my-organization - # Add pipeline label. - - target_label: pipeline - replacement: test-pipeline - # Add provider label. - - target_label: provider - replacement: azure - # Add provider label. - - target_label: region - replacement: eu-central-1 - # Add priority label. - - target_label: service_priority - replacement: medium -# node-exporter -- job_name: foo-prometheus/node-exporter-foo/0 - honor_labels: true - scheme: https - kubernetes_sd_configs: - - role: pod - api_server: https://master.foo:443 - tls_config: - ca_file: /etc/prometheus/secrets/cluster-certificates/ca - cert_file: /etc/prometheus/secrets/cluster-certificates/crt - key_file: /etc/prometheus/secrets/cluster-certificates/key - insecure_skip_verify: false - tls_config: - ca_file: /etc/prometheus/secrets/cluster-certificates/ca - cert_file: /etc/prometheus/secrets/cluster-certificates/crt - key_file: /etc/prometheus/secrets/cluster-certificates/key - insecure_skip_verify: true - relabel_configs: - - target_label: __address__ - replacement: master.foo:443 - - source_labels: [__meta_kubernetes_pod_name] - regex: (node-exporter.*) - target_label: __metrics_path__ - replacement: /api/v1/namespaces/kube-system/pods/${1}:10300/proxy/metrics - - source_labels: [__meta_kubernetes_namespace, __meta_kubernetes_pod_name] - regex: kube-system;node-exporter.* - action: keep - - source_labels: [__meta_kubernetes_pod_container_name] - target_label: app - - source_labels: [__meta_kubernetes_pod_annotationpresent_giantswarm_io_monitoring, __meta_kubernetes_pod_labelpresent_giantswarm_io_monitoring] - regex: .*(true).* - action: drop - - source_labels: [__meta_kubernetes_pod_node_name] - target_label: node - # Add cluster_id label. - - target_label: cluster_id - replacement: foo - # Add cluster_type label. - - target_label: cluster_type - replacement: workload_cluster - # Add customer label. - - target_label: customer - replacement: pmo - # Add installation label. - - target_label: installation - replacement: test-installation - # Add organization label. - - target_label: organization - replacement: my-organization - # Add pipeline label. - - target_label: pipeline - replacement: test-pipeline - # Add provider label. - - target_label: provider - replacement: azure - # Add provider label. - - target_label: region - replacement: eu-central-1 - # Add priority label. - - target_label: service_priority - replacement: medium - metric_relabel_configs: - # drop unused metrics with the highest cardinality as they increase Prometheus memory usage - - source_labels: [__name__] - regex: node_(filesystem_files|filesystem_readonly|nfs_requests_total|network_carrier|network_transmit_colls_total|network_carrier_changes_total|network_transmit_packets_total|network_carrier_down_changes_total|network_carrier_up_changes_total|network_iface_id|xfs_.+|ethtool_.+) - action: drop -- job_name: foo-prometheus/workload-foo/0 - honor_labels: true - scheme: https - kubernetes_sd_configs: - - role: endpoints - api_server: https://master.foo:443 - tls_config: - ca_file: /etc/prometheus/secrets/cluster-certificates/ca - cert_file: /etc/prometheus/secrets/cluster-certificates/crt - key_file: /etc/prometheus/secrets/cluster-certificates/key - insecure_skip_verify: false - tls_config: - ca_file: /etc/prometheus/secrets/cluster-certificates/ca - cert_file: /etc/prometheus/secrets/cluster-certificates/crt - key_file: /etc/prometheus/secrets/cluster-certificates/key - insecure_skip_verify: true - relabel_configs: - - source_labels: [__meta_kubernetes_service_annotationpresent_giantswarm_io_monitoring, __meta_kubernetes_service_labelpresent_giantswarm_io_monitoring] - regex: .*(true).* - action: keep - # if __meta_kubernetes_service_annotation_giantswarm_io_monitoring_path is present, we use it as the metrics path - - source_labels: [__meta_kubernetes_service_annotation_giantswarm_io_monitoring_path] - action: replace - target_label: __metrics_path__ - regex: (.+) - # if __meta_kubernetes_service_annotation_giantswarm_io_monitoring_port, we use it as the metrics port - - source_labels: [__address__, __meta_kubernetes_service_annotation_giantswarm_io_monitoring_port] - action: replace - target_label: __address__ - regex: ([^:]+):(\d+);(\d+) - replacement: $1:$3 - # if the protocol is empty, we set it to http by default, this allows to override the protocol for services using https like prometheus operator - - source_labels: [__address__, __meta_kubernetes_service_annotation_giantswarm_io_monitoring_protocol] - action: replace - target_label: __meta_kubernetes_service_annotation_giantswarm_io_monitoring_protocol - regex: (.*); - replacement: "http" - - source_labels: [__meta_kubernetes_pod_ip, __address__] - regex: (.*);([^:]+):(\d+) - replacement: $1:$3 - target_label: instance - - source_labels: [__meta_kubernetes_namespace, __meta_kubernetes_service_annotation_giantswarm_io_monitoring_protocol, __meta_kubernetes_pod_name, __address__, __metrics_path__] - regex: (.*);(.*);(.*);(.+:)(\d+);(.*) - target_label: __metrics_path__ - replacement: /api/v1/namespaces/${1}/pods/${2}:${3}:${5}/proxy${6} - action: replace - - regex: (.*) - target_label: __address__ - replacement: master.foo:443 - action: replace - - source_labels: [__meta_kubernetes_service_name] - regex: (.*) - target_label: app - action: replace - - source_labels: [__meta_kubernetes_service_annotation_giantswarm_io_monitoring_app_label] - regex: (.+) - target_label: app - action: replace - # Add namespace label. - - source_labels: [__meta_kubernetes_namespace] - target_label: namespace - # Add pod label. - - source_labels: [__meta_kubernetes_pod_name] - target_label: pod - # Add container label. - - source_labels: [__meta_kubernetes_pod_container_name] - target_label: container - # Add node label. - - source_labels: [__meta_kubernetes_pod_node_name] - target_label: node - # Add role label. - - source_labels: [__meta_kubernetes_node_label_role] - target_label: role - # Add cluster_id label. - - target_label: cluster_id - replacement: foo - # Add cluster_type label. - - target_label: cluster_type - replacement: workload_cluster - # Add customer label. - - target_label: customer - replacement: pmo - # Add installation label. - - target_label: installation - replacement: test-installation - # Add organization label. - - target_label: organization - replacement: my-organization - # Add pipeline label. - - target_label: pipeline - replacement: test-pipeline - # Add provider label. - - target_label: provider - replacement: azure - # Add provider label. - - target_label: region - replacement: eu-central-1 - # Add priority label. - - target_label: service_priority - replacement: medium - metric_relabel_configs: - # drop unused nginx metrics with the highest cardinality as they increase Prometheus memory usage - - source_labels: [__name__] - regex: nginx_ingress_controller_(bytes_sent_bucket|request_size_bucket|response_duration_seconds_bucket|response_size_bucket|request_duration_seconds_count|connect_duration_seconds_bucket|header_duration_seconds_bucket|bytes_sent_count|request_duration_seconds_sum|bytes_sent_sum|request_size_count|response_size_count|response_duration_seconds_sum|response_duration_seconds_count|ingress_upstream_latency_seconds|ingress_upstream_latency_seconds_sum|ingress_upstream_latency_seconds_count) - action: drop - # drop unused kong metrics with the highest cardinality as they increase Prometheus memory usage - - source_labels: [__name__] - regex: kong_(upstream_target_health|latency_bucket|latency_count|latency_sum) - action: drop - # drop unused kube-state-metrics metrics with the highest cardinality as they increase Prometheus memory usage - - source_labels: [__name__] - regex: kube_(.+_annotations|secret_type|pod_status_qos_class|pod_tolerations|pod_status_scheduled|replicaset_metadata_generation|replicaset_status_observed_generation|replicaset_annotations|replicaset_status_fully_labeled_replicas|.+_metadata_resource_version) - action: drop - # drop unused promtail/loki metrics - - source_labels: [__name__] - regex: promtail_request_duration_seconds_bucket|loki_request_duration_seconds_bucket - action: drop - # drop unused rest client metrics - - source_labels: [__name__] - regex: rest_client_(rate_limiter_duration_seconds_bucket|request_size_bytes_bucket|response_size_bytes_bucket) - action: drop - # drop image_id label from kube-state-metrics - - source_labels: [app,image_id] - separator: ; - regex: kube-state-metrics;(.+) - replacement: "" - action: replace - target_label: image_id - - source_labels: [app,deployment] - separator: ; - regex: kube-state-metrics;(.+) - target_label: workload_type - replacement: deployment - action: replace - - source_labels: [app,daemonset] - separator: ; - regex: kube-state-metrics;(.+) - target_label: workload_type - replacement: daemonset - action: replace - - source_labels: [app,statefulset] - separator: ; - regex: kube-state-metrics;(.+) - target_label: workload_type - replacement: statefulset - action: replace - - source_labels: [app,deployment] - separator: ; - regex: kube-state-metrics;(.+) - target_label: workload_name - replacement: ${1} - action: replace - - source_labels: [app,daemonset] - separator: ; - regex: kube-state-metrics;(.+) - target_label: workload_name - replacement: ${1} - action: replace - - source_labels: [app,statefulset] - separator: ; - regex: kube-state-metrics;(.+) - target_label: workload_name - replacement: ${1} - action: replace - - source_labels: [app,label_topology_kubernetes_io_region] - separator: ; - regex: kube-state-metrics;(.+) - target_label: region - replacement: ${1} - action: replace - - source_labels: [app,label_topology_kubernetes_io_zone] - separator: ; - regex: kube-state-metrics;(.+) - target_label: zone - replacement: ${1} - action: replace - - action: labeldrop - regex: label_topology_kubernetes_io_region|label_topology_kubernetes_io_zone - # Override with label for AWS clusters if exists. - - source_labels: [app,label_giantswarm_io_machine_deployment] - regex: kube-state-metrics;(.+) - target_label: nodepool - replacement: ${1} - action: replace - # Override with label for Azure clusters if exists. - - source_labels: [app,label_giantswarm_io_machine_pool] - regex: kube-state-metrics;(.+) - target_label: nodepool - replacement: ${1} - action: replace - - action: labeldrop - regex: label_giantswarm_io_machine_pool|label_giantswarm_io_machine_deployment -# prometheus -- job_name: foo-prometheus/prometheus-foo/0 - honor_labels: true - scheme: http - metrics_path: /foo/metrics - static_configs: - - targets: ['localhost:9090'] - relabel_configs: - - replacement: prometheus - target_label: app - # Add cluster_id label. - - target_label: cluster_id - replacement: foo - # Add cluster_type label. - - target_label: cluster_type - replacement: workload_cluster - # Add customer label. - - target_label: customer - replacement: pmo - # Add installation label. - - target_label: installation - replacement: test-installation - # Add organization label. - - target_label: organization - replacement: my-organization - # Add pipeline label. - - target_label: pipeline - replacement: test-pipeline - # Add provider label. - - target_label: provider - replacement: azure - # Add provider label. - - target_label: region - replacement: eu-central-1 - # Add priority label. - - target_label: service_priority - replacement: medium diff --git a/service/controller/resource/monitoring/scrapeconfigs/test/capa/case-1-capa-mc.golden b/service/controller/resource/monitoring/scrapeconfigs/test/capa/case-1-capa-mc.golden index 7e9ceef58..abf543170 100644 --- a/service/controller/resource/monitoring/scrapeconfigs/test/capa/case-1-capa-mc.golden +++ b/service/controller/resource/monitoring/scrapeconfigs/test/capa/case-1-capa-mc.golden @@ -1011,12 +1011,6 @@ target_label: nodepool replacement: ${1} action: replace - # Override with label for Azure clusters if exists. - - source_labels: [app,label_giantswarm_io_machine_pool] - regex: kube-state-metrics;(.+) - target_label: nodepool - replacement: ${1} - action: replace - action: labeldrop regex: label_giantswarm_io_machine_pool|label_giantswarm_io_machine_deployment # prometheus diff --git a/service/controller/resource/monitoring/scrapeconfigs/test/capa/case-2-capa.golden b/service/controller/resource/monitoring/scrapeconfigs/test/capa/case-2-capa.golden index 94c88a2e1..eebbc49f5 100644 --- a/service/controller/resource/monitoring/scrapeconfigs/test/capa/case-2-capa.golden +++ b/service/controller/resource/monitoring/scrapeconfigs/test/capa/case-2-capa.golden @@ -712,12 +712,6 @@ target_label: nodepool replacement: ${1} action: replace - # Override with label for Azure clusters if exists. - - source_labels: [app,label_giantswarm_io_machine_pool] - regex: kube-state-metrics;(.+) - target_label: nodepool - replacement: ${1} - action: replace - action: labeldrop regex: label_giantswarm_io_machine_pool|label_giantswarm_io_machine_deployment # prometheus diff --git a/service/controller/resource/monitoring/scrapeconfigs/test/capa/case-3-capz.golden b/service/controller/resource/monitoring/scrapeconfigs/test/capa/case-3-capz.golden index 4f5381066..b176e2e54 100644 --- a/service/controller/resource/monitoring/scrapeconfigs/test/capa/case-3-capz.golden +++ b/service/controller/resource/monitoring/scrapeconfigs/test/capa/case-3-capz.golden @@ -1011,12 +1011,6 @@ target_label: nodepool replacement: ${1} action: replace - # Override with label for Azure clusters if exists. - - source_labels: [app,label_giantswarm_io_machine_pool] - regex: kube-state-metrics;(.+) - target_label: nodepool - replacement: ${1} - action: replace - action: labeldrop regex: label_giantswarm_io_machine_pool|label_giantswarm_io_machine_deployment # prometheus diff --git a/service/controller/resource/monitoring/scrapeconfigs/test/capa/case-4-eks.golden b/service/controller/resource/monitoring/scrapeconfigs/test/capa/case-4-eks.golden index 1f178af4b..72abdd503 100644 --- a/service/controller/resource/monitoring/scrapeconfigs/test/capa/case-4-eks.golden +++ b/service/controller/resource/monitoring/scrapeconfigs/test/capa/case-4-eks.golden @@ -345,12 +345,6 @@ target_label: nodepool replacement: ${1} action: replace - # Override with label for Azure clusters if exists. - - source_labels: [app,label_giantswarm_io_machine_pool] - regex: kube-state-metrics;(.+) - target_label: nodepool - replacement: ${1} - action: replace - action: labeldrop regex: label_giantswarm_io_machine_pool|label_giantswarm_io_machine_deployment # prometheus diff --git a/service/controller/resource/monitoring/scrapeconfigs/test/capa/case-5-gcp.golden b/service/controller/resource/monitoring/scrapeconfigs/test/capa/case-5-gcp.golden index 2e4b57eb0..c3b708806 100644 --- a/service/controller/resource/monitoring/scrapeconfigs/test/capa/case-5-gcp.golden +++ b/service/controller/resource/monitoring/scrapeconfigs/test/capa/case-5-gcp.golden @@ -1011,12 +1011,6 @@ target_label: nodepool replacement: ${1} action: replace - # Override with label for Azure clusters if exists. - - source_labels: [app,label_giantswarm_io_machine_pool] - regex: kube-state-metrics;(.+) - target_label: nodepool - replacement: ${1} - action: replace - action: labeldrop regex: label_giantswarm_io_machine_pool|label_giantswarm_io_machine_deployment # prometheus diff --git a/service/controller/resource/monitoring/scrapeconfigs/test/capz/case-1-capa-mc.golden b/service/controller/resource/monitoring/scrapeconfigs/test/capz/case-1-capa-mc.golden index 7e9ceef58..abf543170 100644 --- a/service/controller/resource/monitoring/scrapeconfigs/test/capz/case-1-capa-mc.golden +++ b/service/controller/resource/monitoring/scrapeconfigs/test/capz/case-1-capa-mc.golden @@ -1011,12 +1011,6 @@ target_label: nodepool replacement: ${1} action: replace - # Override with label for Azure clusters if exists. - - source_labels: [app,label_giantswarm_io_machine_pool] - regex: kube-state-metrics;(.+) - target_label: nodepool - replacement: ${1} - action: replace - action: labeldrop regex: label_giantswarm_io_machine_pool|label_giantswarm_io_machine_deployment # prometheus diff --git a/service/controller/resource/monitoring/scrapeconfigs/test/capz/case-2-capa.golden b/service/controller/resource/monitoring/scrapeconfigs/test/capz/case-2-capa.golden index 94c88a2e1..eebbc49f5 100644 --- a/service/controller/resource/monitoring/scrapeconfigs/test/capz/case-2-capa.golden +++ b/service/controller/resource/monitoring/scrapeconfigs/test/capz/case-2-capa.golden @@ -712,12 +712,6 @@ target_label: nodepool replacement: ${1} action: replace - # Override with label for Azure clusters if exists. - - source_labels: [app,label_giantswarm_io_machine_pool] - regex: kube-state-metrics;(.+) - target_label: nodepool - replacement: ${1} - action: replace - action: labeldrop regex: label_giantswarm_io_machine_pool|label_giantswarm_io_machine_deployment # prometheus diff --git a/service/controller/resource/monitoring/scrapeconfigs/test/capz/case-3-capz.golden b/service/controller/resource/monitoring/scrapeconfigs/test/capz/case-3-capz.golden index 4f5381066..b176e2e54 100644 --- a/service/controller/resource/monitoring/scrapeconfigs/test/capz/case-3-capz.golden +++ b/service/controller/resource/monitoring/scrapeconfigs/test/capz/case-3-capz.golden @@ -1011,12 +1011,6 @@ target_label: nodepool replacement: ${1} action: replace - # Override with label for Azure clusters if exists. - - source_labels: [app,label_giantswarm_io_machine_pool] - regex: kube-state-metrics;(.+) - target_label: nodepool - replacement: ${1} - action: replace - action: labeldrop regex: label_giantswarm_io_machine_pool|label_giantswarm_io_machine_deployment # prometheus diff --git a/service/controller/resource/monitoring/scrapeconfigs/test/capz/case-4-eks.golden b/service/controller/resource/monitoring/scrapeconfigs/test/capz/case-4-eks.golden index 1f178af4b..72abdd503 100644 --- a/service/controller/resource/monitoring/scrapeconfigs/test/capz/case-4-eks.golden +++ b/service/controller/resource/monitoring/scrapeconfigs/test/capz/case-4-eks.golden @@ -345,12 +345,6 @@ target_label: nodepool replacement: ${1} action: replace - # Override with label for Azure clusters if exists. - - source_labels: [app,label_giantswarm_io_machine_pool] - regex: kube-state-metrics;(.+) - target_label: nodepool - replacement: ${1} - action: replace - action: labeldrop regex: label_giantswarm_io_machine_pool|label_giantswarm_io_machine_deployment # prometheus diff --git a/service/controller/resource/monitoring/scrapeconfigs/test/capz/case-5-gcp.golden b/service/controller/resource/monitoring/scrapeconfigs/test/capz/case-5-gcp.golden index 2e4b57eb0..c3b708806 100644 --- a/service/controller/resource/monitoring/scrapeconfigs/test/capz/case-5-gcp.golden +++ b/service/controller/resource/monitoring/scrapeconfigs/test/capz/case-5-gcp.golden @@ -1011,12 +1011,6 @@ target_label: nodepool replacement: ${1} action: replace - # Override with label for Azure clusters if exists. - - source_labels: [app,label_giantswarm_io_machine_pool] - regex: kube-state-metrics;(.+) - target_label: nodepool - replacement: ${1} - action: replace - action: labeldrop regex: label_giantswarm_io_machine_pool|label_giantswarm_io_machine_deployment # prometheus diff --git a/service/controller/resource/monitoring/scrapeconfigs/test/gcp/case-1-capa-mc.golden b/service/controller/resource/monitoring/scrapeconfigs/test/gcp/case-1-capa-mc.golden index 7e9ceef58..abf543170 100644 --- a/service/controller/resource/monitoring/scrapeconfigs/test/gcp/case-1-capa-mc.golden +++ b/service/controller/resource/monitoring/scrapeconfigs/test/gcp/case-1-capa-mc.golden @@ -1011,12 +1011,6 @@ target_label: nodepool replacement: ${1} action: replace - # Override with label for Azure clusters if exists. - - source_labels: [app,label_giantswarm_io_machine_pool] - regex: kube-state-metrics;(.+) - target_label: nodepool - replacement: ${1} - action: replace - action: labeldrop regex: label_giantswarm_io_machine_pool|label_giantswarm_io_machine_deployment # prometheus diff --git a/service/controller/resource/monitoring/scrapeconfigs/test/gcp/case-2-capa.golden b/service/controller/resource/monitoring/scrapeconfigs/test/gcp/case-2-capa.golden index 94c88a2e1..eebbc49f5 100644 --- a/service/controller/resource/monitoring/scrapeconfigs/test/gcp/case-2-capa.golden +++ b/service/controller/resource/monitoring/scrapeconfigs/test/gcp/case-2-capa.golden @@ -712,12 +712,6 @@ target_label: nodepool replacement: ${1} action: replace - # Override with label for Azure clusters if exists. - - source_labels: [app,label_giantswarm_io_machine_pool] - regex: kube-state-metrics;(.+) - target_label: nodepool - replacement: ${1} - action: replace - action: labeldrop regex: label_giantswarm_io_machine_pool|label_giantswarm_io_machine_deployment # prometheus diff --git a/service/controller/resource/monitoring/scrapeconfigs/test/gcp/case-3-capz.golden b/service/controller/resource/monitoring/scrapeconfigs/test/gcp/case-3-capz.golden index 4f5381066..b176e2e54 100644 --- a/service/controller/resource/monitoring/scrapeconfigs/test/gcp/case-3-capz.golden +++ b/service/controller/resource/monitoring/scrapeconfigs/test/gcp/case-3-capz.golden @@ -1011,12 +1011,6 @@ target_label: nodepool replacement: ${1} action: replace - # Override with label for Azure clusters if exists. - - source_labels: [app,label_giantswarm_io_machine_pool] - regex: kube-state-metrics;(.+) - target_label: nodepool - replacement: ${1} - action: replace - action: labeldrop regex: label_giantswarm_io_machine_pool|label_giantswarm_io_machine_deployment # prometheus diff --git a/service/controller/resource/monitoring/scrapeconfigs/test/gcp/case-4-eks.golden b/service/controller/resource/monitoring/scrapeconfigs/test/gcp/case-4-eks.golden index 1f178af4b..72abdd503 100644 --- a/service/controller/resource/monitoring/scrapeconfigs/test/gcp/case-4-eks.golden +++ b/service/controller/resource/monitoring/scrapeconfigs/test/gcp/case-4-eks.golden @@ -345,12 +345,6 @@ target_label: nodepool replacement: ${1} action: replace - # Override with label for Azure clusters if exists. - - source_labels: [app,label_giantswarm_io_machine_pool] - regex: kube-state-metrics;(.+) - target_label: nodepool - replacement: ${1} - action: replace - action: labeldrop regex: label_giantswarm_io_machine_pool|label_giantswarm_io_machine_deployment # prometheus diff --git a/service/controller/resource/monitoring/scrapeconfigs/test/gcp/case-5-gcp.golden b/service/controller/resource/monitoring/scrapeconfigs/test/gcp/case-5-gcp.golden index 2e4b57eb0..c3b708806 100644 --- a/service/controller/resource/monitoring/scrapeconfigs/test/gcp/case-5-gcp.golden +++ b/service/controller/resource/monitoring/scrapeconfigs/test/gcp/case-5-gcp.golden @@ -1011,12 +1011,6 @@ target_label: nodepool replacement: ${1} action: replace - # Override with label for Azure clusters if exists. - - source_labels: [app,label_giantswarm_io_machine_pool] - regex: kube-state-metrics;(.+) - target_label: nodepool - replacement: ${1} - action: replace - action: labeldrop regex: label_giantswarm_io_machine_pool|label_giantswarm_io_machine_deployment # prometheus diff --git a/service/controller/resource/monitoring/verticalpodautoscaler/test/vintage/case-4-azure-v18.golden b/service/controller/resource/monitoring/verticalpodautoscaler/test/vintage/case-4-azure-v18.golden deleted file mode 100644 index b0e3f0851..000000000 --- a/service/controller/resource/monitoring/verticalpodautoscaler/test/vintage/case-4-azure-v18.golden +++ /dev/null @@ -1,28 +0,0 @@ -metadata: - creationTimestamp: null - labels: - app.kubernetes.io/instance: foo - app.kubernetes.io/managed-by: prometheus-meta-operator - app.kubernetes.io/name: prometheus - giantswarm.io/cluster: foo - name: prometheus - namespace: foo-prometheus -spec: - resourcePolicy: - containerPolicies: - - containerName: prometheus - controlledValues: RequestsAndLimits - maxAllowed: - cpu: "4" - memory: "13743895347" - minAllowed: - cpu: 100m - memory: "1073741824" - mode: Auto - targetRef: - apiVersion: apps/v1 - kind: StatefulSet - name: prometheus-foo - updatePolicy: - updateMode: Auto -status: {} diff --git a/service/controller/resource/namespace/test/vintage/case-4-azure-v18.golden b/service/controller/resource/namespace/test/vintage/case-4-azure-v18.golden deleted file mode 100644 index 0d0fb150e..000000000 --- a/service/controller/resource/namespace/test/vintage/case-4-azure-v18.golden +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - creationTimestamp: null - labels: - app.kubernetes.io/instance: foo - app.kubernetes.io/managed-by: prometheus-meta-operator - app.kubernetes.io/name: prometheus - giantswarm.io/cluster: foo - name: foo-prometheus -spec: {} -status: {}