This project creates the GKE cluster and provisions it with the application image from Container Registry. Some modules were copied from https://github.com/FairwindsOps/terraform-gke and adopted to this particular case.
- You should start with gcloud auth login and enter your credentials. export $PROJECT_NAME= "PROJECT ID" && export $REGION= "PROJECT REGION"
- Open the GCP portal, Go to APIs & Services - Credentials - CREATE CREDENTIALS and download the .json file, change the credentials.tf file to point your .json file. Create Cloud Storage Account and paste the name to backend.tf file.
- replace the image name from Container Registry to yours value in .auto.tf.vars (container_image)
- Create the Serivce account with role Token Creator and replace the name in modules/provider.tf
- cd development && terraform init
- terraform apply -app is deployed and Load balancer installed
- need to configure more secure way to store credentials file( sops/export to envs)
- need to create a pipeline or some kind of thing to replace image name that will be used for deployment
- need to create GCS before deployment process because backend requires to be before deployment process ( need to create separate folder with only gcs.tf file and start deployment process from here OR terraform apply -target=module.gcsmodule )
- need to configure DNS and SSL at least for the production needs
- need to create container registry before the infrastructure creation.