Repo Browser: Google Kubernetes Engine (GKE) Cluster You need to enable JavaScript to run this app.
Gruntwork Website
Google Kubernetes Engine (GKE) Cluster Deploy a Kubernetes cluster on top of Google Kubernetes Engine (GKE).
Google Kubernetes Engine (GKE) Module
This repo contains a Terraform module for running a Kubernetes cluster on Google Cloud Platform (GCP)
using Google Kubernetes Engine (GKE) .
Quickstart
If you want to quickly spin up a GKE Public Cluster, you can run the example that is in the root of this
repo. Check out the gke-basic-helm example documentation
for instructions.
What's in this repo
This repo has the following folder structure:
root : The root folder contains an example of how
to deploy a GKE Public Cluster with an example chart with Helm . See gke-basic-helm
for the documentation.
modules : This folder contains the
main implementation code for this Module, broken down into multiple standalone submodules.
The primary module is:
There are also several supporting modules that add extra functionality on top of gke-cluster
:
examples : This folder contains
examples of how to use the submodules.
test : Automated tests for the submodules
and examples.
What is Kubernetes?
Kubernetes is an open source container management system for deploying, scaling, and managing
containerized applications. Kubernetes is built by Google based on their internal proprietary container management
systems (Borg and Omega). Kubernetes provides a cloud agnostic platform to deploy your containerized applications with
built in support for common operational tasks such as replication, autoscaling, self-healing, and rolling deployments.
You can learn more about Kubernetes from the official documentation .
What is GKE?
Google Kubernetes Engine or "GKE" is a Google-managed Kubernetes environment. GKE is a fully managed experience; it
handles the management/upgrading of the Kubernetes cluster master as well as autoscaling of "nodes" through "node pool"
templates.
Through GKE, your Kubernetes deployments will have first-class support for GCP IAM identities, built-in configuration of
high-availability and secured clusters, as well as native access to GCP's networking features such as load balancers.
<a name="how-to-run-applications"></a>How do you run applications on Kubernetes?
There are three different ways you can schedule your application on a Kubernetes cluster. In all three, your application
Docker containers are packaged as a Pod , which are the
smallest deployable unit in Kubernetes, and represent one or more Docker containers that are tightly coupled. Containers
in a Pod share certain elements of the kernel space that are traditionally isolated between containers, such as the
network space (the containers both share an IP and thus the available ports are shared), IPC namespace, and PIDs in some
cases.
Pods are considered to be relatively ephemeral disposable entities in the Kubernetes ecosystem. This is because Pods are
designed to be mobile across the cluster so that you can design a scalable fault tolerant system. As such, Pods are
generally scheduled with
Controllers that manage the
lifecycle of a Pod. Using Controllers, you can schedule your Pods as:
Jobs, which are Pods with a controller that will guarantee the Pods run to completion.
Deployments behind a Service, which are Pods with a controller that implement lifecycle rules to provide replication
and self-healing capabilities. Deployments will automatically reprovision failed Pods, or migrate Pods to healthy
nodes off of failed nodes. A Service constructs a consistent endpoint that can be used to access the Deployment.
Daemon Sets, which are Pods that are scheduled on all worker nodes. Daemon Sets schedule exactly one instance of a Pod
on each node. Like Deployments, Daemon Sets will reprovision failed Pods and schedule new ones automatically on
new nodes that join the cluster.
What's a Module?
A Module is a canonical, reusable, best-practices definition for how to run a single piece of infrastructure, such
as a database or server cluster. Each Module is written using a combination of Terraform
and scripts (mostly bash) and include automated tests, documentation, and examples. It is maintained both by the open
source community and companies that provide commercial support.
Instead of figuring out the details of how to run a piece of infrastructure from scratch, you can reuse
existing code that has been proven in production. And instead of maintaining all that infrastructure code yourself,
you can leverage the work of the Module community to pick up infrastructure improvements through
a version number bump.
Who maintains this Module?
This Module and its Submodules are maintained by Gruntwork . If you are looking for help or
commercial support, send an email to
support@gruntwork.io .
Gruntwork can help with:
Setup, customization, and support for this Module.
Modules and submodules for other types of infrastructure, such as VPCs, Docker clusters, databases, and continuous
integration.
Modules and Submodules that meet compliance requirements, such as HIPAA.
Consulting & Training on AWS, Terraform, and DevOps.
How do I contribute to this Module?
Contributions are very welcome! Check out the Contribution Guidelines
for instructions.
How is this Module versioned?
This Module follows the principles of Semantic Versioning . You can find each new release, along
with the changelog, in the Releases Page .
During initial development, the major version will be 0 (e.g., 0.x.y
), which indicates the code does not yet have a
stable API. Once we hit 1.0.0
, we will make every effort to maintain a backwards compatible API and use the MAJOR,
MINOR, and PATCH versions on each release to indicate any incompatibilities.
License
Please see LICENSE for how the code in this
repo is licensed.
Copyright © 2020 Gruntwork, Inc.
Questions? Ask away. We're here to talk about our services, answer any questions, give advice, or just to chat.
Ready to hand off the Gruntwork? "https://cdn.gruntwork.io/gruntwork-website/"
{"index":{"js":"https://cdn.gruntwork.io/gruntwork-website/index.bundle.c7884255553b53fbca3a.js","map":"https://cdn.gruntwork.io/gruntwork-website/index.bundle.1b14c1b7d19f1f5eb35d6e118e838255.map"},"styles":{"css":"https://cdn.gruntwork.io/gruntwork-website/styles.bundle.f22938926651ddec7c49.css","js":"https://cdn.gruntwork.io/gruntwork-website/styles.bundle.e782420e74a20dcb8691.js","map":"https://cdn.gruntwork.io/gruntwork-website/styles.bundle.d5e2af49807c6ca33f8367d621ece507.map"},"vendors":{"css":"https://cdn.gruntwork.io/gruntwork-website/vendors.bundle.29f7d0366a0978763f96.css","js":"https://cdn.gruntwork.io/gruntwork-website/vendors.bundle.fa8174a130797d75d12c.js","map":"https://cdn.gruntwork.io/gruntwork-website/vendors.bundle.57243d94deeeb29d5061288a338b4eb6.map"}}
{"treedata":{"name":"root","toggled":true,"children":[{"name":".circleci","children":[{"name":"config.yml","path":".circleci/config.yml","sha":"310ac2e197373e974a3a1b59be2a0adf188c2cce"}]},{"name":".gitignore","path":".gitignore","sha":"1126bffabd62465b897cca526c36429656704cb8"},{"name":".pre-commit-config.yaml","path":".pre-commit-config.yaml","sha":"1b848ef901cc69bf0207a6715cab173e30f6f95d"},{"name":"CODEOWNERS","path":"CODEOWNERS","sha":"e47d027ad15beb415e4f619397c8a3ef1ccd2497"},{"name":"CONTRIBUTING.md","path":"CONTRIBUTING.md","sha":"9069f862a8bc86aca934eb6b46d25ccdd0890adc"},{"name":"GRUNTWORK_PHILOSOPHY.md","path":"GRUNTWORK_PHILOSOPHY.md","sha":"02d9873a74c99fe6d9b6b26bd9f8eb4a7a699c32"},{"name":"LICENSE","path":"LICENSE","sha":"d645695673349e3947e8e5ae42332d0ac3164cd7"},{"name":"NOTICE","path":"NOTICE","sha":"87a256bde643610e57c37ddc30bd5184b763f461"},{"name":"README.md","path":"README.md","sha":"f04b58d61790b562c49ebbb295f45feb75f59414","toggled":true},{"name":"examples","children":[{"name":"gke-basic-helm","children":[{"name":"README.md","path":"examples/gke-basic-helm/README.md","sha":"b1ad67c90bd5ef4663cc792c06396875ec83bbc2"}]},{"name":"gke-private-cluster","children":[{"name":"README.md","path":"examples/gke-private-cluster/README.md","sha":"70597859aef8c841ef547007f0c5abf0daa639c7"},{"name":"example-app","children":[{"name":"nginx.yml","path":"examples/gke-private-cluster/example-app/nginx.yml","sha":"e4b2476d18dfcee49acbc823babbfc44c76ac1b3"}]},{"name":"main.tf","path":"examples/gke-private-cluster/main.tf","sha":"8dbd94c30bf549eff48045c5cacba799cd52afb4"},{"name":"outputs.tf","path":"examples/gke-private-cluster/outputs.tf","sha":"431590d8fd52bec033e24a6c47aa6f1d66e3f95e"},{"name":"variables.tf","path":"examples/gke-private-cluster/variables.tf","sha":"74f403c2ab1cf221c825a2f8e391dcef997267f1"}]},{"name":"gke-public-cluster","children":[{"name":"README.md","path":"examples/gke-public-cluster/README.md","sha":"55bf1839dfd506d2fb9aaebdcd8b05011a612d6a"},{"name":"main.tf","path":"examples/gke-public-cluster/main.tf","sha":"5bfe269d074fbdadef7195768da63889cabee3e6"},{"name":"outputs.tf","path":"examples/gke-public-cluster/outputs.tf","sha":"431590d8fd52bec033e24a6c47aa6f1d66e3f95e"},{"name":"variables.tf","path":"examples/gke-public-cluster/variables.tf","sha":"181685530bc8f6545caa252b7804ef97cede932b"}]}]},{"name":"main.tf","path":"main.tf","sha":"dab4502ad924779d8293595c2881c29d95f0cd4d"},{"name":"modules","children":[{"name":"gke-cluster","children":[{"name":"README.md","path":"modules/gke-cluster/README.md","sha":"19bad2de5bb4ba3cf982d6ac5080cbb47ac4a6a7"},{"name":"main.tf","path":"modules/gke-cluster/main.tf","sha":"fa38889a624cbb449d312cd5d691fb5a32d3606a"},{"name":"outputs.tf","path":"modules/gke-cluster/outputs.tf","sha":"b6d00fc16ffdd39b74e80230f2ead8fc17b75098"},{"name":"variables.tf","path":"modules/gke-cluster/variables.tf","sha":"c441061edfca9a23860d51a54f088b9b312233a5"}]},{"name":"gke-service-account","children":[{"name":"README.md","path":"modules/gke-service-account/README.md","sha":"38e6ede2d087dcdba2df7a7ae97810c16b72d8d8"},{"name":"main.tf","path":"modules/gke-service-account/main.tf","sha":"35c0cf2922f244fefa75ad13b2c4103bda4b7ddf"},{"name":"outputs.tf","path":"modules/gke-service-account/outputs.tf","sha":"6655c1fb7275d26722c483af07d1820f33697e3a"},{"name":"variables.tf","path":"modules/gke-service-account/variables.tf","sha":"16ababc6c790759a0e1d1dd1c62557f747dfa9a1"}]}]},{"name":"outputs.tf","path":"outputs.tf","sha":"431590d8fd52bec033e24a6c47aa6f1d66e3f95e"},{"name":"test","children":[{"name":"README.md","path":"test/README.md","sha":"efd43a3b31a2b93a64f8a6a9b0eff22b09caa0a6"},{"name":"charts","children":[{"name":"minimal-pod","children":[{"name":".helmignore","path":"test/charts/minimal-pod/.helmignore","sha":"f0c13194444163d1cba5c67d9e79231a62bc8f44"},{"name":"Chart.yaml","path":"test/charts/minimal-pod/Chart.yaml","sha":"9b6289f1c43dbc2c4b1f9d0ae9933a5a9ca06e1b"},{"name":"templates","children":[{"name":"_helpers.tpl","path":"test/charts/minimal-pod/templates/_helpers.tpl","sha":"3e013e603b8292ed9c493e4b46522cbffaaf16d3"},{"name":"pod.yaml","path":"test/charts/minimal-pod/templates/pod.yaml","sha":"6d84a9a5c72dcb3e493e1f4a5b869fea92abff54"}]},{"name":"values.yaml","path":"test/charts/minimal-pod/values.yaml","sha":"c3a88d09ca9e077599eb8362fa910171270e0ad6"}]}]},{"name":"gke_basic_helm_test.go","path":"test/gke_basic_helm_test.go","sha":"55a969c1110c41335a78bf62bd1b25e686827409"},{"name":"gke_cluster_test.go","path":"test/gke_cluster_test.go","sha":"38d2068465d0f98c61e40774ab44d5534c620bcc"},{"name":"go.mod","path":"test/go.mod","sha":"cbec165db3063f19f1be1d11adc84e5fa35deb5e"},{"name":"go.sum","path":"test/go.sum","sha":"e7c9ba4756d884f5051efa5037352722d2e55ad9"},{"name":"terratest_options.go","path":"test/terratest_options.go","sha":"875cb013a44955910fce1bc5909103f2a2241a47"},{"name":"test_helpers.go","path":"test/test_helpers.go","sha":"33ef675bb7206ab6fb5176d60115e0f261e5c190"},{"name":"validation","children":[{"name":"validate_all_modules_and_examples_test.go","path":"test/validation/validate_all_modules_and_examples_test.go","sha":"74c928d0cbc2914e5cd708277bd857cb2375b660"}]}]},{"name":"variables.tf","path":"variables.tf","sha":"3c24dc1b8c5e8e0528f405a97e6f18e409c161b3"}]},"detailsContent":"<p><a href=\"https://gruntwork.io/?ref=repo_google_gke\" class=\"preview__body--description--blue\" target=\"_blank\"><img src=\"https://img.shields.io/badge/maintained%20by-gruntwork.io-%235849a6.svg\" alt=\"Maintained by Gruntwork.io\" class=\"preview__body--diagram\"></a>\n<a href=\"#open_modal\" class=\"preview__body--description--blue\"><img src=\"https://img.shields.io/github/tag/gruntwork-io/terraform-google-gke.svg?label=latest\" alt=\"GitHub tag (latest SemVer)\" class=\"preview__body--diagram\"></a>\n<img src=\"https://img.shields.io/badge/tf-%3E%3D1.0.x-blue.svg\" alt=\"Terraform Version\" class=\"preview__body--diagram\"></p>\n<h1 class=\"preview__body--title\" id=\"google-kubernetes-engine-gke-module\">Google Kubernetes Engine (GKE) Module</h1><div class=\"preview__body--border\"></div><p>This repo contains a <a href=\"https://www.terraform.io\" class=\"preview__body--description--blue\" target=\"_blank\">Terraform</a> module for running a Kubernetes cluster on <a href=\"https://cloud.google.com/\" class=\"preview__body--description--blue\" target=\"_blank\">Google Cloud Platform (GCP)</a>\nusing <a href=\"https://cloud.google.com/kubernetes-engine/\" class=\"preview__body--description--blue\" target=\"_blank\">Google Kubernetes Engine (GKE)</a>.</p>\n<h2 class=\"preview__body--subtitle\" id=\"quickstart\">Quickstart</h2>\n<p>If you want to quickly spin up a GKE Public Cluster, you can run the example that is in the root of this\nrepo. Check out the <a href=\"/repos/v0.10.0/terraform-google-gke/examples/gke-basic-helm\" class=\"preview__body--description--blue\">gke-basic-helm example documentation</a>\nfor instructions.</p>\n<h2 class=\"preview__body--subtitle\" id=\"whats-in-this-repo\">What's in this repo</h2>\n<p>This repo has the following folder structure:</p>\n<ul>\n<li>\n<p><a href=\"/repos/v0.10.0/terraform-google-gke\" class=\"preview__body--description--blue\">root</a>: The root folder contains an example of how\nto deploy a GKE Public Cluster with an example chart with <a href=\"https://helm.sh/\" class=\"preview__body--description--blue\" target=\"_blank\">Helm</a>. See <a href=\"/repos/v0.10.0/terraform-google-gke/examples/gke-basic-helm\" class=\"preview__body--description--blue\">gke-basic-helm</a>\nfor the documentation.</p>\n</li>\n<li>\n<p><a href=\"/repos/v0.10.0/terraform-google-gke/modules\" class=\"preview__body--description--blue\">modules</a>: This folder contains the\nmain implementation code for this Module, broken down into multiple standalone submodules.</p>\n<p>The primary module is:</p>\n<ul>\n<li><a href=\"/repos/v0.10.0/terraform-google-gke/modules/gke-cluster\" class=\"preview__body--description--blue\">gke-cluster</a>: The GKE Cluster module is used to\nadminister the <a href=\"https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-architecture\" class=\"preview__body--description--blue\" target=\"_blank\">cluster master</a>\nfor a <a href=\"https://cloud.google.com/kubernetes-engine/docs/how-to/cluster-admin-overview\" class=\"preview__body--description--blue\" target=\"_blank\">GKE Cluster</a>.</li>\n</ul>\n<p>There are also several supporting modules that add extra functionality on top of <code>gke-cluster</code>:</p>\n<ul>\n<li><a href=\"/repos/v0.10.0/terraform-google-gke/modules/gke-service-account\" class=\"preview__body--description--blue\">gke-service-account</a>:\nUsed to configure a GCP service account for use with a GKE cluster.</li>\n</ul>\n</li>\n<li>\n<p><a href=\"/repos/v0.10.0/terraform-google-gke/examples\" class=\"preview__body--description--blue\">examples</a>: This folder contains\nexamples of how to use the submodules.</p>\n</li>\n<li>\n<p><a href=\"/repos/v0.10.0/terraform-google-gke/test\" class=\"preview__body--description--blue\">test</a>: Automated tests for the submodules\nand examples.</p>\n</li>\n</ul>\n<h2 class=\"preview__body--subtitle\" id=\"what-is-kubernetes\">What is Kubernetes?</h2>\n<p><a href=\"https://kubernetes.io\" class=\"preview__body--description--blue\" target=\"_blank\">Kubernetes</a> is an open source container management system for deploying, scaling, and managing\ncontainerized applications. Kubernetes is built by Google based on their internal proprietary container management\nsystems (Borg and Omega). Kubernetes provides a cloud agnostic platform to deploy your containerized applications with\nbuilt in support for common operational tasks such as replication, autoscaling, self-healing, and rolling deployments.</p>\n<p>You can learn more about Kubernetes from <a href=\"https://kubernetes.io/docs/tutorials/kubernetes-basics/\" class=\"preview__body--description--blue\" target=\"_blank\">the official documentation</a>.</p>\n<h2 class=\"preview__body--subtitle\" id=\"what-is-gke\">What is GKE?</h2>\n<p>Google Kubernetes Engine or "GKE" is a Google-managed Kubernetes environment. GKE is a fully managed experience; it\nhandles the management/upgrading of the Kubernetes cluster master as well as autoscaling of "nodes" through "node pool"\ntemplates.</p>\n<p>Through GKE, your Kubernetes deployments will have first-class support for GCP IAM identities, built-in configuration of\nhigh-availability and secured clusters, as well as native access to GCP's networking features such as load balancers.</p>\n<h2 class=\"preview__body--subtitle\" id=\"a-name-how-to-run-applications-a-how-do-you-run-applications-on-kubernetes\"><a name="how-to-run-applications"></a>How do you run applications on Kubernetes?</h2>\n<p>There are three different ways you can schedule your application on a Kubernetes cluster. In all three, your application\nDocker containers are packaged as a <a href=\"https://kubernetes.io/docs/concepts/workloads/pods/pod/\" class=\"preview__body--description--blue\" target=\"_blank\">Pod</a>, which are the\nsmallest deployable unit in Kubernetes, and represent one or more Docker containers that are tightly coupled. Containers\nin a Pod share certain elements of the kernel space that are traditionally isolated between containers, such as the\nnetwork space (the containers both share an IP and thus the available ports are shared), IPC namespace, and PIDs in some\ncases.</p>\n<p>Pods are considered to be relatively ephemeral disposable entities in the Kubernetes ecosystem. This is because Pods are\ndesigned to be mobile across the cluster so that you can design a scalable fault tolerant system. As such, Pods are\ngenerally scheduled with\n<a href=\"https://kubernetes.io/docs/concepts/workloads/pods/pod-overview/#pods-and-controllers\" class=\"preview__body--description--blue\" target=\"_blank\">Controllers</a> that manage the\nlifecycle of a Pod. Using Controllers, you can schedule your Pods as:</p>\n<ul>\n<li>Jobs, which are Pods with a controller that will guarantee the Pods run to completion.</li>\n<li>Deployments behind a Service, which are Pods with a controller that implement lifecycle rules to provide replication\nand self-healing capabilities. Deployments will automatically reprovision failed Pods, or migrate Pods to healthy\nnodes off of failed nodes. A Service constructs a consistent endpoint that can be used to access the Deployment.</li>\n<li>Daemon Sets, which are Pods that are scheduled on all worker nodes. Daemon Sets schedule exactly one instance of a Pod\non each node. Like Deployments, Daemon Sets will reprovision failed Pods and schedule new ones automatically on\nnew nodes that join the cluster.</li>\n</ul>\n<p></p>\n<h2 class=\"preview__body--subtitle\" id=\"whats-a-module\">What's a Module?</h2>\n<p>A Module is a canonical, reusable, best-practices definition for how to run a single piece of infrastructure, such\nas a database or server cluster. Each Module is written using a combination of <a href=\"https://www.terraform.io/\" class=\"preview__body--description--blue\" target=\"_blank\">Terraform</a>\nand scripts (mostly bash) and include automated tests, documentation, and examples. It is maintained both by the open\nsource community and companies that provide commercial support.</p>\n<p>Instead of figuring out the details of how to run a piece of infrastructure from scratch, you can reuse\nexisting code that has been proven in production. And instead of maintaining all that infrastructure code yourself,\nyou can leverage the work of the Module community to pick up infrastructure improvements through\na version number bump.</p>\n<h2 class=\"preview__body--subtitle\" id=\"who-maintains-this-module\">Who maintains this Module?</h2>\n<p>This Module and its Submodules are maintained by <a href=\"http://www.gruntwork.io/\" class=\"preview__body--description--blue\" target=\"_blank\">Gruntwork</a>. If you are looking for help or\ncommercial support, send an email to\n<a href=\"mailto:support@gruntwork.io?Subject=GKE%20Module\" class=\"preview__body--description--blue\" target=\"_blank\">support@gruntwork.io</a>.</p>\n<p>Gruntwork can help with:</p>\n<ul>\n<li>Setup, customization, and support for this Module.</li>\n<li>Modules and submodules for other types of infrastructure, such as VPCs, Docker clusters, databases, and continuous\nintegration.</li>\n<li>Modules and Submodules that meet compliance requirements, such as HIPAA.</li>\n<li>Consulting & Training on AWS, Terraform, and DevOps.</li>\n</ul>\n<h2 class=\"preview__body--subtitle\" id=\"how-do-i-contribute-to-this-module\">How do I contribute to this Module?</h2>\n<p>Contributions are very welcome! Check out the <a href=\"/repos/v0.10.0/terraform-google-gke/CONTRIBUTING.md\" class=\"preview__body--description--blue\">Contribution Guidelines</a>\nfor instructions.</p>\n<h2 class=\"preview__body--subtitle\" id=\"how-is-this-module-versioned\">How is this Module versioned?</h2>\n<p>This Module follows the principles of <a href=\"http://semver.org/\" class=\"preview__body--description--blue\" target=\"_blank\">Semantic Versioning</a>. You can find each new release, along\nwith the changelog, in the <a href=\"#open_modal\" class=\"preview__body--description--blue\">Releases Page</a>.</p>\n<p>During initial development, the major version will be 0 (e.g., <code>0.x.y</code>), which indicates the code does not yet have a\nstable API. Once we hit <code>1.0.0</code>, we will make every effort to maintain a backwards compatible API and use the MAJOR,\nMINOR, and PATCH versions on each release to indicate any incompatibilities.</p>\n<h2 class=\"preview__body--subtitle\" id=\"license\">License</h2>\n<p>Please see <a href=\"/repos/v0.10.0/terraform-google-gke/LICENSE\" class=\"preview__body--description--blue\">LICENSE</a> for how the code in this\nrepo is licensed.</p>\n<p>Copyright © 2020 Gruntwork, Inc.</p>\n","repoName":"terraform-google-gke","repoRef":"v0.10.0","serviceDescriptor":{"serviceName":"Google Kubernetes Engine (GKE) Cluster","serviceRepoName":"terraform-google-gke","serviceRepoOrg":"gruntwork-io","cloudProviders":["gcp"],"description":"Deploy a Kubernetes cluster on top of Google Kubernetes Engine (GKE).","imageUrl":"grunt.png","licenseType":"open-source","technologies":["Terraform","Bash"],"compliance":[],"tags":[""]},"serviceCategoryName":"Docker orchestration","fileName":"README.md","filePath":"","title":"Repo Browser: Google Kubernetes Engine (GKE) Cluster","description":"Browse the repos in the Gruntwork Infrastructure as Code Library."}