Deploy Application with ArgoCD and Helm#
We will cover application deployment with Helm and ArgoCD in this section.
Deploy your Application with Helm#
Let's deploy a simple application using Helm. Helm charts are packaged and stored in repositories. They can be added as dependencies of other charts or used directly. Let's add a chart repository now. The chart repository stores the version history of our charts as well as the packaged tar file.
We created and packaged a Helm chart to the Nexus Helm Repository available in Stakater App Agility Platform (SAAP)
-
From your Terminal, add the Nexus Helm Repository using the following command. Consider the
-
Install a chart from this repo. Start by searching the repository to see what is available.
-
Now install the latest version. Helm likes to give each install its own release.
-
Open the application up in the browser to verify it's up and running. Here's a handy one-liner to get the URL of the app.
-
Run the following command to port forward the pod to your local machine and run curl command to verify your application is running and serving requests.
-
You can upgrade your chart values with CLI. By default, your application has only 1 replica. You can view this using the following command.
By default, there is one replica of your application. Let's use Helm to set this to 5.
helm upgrade RELEASE_NAME NEXUS_HELM_REPO_NAME/APP_NAME --set APP_NAME.deployment.replicas=5 --namespace ${TENANT_NAME}-devVerify the deployment has scaled up to 5 replicas.
-
If you're done playing with the
Nordmart Review API. You can tidy up your work by removing the chart. To do this, runhelm uninstallto remove your release of the chart.Verify the cleanup.
Deploy your Application with ArgoCD#
-
Log into ArgoCD UI.
-
Lets deploy a sample application through the UI. In fact, let's get ArgoCD to deploy the
stakater-nordmart-reviewapp you manually deployed previously using Helm. On ArgoCD - click+ NEW APP. You should see an empty form. Let's fill it out by setting the following:-
On the GENERAL box
- Application Name:
<TENANT_NAME>-nordmart-review - Project:
<TENANT_NAME>(select the project corresponding to your<TENANT_NAME>from theprojectdropdown) - Sync Policy:
Automatic
- Application Name:
-
On the SOURCE box
- Repository URL:
NEXUS_HELM_REGISTRY_URL - Select
Helmfrom the right dropdown menu - Chart:
stakater-nordmart-review - Version:
1.0.0
- Repository URL:
-
On the DESTINATION box
- Cluster URL:
https://kubernetes.default.svc - Namespace:
<TENANT_NAME>-test
- Cluster URL:
Your form should look like the follow image, if so click
Create -
-
After you hit
Create, you'll see<TENANT_NAME>-nordmart-reviewapplication is created and should start deploying in your<TENANT_NAME>-testnamespace. -
If you drill down into the application you will get ArgoCD's amazing view of all k8s resources that were generated by the chart
-
You can verify the application is running and behaving as expected by navigating to
Workloads>Podssection in the<TENANT_NAME-testnamespace in yourOpenShift Console.Select the dropdown menu and switch to
Administratorview in the OpenShift console if you are not already there -
Run the following command to port forward the pod to your local machine and run curl command to verify your application is running and serving requests.