From f75c1258eed3e9643921055679cef904a89b658c Mon Sep 17 00:00:00 2001 From: Edward Cheng Date: Mon, 15 Jul 2024 01:04:19 +1000 Subject: [PATCH 1/2] 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 From 0987ba5f5c5b347427e1ecd7f3f68636b313965d Mon Sep 17 00:00:00 2001 From: Edward Cheng Date: Mon, 15 Jul 2024 01:05:30 +1000 Subject: [PATCH 2/2] restructure --- apps/README.md | 27 --------------------------- projects/k3s-cluster.yaml | 4 ---- 2 files changed, 31 deletions(-) delete mode 100644 apps/README.md diff --git a/apps/README.md b/apps/README.md deleted file mode 100644 index a7ef689..0000000 --- a/apps/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# Apps -This directory contains all of the applications you installed by using: -```bash -argocd-autopilot app create --app -p -``` - -## Application Types -> If you don't specify the application `--type` argocd-autopilot will try to clone the source repository and infer the application type [automatically](https://argoproj.github.io/argo-cd/user-guide/tool_detection/#tool-detection) - -* ### Directory application - Such an application references a specific directory at a given repo URL, path and revision. It will be persisted in the GitOps Repository as a single file at `apps///config.json`. - #### Example: - ```bash - argocd-autopilot app create dir-example --app github.com/argoproj-labs/argocd-autopilot/examples/demo-dir/ -p --type dir - ``` - -* ### Kustomize application - A Kustomize application will have exactly one: `apps//base/kustomization.yaml` file, and one or more `apps//overlays//` folders. - - The `apps//base/kustomization.yaml` file is created the first time you create the application. The `apps//overlays//` folder is created for each project you install this application on. So all overlays of the same application are using the same base `kustomization.yaml`. - #### Example: - Try running the following command: - ```bash - argocd-autopilot app create hello-world --app github.com/argoproj-labs/argocd-autopilot/examples/demo-app/ -p --type kustomize - ``` - -###### * If you did not create a project yet take a look at: [creating a project](https://argocd-autopilot.readthedocs.io/en/stable/Getting-Started/#add-a-project-and-an-application). \ No newline at end of file diff --git a/projects/k3s-cluster.yaml b/projects/k3s-cluster.yaml index 6ff861a..e3da7f1 100644 --- a/projects/k3s-cluster.yaml +++ b/projects/k3s-cluster.yaml @@ -1,10 +1,6 @@ apiVersion: argoproj.io/v1alpha1 kind: AppProject metadata: - annotations: - argocd-autopilot.argoproj-labs.io/default-dest-server: https://kubernetes.default.svc - argocd.argoproj.io/sync-options: PruneLast=true - argocd.argoproj.io/sync-wave: "-2" creationTimestamp: null name: k3s-cluster namespace: argocd