From f75c1258eed3e9643921055679cef904a89b658c Mon Sep 17 00:00:00 2001 From: Edward Cheng Date: Mon, 15 Jul 2024 01:04:19 +1000 Subject: [PATCH] restructure --- bootstrap/cluster-resources.yaml | 49 ------------------- bootstrap/cluster-resources/in-cluster.json | 1 - .../cluster-resources/in-cluster/README.md | 3 -- .../in-cluster/argocd-ns.yaml | 9 ---- projects/k3s-cluster.yaml | 2 +- bootstrap/root.yaml => root.yaml | 2 +- scripts/3.install-argocd-autopilot.sh | 14 ------ scripts/4.bootstrap-argocd.sh | 4 -- 8 files changed, 2 insertions(+), 82 deletions(-) delete mode 100644 bootstrap/cluster-resources.yaml delete mode 100644 bootstrap/cluster-resources/in-cluster.json delete mode 100644 bootstrap/cluster-resources/in-cluster/README.md delete mode 100644 bootstrap/cluster-resources/in-cluster/argocd-ns.yaml rename bootstrap/root.yaml => root.yaml (92%) delete mode 100644 scripts/3.install-argocd-autopilot.sh delete mode 100644 scripts/4.bootstrap-argocd.sh diff --git a/bootstrap/cluster-resources.yaml b/bootstrap/cluster-resources.yaml deleted file mode 100644 index 4d93d10..0000000 --- a/bootstrap/cluster-resources.yaml +++ /dev/null @@ -1,49 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: ApplicationSet -metadata: - annotations: - argocd.argoproj.io/sync-wave: "0" - creationTimestamp: null - name: cluster-resources - namespace: argocd -spec: - generators: - - git: - files: - - path: bootstrap/cluster-resources/*.json - repoURL: https://github.com/3dwardch3ng/home-cluster-ops.git - requeueAfterSeconds: 20 - revision: "" - template: - metadata: {} - spec: - destination: {} - project: "" - source: - repoURL: "" - syncPolicy: - preserveResourcesOnDeletion: true - template: - metadata: - labels: - app.kubernetes.io/managed-by: argocd-autopilot - app.kubernetes.io/name: cluster-resources-{{name}} - name: cluster-resources-{{name}} - namespace: argocd - spec: - destination: - server: '{{server}}' - ignoreDifferences: - - group: argoproj.io - jsonPointers: - - /status - kind: Application - project: default - source: - path: bootstrap/cluster-resources/{{name}} - repoURL: https://github.com/3dwardch3ng/home-cluster-ops.git - syncPolicy: - automated: - allowEmpty: true - selfHeal: true -status: {} \ No newline at end of file diff --git a/bootstrap/cluster-resources/in-cluster.json b/bootstrap/cluster-resources/in-cluster.json deleted file mode 100644 index 259083a..0000000 --- a/bootstrap/cluster-resources/in-cluster.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"in-cluster","server":"https://kubernetes.default.svc"} \ No newline at end of file diff --git a/bootstrap/cluster-resources/in-cluster/README.md b/bootstrap/cluster-resources/in-cluster/README.md deleted file mode 100644 index 279f224..0000000 --- a/bootstrap/cluster-resources/in-cluster/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Cluster Resources -This directory contains all cluster resources that should be applied to cluster: `in-cluster`. -For example `Namespace` resources that are shared by multiple applications on the same namespace. \ No newline at end of file diff --git a/bootstrap/cluster-resources/in-cluster/argocd-ns.yaml b/bootstrap/cluster-resources/in-cluster/argocd-ns.yaml deleted file mode 100644 index b16706d..0000000 --- a/bootstrap/cluster-resources/in-cluster/argocd-ns.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - annotations: - argocd.argoproj.io/sync-options: Prune=false - creationTimestamp: null - name: argocd -spec: {} -status: {} \ No newline at end of file diff --git a/projects/k3s-cluster.yaml b/projects/k3s-cluster.yaml index 4ec7b75..6ff861a 100644 --- a/projects/k3s-cluster.yaml +++ b/projects/k3s-cluster.yaml @@ -68,7 +68,7 @@ spec: template: metadata: labels: - app.kubernetes.io/managed-by: argocd-autopilot + app.kubernetes.io/managed-by: argocd app.kubernetes.io/name: '{{ appName }}' name: k3s-cluster-{{ userGivenName }} namespace: argocd diff --git a/bootstrap/root.yaml b/root.yaml similarity index 92% rename from bootstrap/root.yaml rename to root.yaml index a5802a6..b1f4577 100644 --- a/bootstrap/root.yaml +++ b/root.yaml @@ -5,7 +5,7 @@ metadata: finalizers: - resources-finalizer.argocd.argoproj.io labels: - app.kubernetes.io/managed-by: argocd-autopilot + app.kubernetes.io/managed-by: argocd app.kubernetes.io/name: root name: root namespace: argocd diff --git a/scripts/3.install-argocd-autopilot.sh b/scripts/3.install-argocd-autopilot.sh deleted file mode 100644 index 044221d..0000000 --- a/scripts/3.install-argocd-autopilot.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -set -e - -# get the latest version or change to a specific version -VERSION=$(curl --silent "https://api.github.com/repos/argoproj-labs/argocd-autopilot/releases/latest" | grep '"tag_name"' | sed -E 's/.*"([^"]+)".*/\1/') - -# download and extract the binary -curl -L --output - https://github.com/argoproj-labs/argocd-autopilot/releases/download/"$VERSION"/argocd-autopilot-linux-arm64.tar.gz | tar zx - -# move the binary to your $PATH -mv ./argocd-autopilot-* /usr/local/bin/argocd-autopilot - -# check the installation -argocd-autopilot version \ No newline at end of file diff --git a/scripts/4.bootstrap-argocd.sh b/scripts/4.bootstrap-argocd.sh deleted file mode 100644 index 92d3a7a..0000000 --- a/scripts/4.bootstrap-argocd.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -set -e - -argocd-autopilot repo bootstrap --app https://github.com/argoproj-labs/argocd-autopilot/manifests/ha \ No newline at end of file