From 2a1c9513a03a7bc8123c5bedcfe9163c8e7ed45d Mon Sep 17 00:00:00 2001 From: Kat Inskip Date: Sat, 20 Jan 2024 16:13:39 -0800 Subject: [PATCH] ops(k8s): init metallb, move cloudflare-operator to follow same layout --- k8s/bootstrap/bootstrap.sh | 6 ++--- .../cloudflare-operator-app/application.yaml | 14 ----------- .../cloudflare-operator/application.yaml | 17 ++++++++++++++ .../cloudflare-operator/kustomization.yaml | 3 +-- .../manifests}/kustomization.yaml | 2 +- .../{ => manifests}/sopssecret.yaml | 0 .../local-path-provisioner/application.yaml | 2 +- k8s/system/metallb/application.yaml | 23 +++++++++++++++++++ .../metallb/manifests/ipaddresspool.yaml | 8 +++++++ .../metallb/manifests/l2advertisement.yaml | 5 ++++ 10 files changed, 59 insertions(+), 21 deletions(-) delete mode 100644 k8s/system/cloudflare-operator-app/application.yaml create mode 100644 k8s/system/cloudflare-operator/application.yaml rename k8s/system/{cloudflare-operator-app => cloudflare-operator/manifests}/kustomization.yaml (80%) rename k8s/system/cloudflare-operator/{ => manifests}/sopssecret.yaml (100%) create mode 100644 k8s/system/metallb/application.yaml create mode 100644 k8s/system/metallb/manifests/ipaddresspool.yaml create mode 100644 k8s/system/metallb/manifests/l2advertisement.yaml diff --git a/k8s/bootstrap/bootstrap.sh b/k8s/bootstrap/bootstrap.sh index a6fe9db0..bdfb358d 100755 --- a/k8s/bootstrap/bootstrap.sh +++ b/k8s/bootstrap/bootstrap.sh @@ -10,11 +10,11 @@ helm --namespace=kube-system install coredns coredns/coredns --set service.clust echo "Installing ArgoCD (GitOps)" helm repo add argo https://argoproj.github.io/argo-helm helm install argocd argo/argo-cd --namespace argocd --create-namespace -echo "Generating an age keyfile for sops-secrets-operator, the next line will be the public key, please add it to .sops.yaml" -rage-keygen -o keys.txt 2>&1 | awk '{ print $3 }' +echo "Installing sops-secrets-operator" +#echo "Generating an age keyfile for sops-secrets-operator, the next line will be the public key, please add it to .sops.yaml" +#rage-keygen -o keys.txt 2>&1 | awk '{ print $3 }' kubectl create ns sops kubectl create secret generic sops-age-key-file --from-file=keys.txt -o yaml --dry-run=client -n sops > sops-age-key-file.yaml kubectl apply -f sops-age-key-file.yaml -n sops -echo "Installing sops-secrets-operator" helm repo add sops-secrets-operator https://inloco.github.io/sops-secrets-operator helm install sops-secrets-operator sops-secrets-operator/sops-secrets-operator --namespace sops --values sops-values.yaml \ No newline at end of file diff --git a/k8s/system/cloudflare-operator-app/application.yaml b/k8s/system/cloudflare-operator-app/application.yaml deleted file mode 100644 index 194c8cc9..00000000 --- a/k8s/system/cloudflare-operator-app/application.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: cloudflare-operator-app - namespace: argocd -spec: - destination: - namespace: cloudflare-operator-system - name: in-cluster - project: system - source: - repoURL: "https://github.com/gensokyo-zone/infrastructure" - path: k8s/system/cloudflare-operator - targetRevision: main \ No newline at end of file diff --git a/k8s/system/cloudflare-operator/application.yaml b/k8s/system/cloudflare-operator/application.yaml new file mode 100644 index 00000000..11218933 --- /dev/null +++ b/k8s/system/cloudflare-operator/application.yaml @@ -0,0 +1,17 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: cloudflare-operator-app + namespace: argocd +spec: + destination: + namespace: cloudflare-operator-system + name: in-cluster + project: system + sources: + - repoURL: "https://github.com/gensokyo-zone/infrastructure" + path: k8s/system/cloudflare-operator/manifests + targetRevision: main + - repoURL: "https://github.com/adyanth/cloudflare-operator" + path: config/default + targetRevision: v0.10.2 \ No newline at end of file diff --git a/k8s/system/cloudflare-operator/kustomization.yaml b/k8s/system/cloudflare-operator/kustomization.yaml index 2de0f20e..0b082ba2 100644 --- a/k8s/system/cloudflare-operator/kustomization.yaml +++ b/k8s/system/cloudflare-operator/kustomization.yaml @@ -1,5 +1,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: -- https://github.com/adyanth/cloudflare-operator.git//config/default?ref=v0.10.2 -- sopssecret.yaml \ No newline at end of file +- application.yaml \ No newline at end of file diff --git a/k8s/system/cloudflare-operator-app/kustomization.yaml b/k8s/system/cloudflare-operator/manifests/kustomization.yaml similarity index 80% rename from k8s/system/cloudflare-operator-app/kustomization.yaml rename to k8s/system/cloudflare-operator/manifests/kustomization.yaml index 0b082ba2..dac56f7d 100644 --- a/k8s/system/cloudflare-operator-app/kustomization.yaml +++ b/k8s/system/cloudflare-operator/manifests/kustomization.yaml @@ -1,4 +1,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: -- application.yaml \ No newline at end of file +- sopssecret.yaml \ No newline at end of file diff --git a/k8s/system/cloudflare-operator/sopssecret.yaml b/k8s/system/cloudflare-operator/manifests/sopssecret.yaml similarity index 100% rename from k8s/system/cloudflare-operator/sopssecret.yaml rename to k8s/system/cloudflare-operator/manifests/sopssecret.yaml diff --git a/k8s/system/local-path-provisioner/application.yaml b/k8s/system/local-path-provisioner/application.yaml index 4972405e..6b573bde 100644 --- a/k8s/system/local-path-provisioner/application.yaml +++ b/k8s/system/local-path-provisioner/application.yaml @@ -2,7 +2,7 @@ apiVersion: argoproj.io/v1alpha1 kind: Application metadata: name: local-path-provisioner - namespace: kube-system + namespace: argocd spec: project: system source: diff --git a/k8s/system/metallb/application.yaml b/k8s/system/metallb/application.yaml new file mode 100644 index 00000000..368cd678 --- /dev/null +++ b/k8s/system/metallb/application.yaml @@ -0,0 +1,23 @@ +https://metallb.github.io/metallb +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: metallb + namespace: argocd +spec: + project: system + sources: + - repoURL: "https://metallb.github.io/metallb" + targetRevision: v26.0.x + chart: metallb + helm: + valuesObject: + - repoURL: "https://github.com/gensokyo-zone/infrastructure" + path: k8s/system/metallb/manifests + targetRevision: main + destination: + namespace: metallb-system + name: in-cluster + syncPolicy: + syncOptions: + - ServerSideApply=true \ No newline at end of file diff --git a/k8s/system/metallb/manifests/ipaddresspool.yaml b/k8s/system/metallb/manifests/ipaddresspool.yaml new file mode 100644 index 00000000..0824abc4 --- /dev/null +++ b/k8s/system/metallb/manifests/ipaddresspool.yaml @@ -0,0 +1,8 @@ +apiVersion: metallb.io/v1beta1 +kind: IPAddressPool +metadata: + name: lan-services + namespace: metallb-system +spec: + addresses: + - 10.69.0.0/16 \ No newline at end of file diff --git a/k8s/system/metallb/manifests/l2advertisement.yaml b/k8s/system/metallb/manifests/l2advertisement.yaml new file mode 100644 index 00000000..eefbaf12 --- /dev/null +++ b/k8s/system/metallb/manifests/l2advertisement.yaml @@ -0,0 +1,5 @@ +apiVersion: metallb.io/v1beta1 +kind: L2Advertisement +metadata: + name: l2 + namespace: metallb-system \ No newline at end of file