From 9ecf48108d06664d0e170fb0c2460abdf1c9c878 Mon Sep 17 00:00:00 2001 From: Edward Cheng Date: Mon, 26 Aug 2024 13:20:07 +1000 Subject: [PATCH] refactor for metallb --- .../metallb-conf/env/k3s-cluster/advertisement.yaml | 10 ++-------- .../metallb-conf/env/k3s-cluster/cluster-ip.yaml | 2 +- .../metallb-conf/env/k3s-cluster/config.json | 4 ++-- .../metallb-conf/env/k3s-cluster/kustomization.yaml | 4 ++-- .../templates/{metallb.yaml => metallb-system.yaml} | 2 +- 5 files changed, 8 insertions(+), 14 deletions(-) rename resources/namespaces/env/k3s-cluster/templates/{metallb.yaml => metallb-system.yaml} (86%) diff --git a/infrastructures/metallb-conf/env/k3s-cluster/advertisement.yaml b/infrastructures/metallb-conf/env/k3s-cluster/advertisement.yaml index dcdd3b6..1a9fa24 100644 --- a/infrastructures/metallb-conf/env/k3s-cluster/advertisement.yaml +++ b/infrastructures/metallb-conf/env/k3s-cluster/advertisement.yaml @@ -2,13 +2,7 @@ apiVersion: metallb.io/v1beta1 kind: L2Advertisement metadata: name: l2-advertisement - namespace: metallb + namespace: metallb-system spec: ipAddressPools: - - k3s-cluster-ips - nodeSelectors: - - matchExpressions: - - key: kubernetes.io/os - operator: In - values: - - linux \ No newline at end of file + - k3s-cluster-ips \ No newline at end of file diff --git a/infrastructures/metallb-conf/env/k3s-cluster/cluster-ip.yaml b/infrastructures/metallb-conf/env/k3s-cluster/cluster-ip.yaml index 9ba1ecf..578726c 100644 --- a/infrastructures/metallb-conf/env/k3s-cluster/cluster-ip.yaml +++ b/infrastructures/metallb-conf/env/k3s-cluster/cluster-ip.yaml @@ -2,7 +2,7 @@ apiVersion: metallb.io/v1beta1 kind: IPAddressPool metadata: name: k3s-cluster-ips - namespace: metallb + namespace: metallb-system spec: addresses: - 192.168.10.100/32 diff --git a/infrastructures/metallb-conf/env/k3s-cluster/config.json b/infrastructures/metallb-conf/env/k3s-cluster/config.json index df65c2a..af85c10 100644 --- a/infrastructures/metallb-conf/env/k3s-cluster/config.json +++ b/infrastructures/metallb-conf/env/k3s-cluster/config.json @@ -1,8 +1,8 @@ { "appName": "metallb-conf", "userGivenName": "metallb-conf", - "namespace": "metallb", - "destNamespace": "metallb", + "namespace": "metallb-system", + "destNamespace": "metallb-system", "destServer": "https://kubernetes.default.svc", "srcPath": "infrastructures/metallb-conf/env/k3s-cluster", "srcRepoURL": "https://github.com/3dwardch3ng/home-cluster-ops.git", diff --git a/infrastructures/metallb-conf/env/k3s-cluster/kustomization.yaml b/infrastructures/metallb-conf/env/k3s-cluster/kustomization.yaml index 1672071..b70fdad 100644 --- a/infrastructures/metallb-conf/env/k3s-cluster/kustomization.yaml +++ b/infrastructures/metallb-conf/env/k3s-cluster/kustomization.yaml @@ -1,5 +1,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - - ./advertisement.yaml - - ./cluster-ip.yaml \ No newline at end of file + - ./cluster-ip.yaml + - ./advertisement.yaml \ No newline at end of file diff --git a/resources/namespaces/env/k3s-cluster/templates/metallb.yaml b/resources/namespaces/env/k3s-cluster/templates/metallb-system.yaml similarity index 86% rename from resources/namespaces/env/k3s-cluster/templates/metallb.yaml rename to resources/namespaces/env/k3s-cluster/templates/metallb-system.yaml index 917148c..b219659 100644 --- a/resources/namespaces/env/k3s-cluster/templates/metallb.yaml +++ b/resources/namespaces/env/k3s-cluster/templates/metallb-system.yaml @@ -4,6 +4,6 @@ metadata: annotations: argocd.argoproj.io/sync-options: Prune=false creationTimestamp: null - name: metallb + name: metallb-system spec: {} status: {}