FADI - Ingest, store and analyse big data flows
This repository contains a Terraform project that builds a Google Kubernetes Engine cluster with a custom node pool.
The creation of the infrastructure and its modifications are done with Terraform.
HashiCorp Terraform enables you to safely and predictably create, change, and improve infrastructure. It is an open source tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned.
Before this module can be used in a project, you must ensure that the following pre-requisites are fulfilled:
Install:
Kubernetes Engine Admin
role.Editor
role.Storage Object Admin
role (for Terraform tfstate
bucket). gcloud auth activate-service-account --key-file sa_gke.json
Create a bucket to store the tfstate
. (This step should be done with Terraform)
gsutil mb -c regional -l europe-west1 gs://<your-project-id>-tfstate
Important note: The settings above are “loose”, you will need to fine tune permissions and setup security measures depending on your deployment.
Then perform the following commands on the root folder:
sa_gke.json
is in this folderterraform init
to fetch the relevant plug-ins,terraform plan
to see the infrastructure planterraform apply
to build the cluster,gcloud auth activate-service-account --key-file sa_gke.json
gcloud config set project <your-project-id>
set the current project,gcloud container clusters list
(to list clusters),gcloud container clusters get-credentials gke-fadi --zone europe-west1-d
to setup kubeconfig
,
Now you can access your cluster using the Kubernetes CLI: kubectl cluster-info
.
terraform destroy
to destroy the built infrastructure.