From bfb5121b089c1ef79bc8f7b8ed6cdb1c8e134754 Mon Sep 17 00:00:00 2001 From: Matthias Hartmann Date: Mon, 27 Jul 2026 12:32:35 +0200 Subject: [PATCH 1/2] chore: improve launch stability --- Makefile | 4 +-- deploy_control_plane.yaml | 6 ++--- .../group_vars/partition/monitoring.yaml | 9 ------- .../group_vars/partition/prometheus.yaml | 25 +++++++++++-------- 4 files changed, 19 insertions(+), 25 deletions(-) diff --git a/Makefile b/Makefile index 837e44bf..dddf589b 100644 --- a/Makefile +++ b/Makefile @@ -427,12 +427,12 @@ build-sonic-base: .PHONY: dev-env dev-env: - @TOKEN=$$(kubectl --kubeconfig=$(KUBECONFIG) get secret -n metal-control-plane metal-apiserver-admin-token --template={{.data.admin_editor_token}} | base64 -d); \ - echo "export METAL_APIV2_TOKEN=$$TOKEN" @echo "export METALCTL_API_URL=${METALCTL_API_URL}" @echo "export METALCTL_HMAC=${METALCTL_HMAC}" @echo "export METAL_APIV2_URL=${METAL_APIV2_URL}" @echo "export KUBECONFIG=$(KUBECONFIG)" + @TOKEN=$$(kubectl --kubeconfig=$(KUBECONFIG) get secret -n metal-control-plane metal-apiserver-admin-token --template={{.data.admin_editor_token}} | base64 -d); \ + echo "export METAL_APIV2_TOKEN=$$TOKEN" build-dell-sonic: if [ ! -f "sonic-vs.img" ]; then \ diff --git a/deploy_control_plane.yaml b/deploy_control_plane.yaml index bd0f0241..cc93a1da 100644 --- a/deploy_control_plane.yaml +++ b/deploy_control_plane.yaml @@ -31,12 +31,12 @@ tags: auth - name: metal-roles/control-plane/roles/metal tags: metal - - name: metal-roles/control-plane/roles/logging - when: monitoring_enabled - tags: logging - name: metal-roles/control-plane/roles/monitoring when: monitoring_enabled tags: monitoring + - name: metal-roles/control-plane/roles/logging + when: monitoring_enabled + tags: logging - name: deploy gardener import_playbook: deploy_gardener.yaml diff --git a/inventories/group_vars/partition/monitoring.yaml b/inventories/group_vars/partition/monitoring.yaml index a0624c57..37d5fbd9 100644 --- a/inventories/group_vars/partition/monitoring.yaml +++ b/inventories/group_vars/partition/monitoring.yaml @@ -1,11 +1,2 @@ -monitoring_node_exporter_port: 9100 - -monitoring_blackbox_exporter_port: 9115 - -monitoring_sonic_exporter_port: 9101 - # IPMI should use the same credentials as metal-api monitoring_ipmi_bmc_superuser_pwd: "{{ metal_api_bmc_superuser_pwd }}" - -# alloy metrics -monitoring_alloy_port: 12345 diff --git a/inventories/group_vars/partition/prometheus.yaml b/inventories/group_vars/partition/prometheus.yaml index 8c39ce1d..df9ec6e3 100644 --- a/inventories/group_vars/partition/prometheus.yaml +++ b/inventories/group_vars/partition/prometheus.yaml @@ -1,17 +1,24 @@ --- -# exporters +prometheus_alloy_targets: + - leaf01:12345 + - leaf02:12345 + +prometheus_metal_core_targets: + - leaf01:2112" + - leaf02:2112" +# exporters prometheus_sonic_exporter_targets: - - "leaf01:{{ monitoring_sonic_exporter_port }}" - - "leaf02:{{ monitoring_sonic_exporter_port }}" + - leaf01:9101 + - leaf02:9101 prometheus_blackbox_exporter_targets: - - "leaf01:{{ monitoring_blackbox_exporter_port }}" - - "leaf02:{{ monitoring_blackbox_exporter_port }}" + - leaf01:9115 + - leaf02:9115 prometheus_node_exporter_targets: - - "leaf01:{{ monitoring_node_exporter_port }}" - - "leaf02:{{ monitoring_node_exporter_port }}" + - leaf01:9100 + - leaf02:9100 prometheus_ipmi_exporter_targets: - "{{ hostvars['machine01'].ansible_host }}" @@ -28,8 +35,4 @@ prometheus_hosts_content: | {{ hostvars['leaf01'].ansible_host }} leaf01 {{ hostvars['leaf02'].ansible_host }} leaf02 -prometheus_alloy_targets: - - "leaf01:{{ monitoring_alloy_port }}" - - "leaf02:{{ monitoring_alloy_port }}" - prometheus_haproxy_enabled: false From 7f30f0b8300f7d2ad5a5e8e036dc768aa630935a Mon Sep 17 00:00:00 2001 From: Matthias Hartmann Date: Mon, 27 Jul 2026 15:07:15 +0200 Subject: [PATCH 2/2] fix: make dev-env only after make up as now depending on secret --- .github/workflows/integration.yaml | 1 - Makefile | 4 ++-- test/integration.sh | 2 ++ 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 448a52da..1d0aab09 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -145,7 +145,6 @@ jobs: - name: Run integration tests shell: bash run: | - eval $(make dev-env) ./test/ci-cleanup.sh ./test/integration.sh env: diff --git a/Makefile b/Makefile index dddf589b..837e44bf 100644 --- a/Makefile +++ b/Makefile @@ -427,12 +427,12 @@ build-sonic-base: .PHONY: dev-env dev-env: + @TOKEN=$$(kubectl --kubeconfig=$(KUBECONFIG) get secret -n metal-control-plane metal-apiserver-admin-token --template={{.data.admin_editor_token}} | base64 -d); \ + echo "export METAL_APIV2_TOKEN=$$TOKEN" @echo "export METALCTL_API_URL=${METALCTL_API_URL}" @echo "export METALCTL_HMAC=${METALCTL_HMAC}" @echo "export METAL_APIV2_URL=${METAL_APIV2_URL}" @echo "export KUBECONFIG=$(KUBECONFIG)" - @TOKEN=$$(kubectl --kubeconfig=$(KUBECONFIG) get secret -n metal-control-plane metal-apiserver-admin-token --template={{.data.admin_editor_token}} | base64 -d); \ - echo "export METAL_APIV2_TOKEN=$$TOKEN" build-dell-sonic: if [ ! -f "sonic-vs.img" ]; then \ diff --git a/test/integration.sh b/test/integration.sh index fb51fc0f..90775cf9 100755 --- a/test/integration.sh +++ b/test/integration.sh @@ -4,6 +4,8 @@ set -e echo "Starting mini-lab" make up +eval $(make dev-env) + echo "Waiting for machines to get to waiting state" waiting=$(docker compose run --no-TTY --rm metalctl machine ls | grep Waiting | wc -l) minWaiting=2