Declarative infrastructure and config management
We've already looked at the chapters on Terraform and Ansible regarding declarative infrastructure and config management principles. In this chapter, we will use GitHub actions and Terraform to spin up a Google Kubernetes Engine instance. So far, we've been using gcloud
commands to do this; however, because gcloud
commands are not declarative, using them is not possible when implementing GitOps. Instead, we'll use Terraform to create the Kubernetes cluster for us. In the next chapter, we will also use the same cluster to understand other nuances of GitOps in more detail. For now, let's go ahead and create an environment repository.
Navigate to https://github.com and create a repository using a name of your choice. For this exercise, we will use gitops-environments
. Once you have done that, navigate to Google Cloud Shell and clone the repository using the following command:
$ cd ~ $ git clone https://github.com...