diff --git a/content/for-developers/tutorials/outer-loop/add-build-environment/add-environment.md b/content/for-developers/tutorials/outer-loop/add-build-environment/add-environment.md index fc0d2894..c55ff0b2 100644 --- a/content/for-developers/tutorials/outer-loop/add-build-environment/add-environment.md +++ b/content/for-developers/tutorials/outer-loop/add-build-environment/add-environment.md @@ -2,90 +2,102 @@ Lets see how can we add an environment to an application in a tenant. Lets say, we have added a production cluster and want to add a new environment in application for it to be deployed on production. -1. Create a folder named `production` at `/` which corresponds to the production environment. Suppose `gabbar` as tenant name, `stakater-nordmart-review` as application name, `production` as cluster name, `prod` as environment name. - - ```bash - └── gabbar - └── stakater-nordmart-review - └── prod - ``` - +1. Create a folder named `` at `/` which corresponds to the production environment. Suppose `` as tenant name, `` as application name, `` as cluster name, `` as environment name. + + ```bash + └── + └── + └── + ``` + 1. Add the Helm Chart of your application with production environment configurations. - - ```bash - └── gabbar - └── stakater-nordmart-review - └── prod - ├── Chart.yaml - ├── values.yaml - └── templates/ - ``` - -1. Add an folder `prod` inside `/argocd-apps`. Add an ArgoCD Application in this folder which points to `//prod`. - - ```yaml - # Name: stakater-nordmart-review.yaml(APP_NAME.yaml) - # Path: gabbar/argocd-apps/prod (TENANT_NAME/ argocd-apps/ENV_NAME/) - apiVersion: argoproj.io/v1alpha1 - kind: Application - metadata: - name: gabbar-prod-stakater-nordmart-review - namespace: openshift-gitops - spec: - destination: - namespace: TARGET_NAMESPACE - server: 'https://kubernetes.default.svc' - project: gabbar - source: - path: gabbar/stakater-nordmart-review/prod - repoURL: 'APPS_GITOPS_REPO_URL' - targetRevision: HEAD - syncPolicy: - automated: - prune: true - selfHeal: true - ``` - -1. Add a folder called production (if not present) corresponding to the cluster name inside `argocd-apps` at root level, Add an ArgoCD Application in this folder which points to `/argocd-apps/prod`. - - ```yaml - # Name: gabbar-prod.yaml (TENANT_NAME-ENV_NAME.yaml) - # Path: argocd-apps/prod - apiVersion: argoproj.io/v1alpha1 - kind: Application - metadata: - name: gabbar-prod - namespace: openshift-gitops - spec: - destination: - namespace: TARGET_NAMESPACE - server: 'https://kubernetes.default.svc' - project: gabbar - source: - path: gabbar/argocd-apps/prod - repoURL: 'APPS_GITOPS_REPO_URL' - targetRevision: HEAD - syncPolicy: - automated: - prune: true - selfHeal: true - ``` - + + ```bash + └── + └── + └── + ├── Chart.yaml + ├── values.yaml + └── templates/ + ``` + +1. Add an folder `` inside `/argocd-apps`. Add an ArgoCD Application in this folder which points to `//`. + + ```yaml + # Name: .yaml(APP_NAME.yaml) + # Path: /argocd-apps/ (TENANT_NAME/ argocd-apps/ENV_NAME/) + apiVersion: argoproj.io/v1alpha1 + kind: Application + metadata: + name: -- + namespace: rh-openshift-gitops-instance + spec: + destination: + namespace: + server: 'https://kubernetes.default.svc' + project: + source: + path: // + repoURL: + targetRevision: HEAD + syncPolicy: + automated: + prune: true + selfHeal: true + ``` + +1. Add a folder called production (if not present) corresponding to the cluster name inside `argocd-apps` at root level, Add an ArgoCD Application in this folder which points to `/argocd-apps/`. + + ```yaml + # Name: -.yaml (TENANT_NAME-ENV_NAME.yaml) + # Path: argocd-apps/ + apiVersion: argoproj.io/v1alpha1 + kind: Application + metadata: + name: - + namespace: rh-openshift-gitops-instance + spec: + destination: + namespace: + server: 'https://kubernetes.default.svc' + project: + source: + path: /argocd-apps/ + repoURL: + targetRevision: HEAD + syncPolicy: + automated: + prune: true + selfHeal: true + ``` + 1. You should have a similar folder structure at the end: + + ```bash + ├── + | ├── + | | ├── + | | | ├── Chart.yaml + | | | ├── values.yaml + | | └── └── templates/ + ├── └── argocd-apps + | └── + | └── .yaml + └── argocd-apps + └── (cluster name) + └── -prod.yaml + ``` + +1. Make sure Application that deploys applications inside `argocd-apps/cluster-name/` folder is deployed in relevant `infra-gitops-config` repository. - ```bash - ├── gabbar - | ├── stakater-nordmart-review - | | ├── prod - | | | ├── Chart.yaml - | | | ├── values.yaml - | | └── └── templates/ - ├── └── argocd-apps - | └── prod - | └── stakater-nordmart-review.yaml - └── argocd-apps - └── production (cluster name) - └── gabbar-prod.yaml - ``` +!!! note + Anything defined in `` are values that needs to be replaced according to specific needs. -1. Make sure Application that deploys applications inside `argocd-apps/cluster-name/` folder is deployed in relevant `infra-gitops-config` repository. +Brief details about what each key means is defined below: + +1. `tenant-name`: Name of the tenant where this environment needs to be deployed. +1. `app-name`: Name of the application where this environment will be used. +1. `cluster-name`: Name of the cluster. +1. `env-name`: Name of the environment. +1. `target-namespace`: Name of the namespace where this environment will be deployed. +1. `apps-gitops-repo-url`: URL for Apps GitOps repository.