From 5eeba518a9621d6ef87a5da47d89f4debea66c48 Mon Sep 17 00:00:00 2001 From: Dreaded_X Date: Tue, 2 Dec 2025 02:18:46 +0100 Subject: [PATCH] Added cluster variables for flux substitutions --- nodes/_defaults.yaml | 1 + nodes/testing/_defaults.yaml | 1 + nodes/titan/_defaults.yaml | 1 + patches/cluster-variables.yaml | 16 ++++++++++++++++ 4 files changed, 19 insertions(+) create mode 100644 patches/cluster-variables.yaml diff --git a/nodes/_defaults.yaml b/nodes/_defaults.yaml index 4b17c1b..0ddfc74 100644 --- a/nodes/_defaults.yaml +++ b/nodes/_defaults.yaml @@ -32,3 +32,4 @@ patches: patchesControlPlane: - !patch allow-control-plane-workloads - !patch sops + - !patch cluster-variables diff --git a/nodes/testing/_defaults.yaml b/nodes/testing/_defaults.yaml index 080b997..fcd8eb1 100644 --- a/nodes/testing/_defaults.yaml +++ b/nodes/testing/_defaults.yaml @@ -4,6 +4,7 @@ installDisk: /dev/vda autoInstall: true cluster: name: testing + production: false controlPlaneIp: 192.168.1.100 secretsFile: !realpath _secrets.yaml sopsKeyFile: !realpath _age.agekey diff --git a/nodes/titan/_defaults.yaml b/nodes/titan/_defaults.yaml index 816b841..7e30017 100644 --- a/nodes/titan/_defaults.yaml +++ b/nodes/titan/_defaults.yaml @@ -3,6 +3,7 @@ gateway: 10.0.0.1 installDisk: /dev/sda cluster: name: titan + production: true controlPlaneIp: 10.0.2.1 secretsFile: !realpath _secrets.yaml sopsKeyFile: !realpath _age.agekey diff --git a/patches/cluster-variables.yaml b/patches/cluster-variables.yaml new file mode 100644 index 0000000..190d325 --- /dev/null +++ b/patches/cluster-variables.yaml @@ -0,0 +1,16 @@ +cluster: + inlineManifests: + - name: cluster-variables + contents: | + apiVersion: v1 + kind: Namespace + metadata: + name: flux-system + --- + apiVersion: v1 + kind: ConfigMap + metadata: + name: cluster-variables + namespace: flux-system + data: + cluster_env: {%- if node.cluster.production %} production {%- else %} staging {%- endif %}