Skip to content

Commit b9a9cac

Browse files
authored
Additional ingress config and allow passing extra vars (#98)
1 parent 86bf872 commit b9a9cac

File tree

7 files changed

+18
-2
lines changed

7 files changed

+18
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ clab-mini-lab
77
ansible-common
88
metal-hammer*
99
requirements.yaml
10+
.extra_vars.yaml

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ KUBECONFIG := $(shell pwd)/.kubeconfig
99
# Default values
1010
DOCKER_COMPOSE_OVERRIDE=
1111

12+
# extra vars can be used by projects that built on the mini-lab, which want to override default configuration
13+
ANSIBLE_EXTRA_VARS_FILE := $(or $(ANSIBLE_EXTRA_VARS_FILE),)
14+
1215
MINI_LAB_FLAVOR := $(or $(MINI_LAB_FLAVOR),default)
1316
MINI_LAB_VM_IMAGE := $(or $(MINI_LAB_VM_IMAGE),ghcr.io/metal-stack/mini-lab-vms:latest)
1417

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ services:
3838
ansible-galaxy install --ignore-errors -r requirements.yaml
3939
ansible-playbook \
4040
-i inventories/control-plane.yaml \
41-
deploy_control_plane.yaml
41+
deploy_control_plane.yaml --extra-vars "@.extra_vars.yaml"
4242
4343
partition:
4444
image: ghcr.io/metal-stack/metal-deployment-base:${DEPLOYMENT_BASE_IMAGE_TAG}
@@ -73,7 +73,7 @@ services:
7373
ansible-playbook \
7474
-i inventories/partition.yaml \
7575
-i clab-mini-lab/ansible-inventory.yml \
76-
deploy_partition.yaml
76+
deploy_partition.yaml --extra-vars "@.extra_vars.yaml"
7777
7878
metalctl:
7979
image: ghcr.io/metal-stack/metalctl:${METALCTL_IMAGE_TAG}

env.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ RELEASE_YAML=$(curl -s https://raw.githubusercontent.com/metal-stack/releases/${
1313
METALCTL_IMAGE_TAG=$(yq_shell "echo \"${RELEASE_YAML}\" | yq r - docker-images.metal-stack.control-plane.metalctl.tag")
1414
DEPLOYMENT_BASE_IMAGE_TAG=$(yq_shell "echo \"${RELEASE_YAML}\" | yq r - docker-images.metal-stack.generic.deployment-base.tag")
1515

16+
echo "{}" > .extra_vars.yaml
17+
if [ ! -z ${ANSIBLE_EXTRA_VARS_FILE} ]; then
18+
cat ${ANSIBLE_EXTRA_VARS_FILE} > .extra_vars.yaml || echo "{}" > .extra_vars.yaml
19+
fi
20+
1621
cat << EOF > .env
1722
METALCTL_IMAGE_TAG=${METALCTL_IMAGE_TAG}
1823
DEPLOYMENT_BASE_IMAGE_TAG=${DEPLOYMENT_BASE_IMAGE_TAG}

inventories/group_vars/control-plane/metal.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ metal_api_networks:
7373
vrf: 104009
7474
prefixes:
7575
- 100.255.254.0/24
76+
labels:
77+
network.metal-stack.io/default: ""
78+
network.metal-stack.io/default-external: ""
7679
- id: underlay-mini-lab
7780
name: "Underlay Network"
7881
description: "Underlay Network for mini-lab"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
---
22
ingress_http_port: 8080
33
ingress_https_port: 4443
4+
5+
ingress_additional_config: {}

roles/ingress-controller/templates/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ controller:
2929
metrics:
3030
enabled: false
3131

32+
config: {{ ingress_additional_config | to_json }}
33+
3234
tcp:
3335
4161: "{{ metal_control_plane_namespace }}/nsq-lookupd:4161"
3436
4150: "{{ metal_control_plane_namespace }}/nsqd:4150"

0 commit comments

Comments
 (0)