Automation Workflows: GitOps for YugabyteDB with Argo CD and Helm

GitOps for YugabyteDB
  • Single-zone rollout
  • Multi-zone rollout
  • Day 2 operations, such as cluster placement policy updates, scale-out and scale-in, and upgrade rollouts.

Why GitOps and Argo CD for automation workflows?

Prerequisites

  • Kubernetes 1.18 (or later) with 3 or 4 node(s) cluster, 8vCPU, 16GB memory, and 20GB storage per node.
  • Follow Argo CD’s Getting Started instructions (steps 1–5) to install and configure server-side controllers in the Kubernetes cluster and CLI within the workstation.
  • Git command-line tool.

Getting started with automation workflows

Base application

  • 06: This is the namespace Argo CD’s objects belong to. But if Argo CD’s objects are in a different namespace, this value should point to that custom namespace.
  • 09: This is the Kubernetes server endpoint. In this case, we are using the “in-cluster” instance where Argo CD is running. But if you want to deploy to a different cluster, this should reflect the target cluster’s details.
  • 11: We deploy the base application to the namespace where Argo CD’s objects exist.
  • 13: Update it to your source repository.
  • 14: This should point to the “single-zone” or “multi-zone” sub-directory. This base application, when deployed, will refer to this sub-directory for Argo CD’s app manifests.
  • 18: We deploy to the “default” project. Consequently, every installation comes with a default project.

Automation workflows: single-zone rollout

  • Metadata: Kubernetes namespace, service account bot, and role binding related information.
  • Cluster config: The cluster config image sets the cluster’s placement policy after the cluster creation.
  • Application: The Argo CD’s application file holds the database cluster information. Consequently, this manifest refers to the upstream helm repository and has the configuration to provision a database cluster with three yb-master and yb-tserver instances.

Metadata (metadata.yaml)

  • gitops-yb keeps the cluster-config on-demand jobs, service account bot, and other database cluster-wide objects. It also creates a service account bot with the appropriate privileges to update placement policy via a Kubernetes job once the cluster is provisioned.
  • gitops-yb-sz holds the database cluster instances.

Application (yb-sz.yaml)

  • 04: The application name.
  • 10: The destination namespace is different. We deploy the database cluster to the gitops-yb-sz namespace.
  • 13: The source helm chart repository. Argo CD extracts and applies the chart to the Kubernetes cluster.
  • 15: Values.yaml file overrides.
  • 42: Cluster image version.
  • 43–46: Storage class name. Update it based on your Kubernetes cluster configuration.

Cluster config (cluster-config-job.yaml)

Argo CD dashboard

yb-data-service

yb-sz

YugabyteDB console

Automation workflows: multi-zone rollout

Metadata (metadata.yaml)

  • gitops-yb keeps the cluster-config on-demand jobs, bot service account, and other database cluster-wide objects. It also creates a service account bot with appropriate privileges to update placement policy via a Kubernetes job once the cluster is provisioned.
  • gitops-yb-az1, gitops-yb-az2, and gitops-yb-az3 hold the DB cluster instances.

Application (yb-mz-az{1,2,3}.yaml)

  • 04: The multi-zone application name.
  • 10: The destination namespace is different. This means we deploy the database cluster to the gitops-yb-az{1,2,3} namespace(s).
  • 13: The source helm chart repository. As a result, Argo CD extracts and applies the chart to the target Kubernetes cluster.
  • 19–20: Replace the zone value from your Kubernetes cluster node. First, run “kubectl get nodes -show-labels.” Next, grab the details of “topology.kubernetes.io/zone.” But you will have different values based on the availability zones. Therefore, each zone manifest file value needs to be set based on the zone value of the Kubernetes node.
  • 15: Values.yaml file overrides.
  • 49: The cluster image version.
  • 51–54: The storage class name. Update it based on your Kubernetes cluster configuration.

Argo CD dashboard

yb-data-service

yb-mz-az{1,2,3}

Automation workflows: Day 2 operations

Conclusion

--

--

--

Aspiring Software Artist | views expressed on this blog are solely mine |

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

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
Srinivasa Vasu

Srinivasa Vasu

Aspiring Software Artist | views expressed on this blog are solely mine |

More from Medium

Kubernetes Service Health Check Dashboard

How to: Find ownerReferences of Kubernetes workloads

Enhancing reliability by distributing your APP into multiple OpenShift clusters — Part I

DRYing out Procore’s Kubernetes Configuration