Deploying an application
We have successfully configured Argo CD on our cluster so now we can deploy an application. To demonstrate the difference between a GitOps-based delivery of an application and other methods, we'll migrate the UI component of the sample application which is currently using the kubectl apply -k
approach to the new Argo CD deployment approach.
First let's remove the existing UI component so we can replace it:
namespace "ui" deleted
serviceaccount "ui" deleted
configmap "ui" deleted
service "ui" deleted
deployment.apps "ui" deleted
Now, let's get into the cloned Git repository and start creating our GitOps configuration. Copy the existing kustomize configuration for the UI service:
Your Git directory should now look something like this which you can validate by running tree ~/environment/argocd
:
.
└── apps
├── configMap.yaml
├── deployment.yaml
├── kustomization.yaml
├── namespace.yaml
├── serviceAccount.yaml
└── service.yaml
1 directory, 6 files
Open the Argo CD UI and navigate to the apps
application.
Finally we can push our configuration to the Git repository:
Click Refresh
and Sync
in ArgoCD UI or use argocd
CLI to Sync
the application:
After a short period of time, the application should be in Synced
state and the resources should be deployed, the UI should look like this:
That shows that Argo CD created the basic kustomization, and that it's in sync with the cluster.
We've now successfully migrated the UI component to deploy using Argo CD, and any further changes pushed to the Git repository will be automatically reconciled to our EKS cluster.
You should now have all the resources related to the UI services deployed. To verify, run the following commands:
NAME READY UP-TO-DATE AVAILABLE AGE
ui 1/1 1 1 61s
NAME READY STATUS RESTARTS AGE
ui-6d5bb7b95-rjfxd 1/1 Running 0 62s