Table of Contents (GKE and tools with Terraform)
- Google Kubernetes Engine with Terraform
- Terraform graph
- Automatic provisioning
- Reporting bugs
- Patches and pull requests
- License
- Code of conduct
Google Kubernetes Engine with Terraform
-
Download and install google cloud sdk
-
One may install gcloud sdk silently for all users as root with access to GCLOUD_HOME for only speficic user:
export USERNAME="<<you_user_name>>"
export SHARE_DATA=/data
su -c "export SHARE_DATA=/data && export CLOUDSDK_INSTALL_DIR=$SHARE_DATA export CLOUDSDK_CORE_DISABLE_PROMPTS=1 && curl https://sdk.cloud.google.com | bash" $USER_NAME
OR
export SHARE_DATA=/data && export CLOUDSDK_INSTALL_DIR=$SHARE_DATA export CLOUDSDK_CORE_DISABLE_PROMPTS=1 && curl https://sdk.cloud.google.com | bash
echo "source $SHARE_DATA/google-cloud-sdk/path.bash.inc" >> /etc/profile.d/gcloud.sh
echo "source $SHARE_DATA/google-cloud-sdk/completion.bash.inc" >> /etc/profile.d/gcloud.sh
-
-
Clone this repository
-
Please create Service Credential of type JSON via https://console.cloud.google.com/apis/credentials, download and save as google.json in credentials folder.
-
terraform init && terraform plan -out "run.plan" && terraform apply "run.plan"
. Please note the tags name prompted during plan may be dev/tst or any other stage.
Prompted variables | Expected value |
---|---|
cluster_name | Name of the GKE Cluster |
cluster_location | us-central1 or europe-west2 (UK) or europe-west4 (NL) any other region |
node_count | master count - 1 master is to three minimum workers e.g: 1 |
master_auth_username | admin |
master_auth_password | 16 letters and strong like e.g: !@#olie!@#olie!@#23D# |
cluster_tag | gke_devor gke_tst or gke_uat or gke_prod |
project | The GCP project name |
Automatic Provisioning
https://github.com/HEROEngineer/gke-terraform
Pre-req:
-
gcloud should be installed. Silent install is -
export $USERNAME="<<you_user_name>>" && export SHARE_DATA=/data && su -c "export SHARE_DATA=/data && export CLOUDSDK_INSTALL_DIR=$SHARE_DATA export CLOUDSDK_CORE_DISABLE_PROMPTS=1 && curl https://sdk.cloud.google.com | bash" $USER_NAME && echo "source $SHARE_DATA/google-cloud-sdk/path.bash.inc" >> /etc/profile.d/gcloud.sh && echo "source $SHARE_DATA/google-cloud-sdk/completion.bash.inc" >> /etc/profile.d/gcloud.sh &&
-
Please create Service Credential of type JSON via https://console.cloud.google.com/apis/credentials, download and save as google.json in credentials folder of the gke-terraform
-
Default user name is the local username
Plan:
terraform init && terraform plan -var cluster_location=us-west1 -var cluster_name=devgkeclus -var cluster_tag=devgkeuswest -var master_auth_password=\!@#olie\!@#olie\!@#23D# -var master_auth_username=admin -var node_count=1 -var project=<<your-google-cloud-project-name>> -out "run.plan"
Apply:
terraform apply "run.plan"
Destroy:
terraform destroy -var cluster_location=us-west1 -var cluster_name=devgkeclus -var cluster_tag=devgkeuswest -var master_auth_password=\!@#olie\!@#olie\!@#23D# -var master_auth_username=admin -var node_count=1 -var project=<<your-google-cloud-project-name>>
Reporting bugs
Please report bugs by opening an issue in the GitHub Issue Tracker. Bugs have auto template defined. Please view it here
Patches and pull requests
Patches can be submitted as GitHub pull requests. If using GitHub please make sure your branch applies to the current master as a 'fast forward' merge (i.e. without creating a merge commit). Use the git rebase
command to update your branch to the current master if necessary.
License
- Please see the LICENSE file for licensing information.
Code of Conduct
- Please see the Code of Conduct