In the previous exercises, we create helm charts that can be used to create resources on kubernetes clusters.
To level up the experience, we’re going to use ArgoCD to deliver that code to our cluster, and have it reconcile resources for us.
Essentially, helm charts define what we want to deploy, and ArgoCD is how we deploy it. The two working together create a powerful flow for managing resources on clusters.
Refer back to your student page to retrieve the link to access your team’s instance of ArgoCD, which will be used to deploy things into your namespace.
Once logged in, you’ll either be greeted with an empty window, or see a few existing application tiles, depending on how far your teammates have gotten.
Click on the + New App
button to start adding a new application to be deployed.
In the window pane that appears on the right, we’ll need to enter some information about our application, and where to find the code for it.
Start by giving the application a name, such as system-dashboard
, and setting the project name to default
- this is just the namespace where the project definition will live, not where our resources will be deployed.
Scrolling down, add information about the code repository. The URL can be retrieved from the Gitea interface if needed:
Enter this information into the appropriate place under the Source
header:
Under destination, ensure the cluster URL is set to the local cluster: https://kubernetes.default.svc
, and that the Namespace is set to your team’s namespace. In this example, team1’s namespace is used.
ArgoCD should pull in some information about the repo, automatically displaying helm
and the values we put into our values.yaml
file:
Once finished, hit the Create
button at the top of the window.
The above process can also be done as code, if you like, using the following format:
# Note: Team 1 is used as an example here - replace with your team information
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: system-dashboard
spec:
destination:
name: ''
namespace: team1
server: https://kubernetes.default.svc
source:
path: system-dashboard
repoURL: >-
https://gitea-student-services.apps.acp.rh1.redhat-workshops.com/rh1/team1-code.git
targetRevision: HEAD
sources: []
project: default
This should appear as so in the web interface:
Once finished, click the Create
button.
After hitting the create button, a new application tile should appear, with details about the new application:
Clicking on the application tile will show more information, such as the resources that are to be deployed and managed:
As discussed previously, our helm templates have been rendered, showing our two virtual machines as resources. ArgoCD is denoting these resources as “missing” because the application has not yet been synced.
With the application sitting in an OutOfSync state, the resources are set to be deployed. To begin syncing the application, click on the Sync
button. A menu will appear on the right with options:
For our purposes, no additional options are needed. Simply click the Synchronize
button at the top.
The ArgoCD interface will show the sync process, the resources being created, and the current state of the sync. After a few moments, the application will show Synced:
Return to the OpenShift web interface, and switch to the Developer View. Select the Topology view, and review the newly deployed application:
Navigation
Previous Exercise | Next Exercise |