Skip to content

Latest commit

 

History

History
152 lines (92 loc) · 5.18 KB

README.md

File metadata and controls

152 lines (92 loc) · 5.18 KB

Delivering the example using GitOps and ArgoCD

Prerequisites

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

Please follow the rest of the documentation to

TL;DR

# Get initial admin password
kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d && echo
 
# Login with the CLI
argocd login --insecure --grpc-web --port-forward --port-forward-namespace argocd
 
# Username: admin
# Password: <the one you just retrieved>
 
# Update password
argocd account update-password --insecure --grpc-web --port-forward --port-forward-namespace argocd
 
# Access to the UI (open a new terminal to enter this command to avoid being distrubed by outputs)
kubectl -n argocd port-forward --address 0.0.0.0 svc/argocd-server 8082:80
 
# Open UI at http://<uid>.int.be.continental.cloud:8082
# Login with the new credentials

Fork the podtato-head project

This example modifies files within the repository, so you will need to configure your local environment to push to your github repository or to make your commits directly in github web UI.

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/chart. 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 at the bottom of the application square.

A new panel appears to show every resource that will be synchronized : click synchronize to validate.

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

And if you go back the the Applications view, your application is now synched and healthy

Argo Application Overview

Updating the project to a new version

Updating the project required to update the values file in the /delivery/chart folder fo your Git repository. Change some tag values to another version (v2-latest-dev,v3-latest-dev,v4-latest-dev). Push your modifications to git (either in your terminal or by using the github web UI)

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