diff --git a/README.md b/README.md index 0fcebfd..21e42ac 100644 --- a/README.md +++ b/README.md @@ -1 +1,76 @@ -# decapod-bootstrap +# Decapod-bootstrap + +This repo includes materials to bootstrap decapod controllers using app of apps pattern. +Currently the following applications are bootstrapped by default. +* argo-cd +* postgresql +* argo-workflow + +## Installation + +### Clone repository +clone this repository that includes: +- value-override file for argocd installation, which contains initial (meta) project/app configurations +- actual manifest directory watched by the above meta apps, which contains actual decapod project and application configurations + +``` +$ git clone https://github.com/openinfradev/decapod-bootstrap +``` + +The repository structure looks as follows. +``` +├── README.md +├── argocd-install +│   └── values-override.yaml +├── decapod-apps +│   ├── README.md +│   ├── argo-workflows.yaml +│   ├── db-secret-decapod-db.yaml +│   ├── db-secret-argo.yaml +│   └── postgresql.yaml +└── decapod-projects + ├── README.md + └── decapod-controller.yaml +``` + +Directory contents +* argocd-install: value-override file for argocd helm chart, which contains configuration to create the following (meta) project and app. + * meta-project 'decapod-projects' + * meta-application 'decapod-apps' + +* decapod-projects: directory for actual project manifest files. Once any manifest file is added, it's detected by 'decapod-projects' project, and created as argocd project. + +* decapod-apps: directory for actual application manifest files. Once any manifest file is added, it's detected by 'decapod-apps' project, and created as argocd application. + + +### Create namespaces +``` +$ kubectl create ns argo +$ kubectl create ns decapod-db +``` + +### Install argo-cd using helm-chart /w value-override file +(chart location: https://artifacthub.io/packages/helm/argo/argo-cd) +``` +$ helm repo add argo https://argoproj.github.io/argo-helm +$ helm install argo-cd argo/argo-cd --version 3.9.0 -f ./decapod-bootstrap/argocd-install/values-override.yaml -n argo +``` +Once argocd is installed, it creates the meta project and apps, which in turn, bootstraps actual decapod applications. + +### Watch for applications to bootstrap automatically +``` +$ kubectl get pods -n decapod-db +NAME READY STATUS RESTARTS AGE +postgresql-postgresql-0 1/1 Running 0 4m10s + +$ kubectl get pods -n argo +NAME READY STATUS RESTARTS AGE +argo-cd-argocd-application-controller-7bc75f949c-svrnk 1/1 Running 0 5m34s +argo-cd-argocd-dex-server-7bd494f8b5-j5br5 1/1 Running 0 5m34s +argo-cd-argocd-redis-6f696857c5-zmqfh 1/1 Running 0 5m34s +argo-cd-argocd-repo-server-545455798b-st5x8 1/1 Running 0 5m34s +argo-cd-argocd-server-6666cb7689-tswfr 1/1 Running 0 5m34s +argo-workflows-operator-server-d7df65b99-gpx5q 0/1 Running 0 4m21s +argo-workflows-operator-workflow-controller-598dfdd565-vrzg9 0/1 Running 0 4m21s + +``` diff --git a/decapod-apps/prepare-decapod-controller.yaml b/decapod-apps/db-secret-argo.yaml similarity index 79% rename from decapod-apps/prepare-decapod-controller.yaml rename to decapod-apps/db-secret-argo.yaml index b0d2394..b751b30 100644 --- a/decapod-apps/prepare-decapod-controller.yaml +++ b/decapod-apps/db-secret-argo.yaml @@ -1,7 +1,7 @@ apiVersion: argoproj.io/v1alpha1 kind: Application metadata: - name: prepare-decapod-controller + name: db-secret-argo namespace: argo spec: destination: @@ -9,7 +9,7 @@ spec: server: https://kubernetes.default.svc project: decapod-controller source: - path: hanu-reference/decapod-controller/prepare-decapod-controller + path: hanu-reference/decapod-controller/db-secret-argo repoURL: https://github.com/openinfradev/decapod-manifests.git targetRevision: HEAD syncPolicy: diff --git a/decapod-apps/decapod-db-secret.yaml b/decapod-apps/db-secret-decapod-db.yaml similarity index 81% rename from decapod-apps/decapod-db-secret.yaml rename to decapod-apps/db-secret-decapod-db.yaml index 3ba88e1..0c698ae 100644 --- a/decapod-apps/decapod-db-secret.yaml +++ b/decapod-apps/db-secret-decapod-db.yaml @@ -1,7 +1,7 @@ apiVersion: argoproj.io/v1alpha1 kind: Application metadata: - name: decapod-db-secret + name: db-secret-decapod-db namespace: argo spec: destination: @@ -9,7 +9,7 @@ spec: server: https://kubernetes.default.svc project: decapod-controller source: - path: hanu-reference/decapod-controller/decapod-db-secret + path: hanu-reference/decapod-controller/db-secret-decapod-db repoURL: https://github.com/openinfradev/decapod-manifests.git targetRevision: HEAD syncPolicy: