Skip to content

Latest commit

 

History

History
125 lines (75 loc) · 4.26 KB

README.md

File metadata and controls

125 lines (75 loc) · 4.26 KB

Delivering the example using GitOps and ArgoCD

Prerequisites

NOTE : you have to be into delivery/ArgoCD folder to run the commands below.

Install ArgoCD

You can find detailed instructions on how to install ArgoCD here

For your convenience, you can find commmands to install Argo below :

VERSION=$(curl --silent "https://api.github.com/repos/argoproj/argo-cd/releases/latest" | grep '"tag_name"' | sed -E 's/.*"([^"]+)".*/\1/')
sudo curl -sSL -o /usr/local/bin/argocd https://github.com/argoproj/argo-cd/releases/download/$VERSION/argocd-linux-amd64
sudo chmod +x /usr/local/bin/argocd
kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
kubectl rollout status deployment argocd-server -n argocd

Please follow the rest of the documentation to

Example to connect to the UI : kubectl -n argocd port-forward svc/argocd-server 8080:80

Fork the podtatohead project

This example modifies files within the repository, so you will need to work on your fork.

Setting up the application in ArgoCD

Access the ArgoCD UI

If everything went fine so far you should now see the ArgoCD UI.

ArgoUI

Now either click on New App at the top or Create Application in the middle of the screen. This will open a screen like this. We will walk through the configuration in the next part.

New application in Argo

Creating a new application

Now we have to define the proper parameters for your application.

Define application data

For the application we define podtatohead as the application name and leave the project to default. We also check autogenerate namespace to have ArgoCD take care of namespace management.

General application settings

Setting the Github repo

Use the Github repo you forked before and ensure you set the path to delivery/charts/podtatohead. This will use the Helm of the tutorial

Define GitHub Repo to use

Define destination cluster

In the example we use the local cluster as our destination and podtato-argocd as the namespace to deploy to. As we checked autocreate namespace above ArgoCD will create the namespace for us.

Define destination cluster

Helm Values file

ArgoCD will automatically detect the Helm values files. We do not need to change anything here and just can leave it as it.

Helm Values

Create application

Now hit create application and it should be visible in the project overview. If you cannot see the application ensure that the filters are set properly. The application will show up yellow as it has not been synced yet.

Argo Application Overview

Deploying application versions

Syncing the project

In order to sync and deploy the application click SYNC and then confirm by clicking on SYNCHRONIZE.

syncing the application

This will now create all application ressources in the cluster. Once syncing is finished you will see all application components as healthy.

Show deployed application in ArgoCD

Updating the project to a new version

Updating the project required to update the values file in the /delivery/charts/podtatohead/ folder fo your Git repository. Change the tag value to v0.1.1.

The application will now show up as out of sync. Simply hit sync and the application should update

Application out of sync

Validate update

Access the podtato demo application again and you should see the new version.

updated version