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}-dev
Verify 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 uninstall
to 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-review
app 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 theproject
dropdown) - Sync Policy:
Automatic
- Application Name:
-
On the SOURCE box
- Repository URL:
NEXUS_HELM_REGISTRY_URL
- Select
Helm
from 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-review
application is created and should start deploying in your<TENANT_NAME>-test
namespace. -
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
>Pods
section in the<TENANT_NAME-test
namespace in yourOpenShift Console
.Select the dropdown menu and switch to
Administrator
view 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.