From de0fabd0b1f1d36153e7dd0121a2f98dc352e742 Mon Sep 17 00:00:00 2001 From: Sebastian Mark Date: Tue, 3 Sep 2024 21:31:40 +0200 Subject: [PATCH] refactor(argocd): split bootstrap files - rename bootstrap files for clarification - remove project and application from argocd-apps values - add new YAML for project configuration - add new YAML for application configuration --- .../{001-argocd.yml => 001-helm-argocd.yml} | 0 argocd-bootstrap/002-argocd-apps.yml | 50 ------------------- argocd-bootstrap/002-helm-argocd-apps.yml | 12 +++++ argocd-bootstrap/003-baseline-project.yml | 17 +++++++ argocd-bootstrap/004-baseline-app.yml | 25 ++++++++++ 5 files changed, 54 insertions(+), 50 deletions(-) rename argocd-bootstrap/{001-argocd.yml => 001-helm-argocd.yml} (100%) delete mode 100644 argocd-bootstrap/002-argocd-apps.yml create mode 100644 argocd-bootstrap/002-helm-argocd-apps.yml create mode 100644 argocd-bootstrap/003-baseline-project.yml create mode 100644 argocd-bootstrap/004-baseline-app.yml diff --git a/argocd-bootstrap/001-argocd.yml b/argocd-bootstrap/001-helm-argocd.yml similarity index 100% rename from argocd-bootstrap/001-argocd.yml rename to argocd-bootstrap/001-helm-argocd.yml diff --git a/argocd-bootstrap/002-argocd-apps.yml b/argocd-bootstrap/002-argocd-apps.yml deleted file mode 100644 index e88b761..0000000 --- a/argocd-bootstrap/002-argocd-apps.yml +++ /dev/null @@ -1,50 +0,0 @@ ---- -apiVersion: helm.cattle.io/v1 -kind: HelmChart -metadata: - name: argocd-apps - namespace: kube-system -spec: - # do not change order! (needed for renovate) - chart: argocd-apps - repo: https://argoproj.github.io/argo-helm - version: 2.0.0 - targetNamespace: argocd - valuesContent: |- - projects: - baseline: - namespace: argocd - finalizers: - - resources-finalizer.argocd.argoproj.io - sourceRepos: - - '*' - destinations: - - namespace: '*' - server: '*' - clusterResourceWhitelist: - - group: '*' - kind: '*' - applications: - baseline: - project: baseline - finalizers: - - resources-finalizer.argocd.argoproj.io - source: - repoURL: 'https://git.smsvc.net/k8s/baseline.git' - targetRevision: HEAD - path: manifests/ - directory: - recurse: true - destination: - server: 'https://kubernetes.default.svc' - namespace: argocd - syncPolicy: - automated: - prune: true - selfHeal: true - retry: - limit: 5 - backoff: - duration: 5s - factor: 2 - maxDuration: 5m diff --git a/argocd-bootstrap/002-helm-argocd-apps.yml b/argocd-bootstrap/002-helm-argocd-apps.yml new file mode 100644 index 0000000..236332b --- /dev/null +++ b/argocd-bootstrap/002-helm-argocd-apps.yml @@ -0,0 +1,12 @@ +--- +apiVersion: helm.cattle.io/v1 +kind: HelmChart +metadata: + name: argocd-apps + namespace: kube-system +spec: + # do not change order! (needed for renovate) + chart: argocd-apps + repo: https://argoproj.github.io/argo-helm + version: 2.0.0 + targetNamespace: argocd diff --git a/argocd-bootstrap/003-baseline-project.yml b/argocd-bootstrap/003-baseline-project.yml new file mode 100644 index 0000000..f8f2eb2 --- /dev/null +++ b/argocd-bootstrap/003-baseline-project.yml @@ -0,0 +1,17 @@ +--- +apiVersion: argoproj.io/v1alpha1 +kind: AppProject +metadata: + name: baseline + namespace: argocd + finalizers: + - resources-finalizer.argocd.argoproj.io +spec: + sourceRepos: + - '*' + destinations: + - namespace: '*' + server: '*' + clusterResourceWhitelist: + - group: '*' + kind: '*' diff --git a/argocd-bootstrap/004-baseline-app.yml b/argocd-bootstrap/004-baseline-app.yml new file mode 100644 index 0000000..6380054 --- /dev/null +++ b/argocd-bootstrap/004-baseline-app.yml @@ -0,0 +1,25 @@ +--- +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: baseline + namespace: argocd +spec: + project: baseline + source: + repoURL: 'https://git.smsvc.net/k8s/baseline.git' + targetRevision: HEAD + path: manifests/ + directory: + recurse: true + destination: + server: 'https://kubernetes.default.svc' + namespace: argocd + syncPolicy: + automated: + prune: true + selfHeal: true + retry: + backoff: + duration: 15s + maxDuration: 30m