This steps are mandatory to create a gke cluster in a gcp project.
- terraform
- gcp account
- gcp project, enabled compute engine api, enabled kubernetes engine api
- gcp service account
-
after creating service account save your key file
*.json
in folder.keys
-
add credentials to terrafaorm via environment variable, for use github actions make sure to have
GOOGLE_APPLICATION_CREDENTIALS
as secret
export GOOGLE_APPLICATION_CREDENTIALS=*.json
- change
projectid
in fileterraform.tfvars
$ terraform init --reconfigure
- validate
$ terraform validate
- plan
$ terraform plan -out "planfile"
- apply
$ terraform apply "planfile"
- destroy
$ terraform destroy