Argo CD, Traefik, Let’s Encrypt on GCP Part 2

Art Krisada
4 min readFeb 7, 2023

From Part 1

Next, we will connect to gitlab.

If you use a private repo, you need to connect repo with key .

In Setting, select Repositories.

Then, Connect Repo.

Next, open gitlab and add SSH keys. Generate ssh key. You can do it with ssh-keygen. Paste public key (file.pub) in Key Fields.

Then, comeback to Argo CD. Select ‘via SSH’. Fill in name. Fill in Your Repo. Fill in your private key

If everything is good, you will see status success.

Next, we will add traefik in Argo. I prepare yaml files in my gitlab repo.

This is traefik page. Very useful read.

I get CRDS and RBACS from

https://raw.githubusercontent.com/traefik/traefik/v2.9/docs/content/reference/dynamic-configuration/kubernetes-crd-definition-v1.yml

https://raw.githubusercontent.com/traefik/traefik/v2.9/docs/content/reference/dynamic-configuration/kubernetes-crd-rbac.yml

In my repo, you need to change to your nfs server ip address in file

02-traefik-pv.yml

Change to your email in 05-traefik.yml

Next, add new application in Argo CD. Fill in your project info. Select Repository that we added before.

I keep all traefik yaml file in path traefik, soI set path to traefik. Set cluster to https://kubernetes.default.svc

Set Namespace to traefik or your desire namespace. Then, Create.

You can see application traefik in your app list. Click to see what inside.

Click sync to synchronize and it will deploy to your cluster. Check AUTO-CREATE NAMESPACE Check box.

It will show you that Sync OK.

Next, Deploy whoami to test. Create new app name whoami

Change file ingress-route.yml. Set URL to your url. Click Create.

After created, synchronize your app. Don’t forget to Check AUTO-CREATE NAMESPACE Check box.

Next, config your DNS to point to your cluster. Check your External IP on GCP

Set your URL to point to this IP.

Wait a while for traefik to communicate with Let’s Encrypt to get Cert.

Then, check your url and https cert.

--

--

Art Krisada

Never stop learning, because life never stop teaching.