Skip to content

Commit 2aaacd2

Browse files
authored
Deploy monitoring in mini-lab (#275)
1 parent 1a7c273 commit 2aaacd2

File tree

18 files changed

+260
-112
lines changed

18 files changed

+260
-112
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ MAX_RETRIES := 30
3030
# Machine flavors
3131
ifeq ($(MINI_LAB_FLAVOR),sonic)
3232
LAB_TOPOLOGY=mini-lab.sonic.yaml
33+
MONITORING_ENABLED=true
3334
else ifeq ($(MINI_LAB_FLAVOR),dell_sonic)
3435
LAB_TOPOLOGY=mini-lab.dell_sonic.yaml
3536
MINI_LAB_SONIC_IMAGE=r.metal-stack.io/vrnetlab/dell_sonic:$(MINI_LAB_DELL_SONIC_VERSION)

compose.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ services:
2121
- DOCKER_HUB_USER=${DOCKER_HUB_USER}
2222
- DOCKER_HUB_TOKEN=${DOCKER_HUB_TOKEN}
2323
- GARDENER_ENABLED=${GARDENER_ENABLED:-}
24+
- MONITORING_ENABLED=${MONITORING_ENABLED:-}
2425
network_mode: host
2526
working_dir: /mini-lab
2627
entrypoint:
@@ -48,6 +49,7 @@ services:
4849
- CI=${CI}
4950
- DOCKER_HUB_USER=${DOCKER_HUB_USER}
5051
- DOCKER_HUB_TOKEN=${DOCKER_HUB_TOKEN}
52+
- MONITORING_ENABLED=${MONITORING_ENABLED:-}
5153
network_mode: host
5254
working_dir: /mini-lab
5355
entrypoint:

control-plane/kind.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,12 @@ nodes:
1111
extraPortMappings:
1212
- containerPort: 4443
1313
hostPort: 4443
14-
listenAddress: 0.0.0.0
1514
- containerPort: 8080
1615
hostPort: 8080
17-
listenAddress: 0.0.0.0
1816
- containerPort: 4150
1917
hostPort: 4150
20-
listenAddress: 0.0.0.0
2118
- containerPort: 50051
2219
hostPort: 50051
23-
listenAddress: 0.0.0.0
2420
# if you want to run gardener operator + metal-stack, you need more pods
2521
kubeadmConfigPatches:
2622
- |

deploy_control_plane.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@
3131
tags: auth
3232
- name: metal-roles/control-plane/roles/metal
3333
tags: metal
34+
- name: metal-roles/control-plane/roles/logging
35+
when: monitoring_enabled
36+
tags: logging
37+
- name: metal-roles/control-plane/roles/monitoring
38+
when: monitoring_enabled
39+
tags: monitoring
3440

3541
- name: deploy gardener
3642
import_playbook: deploy_gardener.yaml

deploy_partition.yaml

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,46 @@
8787
- name: metal-roles/partition/roles/pixiecore
8888
tags: pixiecore
8989

90+
- name: Deploy monitoring on leaf01
91+
hosts: leaf01
92+
become: true
93+
roles:
94+
- name: ansible-common
95+
tags: always
96+
- name: metal-roles/partition/roles/monitoring/prometheus
97+
when: monitoring_enabled
98+
tags: prometheus
99+
- name: metal-roles/partition/roles/monitoring/ipmi-exporter
100+
when: monitoring_enabled
101+
tags: ipmi-exporter
102+
103+
- name: Deploy monitoring on leaves
104+
hosts: leaves
105+
become: true
106+
roles:
107+
- name: ansible-common
108+
tags: always
109+
- name: metal-roles/partition/roles/promtail
110+
when: monitoring_enabled
111+
tags: promtail
112+
- name: metal-roles/partition/roles/monitoring/node-exporter
113+
when: monitoring_enabled
114+
tags: node-exporter
115+
- name: metal-roles/partition/roles/monitoring/blackbox-exporter
116+
when: monitoring_enabled
117+
tags: blackbox-exporter
118+
- name: metal-roles/partition/roles/monitoring/sonic-exporter
119+
when: monitoring_enabled
120+
tags: sonic-exporter
121+
90122
- name: Deploy metal-core
91123
hosts: leaves
92124
any_errors_fatal: true
93125
become: true
94126
pre_tasks:
95-
- name: Wait some time
96-
pause:
97-
seconds: 120
127+
- name: Wait some time
128+
pause:
129+
seconds: 120
98130
roles:
99131
- name: ansible-common
100132
tags: always
@@ -130,8 +162,8 @@
130162
any_errors_fatal: true
131163
gather_facts: false
132164
pre_tasks:
133-
- name: Wait until no route entries have "queued"
134-
include_tasks: tasks/check_queued.yaml
165+
- name: Wait until no route entries have "queued"
166+
include_tasks: tasks/check_queued.yaml
135167

136168
- name: Configure IPv6 and LLDP ports (Enterprise SONiC)
137169
hosts: dell_sonic
@@ -141,7 +173,7 @@
141173
- name: Enable IPv6 to also have LLA at VLAN interfaces
142174
sysctl:
143175
name: net.ipv6.conf.default.disable_ipv6
144-
value: '0'
176+
value: "0"
145177
state: present
146178
sysctl_file: /etc/sysctl.conf
147179
- name: Configure LLDP port IDs and descriptions

inventories/group_vars/all/control_plane.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,7 @@ metal_control_plane_namespace: metal-control-plane
66
metal_control_plane_image_pull_policy: Always
77

88
helm_additional_params:
9-
- '--debug'
9+
- "--debug"
10+
11+
# needs to be in all -> paritition and control-plane
12+
metal_api_bmc_superuser_pwd: change-me
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
monitoring_enabled: "{{ lookup('env', 'MONITORING_ENABLED') | default('', false) }}"

inventories/group_vars/all/release_vector.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ metal_stack_release_vectors:
66
variable_mapping_path: metal_stack_release.mapping
77
include_role_defaults: metal-roles/common/roles/defaults
88
oci_cosign_verify_key: "{{ lookup('file', 'cosign.pub') }}"
9-
109
##
1110
## for development purposes, you can override releases from our image vector here
1211
##
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
logging_ingress_loki_tls: no

inventories/group_vars/control-plane/metal.yml

Lines changed: 102 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,16 @@ metal_set_resource_limits: no
33
metal_check_api_health_endpoint: http://api.{{ metal_control_plane_ingress_dns }}:8080/metal/v1/health
44
metal_api_headscale_control_plane_address: "http://headscale.{{ metal_control_plane_ingress_dns }}:8080"
55

6+
metal_api_pdb_min_available: 1
67
metal_api_replicas: 1
78
metal_api_view_key: metal-view
89
metal_api_edit_key: metal-edit
910
metal_api_admin_key: metal-admin
1011

1112
metal_api_nsq_tcp_address: nsqd:4150
1213

14+
metal_apiserver_pdb_min_available: 1
15+
1316
metal_apiserver_enabled: true
1417
metal_apiserver_url: http://v2.api.{{ metal_control_plane_ingress_dns }}:8080
1518

@@ -21,39 +24,39 @@ metal_apiserver_redis_password: change-me-soon
2124
metal_apiserver_admin_subjects: "[email protected]@openid-connect"
2225

2326
metal_api_images:
24-
- id: firewall-ubuntu-3.0
25-
name: Firewall 3 Ubuntu
26-
description: Firewall 3 Ubuntu Latest Release
27-
url: https://images.metal-stack.io/metal-os/stable/firewall/3.0-ubuntu/img.tar.lz4
28-
features:
29-
- firewall
30-
- id: ubuntu-24.4
31-
name: Ubuntu 24.04
32-
description: Ubuntu 24.04 Latest Release
33-
url: https://images.metal-stack.io/metal-os/stable/ubuntu/24.04/img.tar.lz4
34-
features:
35-
- machine
36-
- id: debian-12.0
37-
name: Debian 12
38-
description: Debian 12 Latest Release
39-
url: https://images.metal-stack.io/metal-os/stable/debian/12/img.tar.lz4
40-
features:
41-
- machine
27+
- id: firewall-ubuntu-3.0
28+
name: Firewall 3 Ubuntu
29+
description: Firewall 3 Ubuntu Latest Release
30+
url: https://images.metal-stack.io/metal-os/stable/firewall/3.0-ubuntu/img.tar.lz4
31+
features:
32+
- firewall
33+
- id: ubuntu-24.4
34+
name: Ubuntu 24.04
35+
description: Ubuntu 24.04 Latest Release
36+
url: https://images.metal-stack.io/metal-os/stable/ubuntu/24.04/img.tar.lz4
37+
features:
38+
- machine
39+
- id: debian-12.0
40+
name: Debian 12
41+
description: Debian 12 Latest Release
42+
url: https://images.metal-stack.io/metal-os/stable/debian/12/img.tar.lz4
43+
features:
44+
- machine
4245

4346
metal_api_sizes:
44-
- id: v1-small-x86
45-
name: v1-small-x86
46-
description: The Tiny Virtual
47-
constraints:
48-
- type: cores
49-
min: 1
50-
max: 4
51-
- type: memory
52-
min: "{{ '500MB' | humanfriendly }}"
53-
max: "{{ '4GB' | humanfriendly }}"
54-
- type: storage
55-
min: "{{ '1GB' | humanfriendly }}"
56-
max: "{{ '100GB' | humanfriendly }}"
47+
- id: v1-small-x86
48+
name: v1-small-x86
49+
description: The Tiny Virtual
50+
constraints:
51+
- type: cores
52+
min: 1
53+
max: 4
54+
- type: memory
55+
min: "{{ '500MB' | humanfriendly }}"
56+
max: "{{ '4GB' | humanfriendly }}"
57+
- type: storage
58+
min: "{{ '1GB' | humanfriendly }}"
59+
max: "{{ '100GB' | humanfriendly }}"
5760

5861
metal_api_partitions:
5962
- id: mini-lab
@@ -66,61 +69,61 @@ metal_api_partitions:
6669
privatenetworkprefixlength: 22
6770

6871
metal_api_networks:
69-
- id: tenant-super-network-mini-lab
70-
name: "Project Super Network"
71-
description: "Super network of all project networks"
72-
nat: false
73-
privatesuper: true
74-
underlay: false
75-
destinationprefixes: []
76-
partitionid: mini-lab
77-
defaultchildprefixlength:
78-
IPv4: 22
79-
IPv6: 96
80-
prefixes:
81-
- 10.0.0.0/16
82-
- 2001:db8:0:10::/64
83-
additionalAnnouncableCIDRs:
84-
- 10.240.0.0/12
85-
- id: internet-mini-lab
86-
name: "Virtual Internet Network"
87-
description: "Virtual Internet Network for mini-lab"
88-
nat: true
89-
privatesuper: false
90-
underlay: false
91-
destinationprefixes:
92-
- 0.0.0.0/0
93-
- ::/0
94-
partitionid: "mini-lab"
95-
vrf: 104009
96-
prefixes:
97-
- 203.0.113.128/25
98-
- 2001:db8:0:113::/64
99-
labels:
100-
network.metal-stack.io/default: ""
101-
network.metal-stack.io/default-external: ""
102-
- id: underlay-mini-lab
103-
name: "Underlay Network"
104-
description: "Underlay Network for mini-lab"
105-
nat: false
106-
privatesuper: false
107-
underlay: true
108-
destinationprefixes: []
109-
partitionid: "mini-lab"
110-
prefixes:
111-
- 10.1.0.0/24
72+
- id: tenant-super-network-mini-lab
73+
name: "Project Super Network"
74+
description: "Super network of all project networks"
75+
nat: false
76+
privatesuper: true
77+
underlay: false
78+
destinationprefixes: []
79+
partitionid: mini-lab
80+
defaultchildprefixlength:
81+
IPv4: 22
82+
IPv6: 96
83+
prefixes:
84+
- 10.0.0.0/16
85+
- 2001:db8:0:10::/64
86+
additionalAnnouncableCIDRs:
87+
- 10.240.0.0/12
88+
- id: internet-mini-lab
89+
name: "Virtual Internet Network"
90+
description: "Virtual Internet Network for mini-lab"
91+
nat: true
92+
privatesuper: false
93+
underlay: false
94+
destinationprefixes:
95+
- 0.0.0.0/0
96+
- ::/0
97+
partitionid: "mini-lab"
98+
vrf: 104009
99+
prefixes:
100+
- 203.0.113.128/25
101+
- 2001:db8:0:113::/64
102+
labels:
103+
network.metal-stack.io/default: ""
104+
network.metal-stack.io/default-external: ""
105+
- id: underlay-mini-lab
106+
name: "Underlay Network"
107+
description: "Underlay Network for mini-lab"
108+
nat: false
109+
privatesuper: false
110+
underlay: true
111+
destinationprefixes: []
112+
partitionid: "mini-lab"
113+
prefixes:
114+
- 10.1.0.0/24
112115

113116
metal_api_ips:
114-
- name: "reserve v4"
115-
description: "Reserve IPv4 (for testing purposes)"
116-
networkid: internet-mini-lab
117-
projectid: 00000000-0000-0000-0000-000000000000
118-
ipaddress: "203.0.113.142"
119-
- name: "reserve v6"
120-
description: "Reserve IPv6 (for testing purposes)"
121-
networkid: internet-mini-lab
122-
projectid: 00000000-0000-0000-0000-000000000000
123-
ipaddress: "2001:db8:0:113::142"
117+
- name: "reserve v4"
118+
description: "Reserve IPv4 (for testing purposes)"
119+
networkid: internet-mini-lab
120+
projectid: 00000000-0000-0000-0000-000000000000
121+
ipaddress: "203.0.113.142"
122+
- name: "reserve v6"
123+
description: "Reserve IPv6 (for testing purposes)"
124+
networkid: internet-mini-lab
125+
projectid: 00000000-0000-0000-0000-000000000000
126+
ipaddress: "2001:db8:0:113::142"
124127

125128
metal_masterdata_api_tls_ca: "{{ lookup('file', 'certs/ca.pem') }}"
126129
metal_masterdata_api_tls_cert: "{{ lookup('file', 'certs/masterdata-api/server.pem') }}"
@@ -132,23 +135,23 @@ metal_masterdata_api_tls_client_key: "{{ lookup('file', 'certs/masterdata-api/cl
132135
metal_masterdata_api_port: 8445
133136

134137
metal_masterdata_api_tenants:
135-
- meta:
136-
id: metal-stack
137-
kind: Tenant
138-
apiversion: v1
139-
version: 0
140-
name: metal-stack
141-
iam_config:
142-
description: metal-stack tenant, which is provider
138+
- meta:
139+
id: metal-stack
140+
kind: Tenant
141+
apiversion: v1
142+
version: 0
143+
name: metal-stack
144+
iam_config:
145+
description: metal-stack tenant, which is provider
143146

144147
metal_masterdata_api_projects:
145-
- meta:
146-
id: 00000000-0000-0000-0000-000000000001
147-
kind: Project
148-
apiversion: v1
149-
version: 0
150-
name: sample-project
151-
description: Sample project with static id
148+
- meta:
149+
id: 00000000-0000-0000-0000-000000000001
150+
kind: Project
151+
apiversion: v1
152+
version: 0
153+
name: sample-project
154+
description: Sample project with static id
152155

153156
metal_console_enabled: false
154157

0 commit comments

Comments
 (0)