Terraform Integrated with GitHub Actions to setup Argo CD on Civo ๐ŸŽก๐Ÿ‹๐Ÿ’™

๐Ÿš€ GitHub Actions

GitHub Actions is a continuous integration and continuous delivery (CI/CD) platform that allows you to automate your build, test, and deployment pipeline. You can create workflows that build and test every pull request to your repository, or deploy merged pull requests to production.

GitHub Actions goes beyond just DevOps and lets you run workflows when other events happen in your repository. For example, you can run a workflow to automatically add the appropriate labels whenever someone creates a new issue in your repository.

GitHub provides Linux, Windows, and macOS virtual machines to run your workflows, or you can host your own self-hosted runners in your own data center or cloud infrastructure.

More Information : https://docs.github.com/en/actions/learn-github-actions/understanding-github-actions

๐Ÿฆ‘ Argo CD

ArgoCD is a GitOps tool that helps with your GitOps workflows. ArgoCD can be used as a standalone tool or as a part of your CI/CD workflow. ArgoCD works with Git as a source off truth, with current Kubernetes manifests, or with Helm charts.

More Information : https://argo-cd.readthedocs.io/en/stable/

โšกTerraform

Terraform is an infrastructure as code (IaC) tool that allows you to build, change, and version infrastructure safely and efficiently. This includes low-level components such as compute instances, storage, and networking, as well as high-level components such as DNS entries, SaaS features, etc. Terraform can manage both existing service providers and custom in-house solutions.

More Information : https://www.terraform.io/intro/index.html

๐Ÿค  Civo

Civo is the first cloud native service provider powered only by Kubernetes. Blazing fast cluster launch times in under 90 seconds and simplified developer experience.

โ„ Architecture

Letโ€™s start :

Terraform code for Launching Civo Cluster with Argo CD :

Note: You need to create token first to connect to CIVO :

Create token here : https://www.civo.com/account/security

You can create secret in github to store your token (I have directly pasted the token)

terraform {
required_providers {
civo = {
source = "civo/civo"
version = "0.10.3"
}
}
}
provider "civo" {
token = "token"
region = "LON1"
}
resource "civo_kubernetes_cluster" "cluster" {
name = "sample"
applications = "-Traefik,-metrics-server,argo-cd"
num_target_nodes = 3
target_nodes_size = "g3.k3s.medium"
}
  1. After creating cluster you need to download kubeconfig file.
  2. Then need to have kubectl installed in your local system [Note: You can use civo CLI as well]
  3. Letโ€™s see :

Here, we can see 3 nodes are up and running :

Here, you can see argocd namespace :

Here, you can see now :

ArgoCD usernameis admin and password is stored in secrects(argocd-initial-admin-secret :

Convert it into base64 and there you go:

Now create a git repository as source of truth :

Step 1: Go to Manage your repositories tab :

Step 2 : Click on repositories

Step 3 : Click on connect repo using https :

Step 4 : Add link to your repo and connect !!

Here you can see new namespace with name new-ns will be created for that select the option Auto-create NameSpace and click CREATE!

Now, you can see below new namespace and resources are created!

๐Ÿ”ฐ Keep Learning !! Keep Sharing !! ๐Ÿ”ฐ

๐Ÿš€ Feel free to connect with me :

LinkedIn : https://www.linkedin.com/in/vrukshali-torawane/

GitHub : https://github.com/Vrukshali-26

Twitter : https://twitter.com/Vrukshali26

--

--

--

Contributor @DoKcommunity โ€ข 2x @RedHat Certified โ€ข DevOps Technical Writerโœ๐Ÿป โ€ข she/her โ€ข Learner Forever

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Calculating the Convolution of Two Functions With Python

GUIDELINES AND MECHANICS: The โ€œRANKโ€ RUNE of NAR

Journey from Tier-3 to Amazon

โ€œIโ€™m not sure if Software Development is for me.โ€โ€Šโ€”โ€ŠMy Response

SHAREit Mod Apk No Ads 2021

SHAREit Mod Apk No Ads 2021

Docker containers monitoring with Prometheus.

Next Django Version Will Have Better TestCases Isolation

Docker-in-Docker jenkins Integration

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Vrukshali Torawane

Vrukshali Torawane

Contributor @DoKcommunity โ€ข 2x @RedHat Certified โ€ข DevOps Technical Writerโœ๐Ÿป โ€ข she/her โ€ข Learner Forever

More from Medium

Shim-shiminey Shim-shiminey

Create Custom Terraform Providerย : Part 03

Self-hosting Unleash with Kubernetes

Running Spacelift CI/CD workers in Kubernetes using DinD