This document explains GitOps way of deploying iLender application in Dev, Stage and Prod clusters using ArgoCD.
- ArgoCD is installed and available in an Openshift Cluster.
- iLender app is going to be deployed in
in-cluster
, the Openshift Cluster where ArgoCD is installed. - The namespaces
ilender-dev-ns
,ilender-stage-ns
andilender-prod-ns
are considered as Dev, Stage and Prodin-cluster
s .
The article is based on the the following
- RedHat OpenShift 4.6 on IBM Cloud (ROKS)
Install OpenShift GitOps (which installs Argo CD) using the url https://github.com/redhat-developer/openshift-gitops-getting-started
The ArgoCD is installed and available in openshift-gitops
namespace.
iLender application yaml files for Dev, Stage and Prod are available here.
We need to create an entry (application) in ArgoCD, to point to iLender application. For each Dev, Stage and Prod in-cluster
of iLender, we need to have separate entry (application) in ArgoCD. Here the yamls to create app in ArgoCD.
ilender-dev ilender-stage ilender-prod
The ArgoCD appplication looks like the below.
ArgoCD requires cluster admin rights to access other namespaces to install ilender app. Here is the yaml file for service account.
Service account is created inside openshift-gitops
namespace as we have ArgoCD installed there.
Run the below command
oc apply -f argo-setup-misc/sa.yaml
Run the below command
oc apply -f argo-app/ilender-dev.yaml
You might be able to see the app like this in ArgoCD.
Run the below command
oc apply -f argo-app/ilender-stage.yaml
You might be able to see the app like this in ArgoCD.
Run the below command
oc apply -f argo-app/ilender-prod.yaml
You might be able to see the app like this in ArgoCD.
- Click on sync option to install iLender app in
Dev
in-cluster for the first time.
You might be able to see the app like this in ArgoCD.
- Run the below command to get url of the app
oc get routes -n ilender-dev-ns | grep frontweb | awk '{print $2}'
The output would be like this.
ilender-frontweb-ilender-dev-ns.aiops-dev-july-4caea77.us-south.containers.appdomain.cloud
- Open the url in the browser and access the application.
- Click on sync option to install iLender app in
Stage
in-cluster for the first time.
You might be able to see the app like this in ArgoCD.
- Run the below command to get url of the app
oc get routes -n ilender-stage-ns | grep frontweb | awk '{print $2}'
- Open the url in the browser and access the application.
-
Click on sync option to install iLender app in
Prod
in-cluster for the first time. -
Run the below command to get url of the app
oc get routes -n ilender-prod-ns | grep frontweb | awk '{print $2}'
- Open the url in the browser and access the application.
Want to increase the replica to 2 for ilender-loan
microservice. The ArgoCD will deploy the changes in Stage in-cluster if we sync it.
Sync option was set to manual, while we create argo-app for dev, stage and prod. So auto sync option to be enabled.
Here is the ilender-loan
with 1 replica.
- Update the below yaml for the replica.
- Commit the changes.
- To enable the auto-sync, click on the
APP DETAILS
.
- Click on the
ENABLE AUTO-SYNC
.
The changes are synched and 2 instances of ilender-loan
is deployed.
Want to increase the replica to 3 for ilender-loan
microservice in Prod cluster. The ArgoCD will deploy the changes in Prod in-cluster during the sync.
- Update the below yaml for the replica.
- Commit the changes.
-
To enable the auto-sync, click on the
APP DETAILS
. -
Click on the
ENABLE AUTO-SYNC
.
The changes are synched and 3 instances of ilender-loan
is deployed.