• This repository has been archived on 29/Mar/2023
  • Stars
    star
    357
  • Rank 119,149 (Top 3 %)
  • Language HCL
  • License
    Apache License 2.0
  • Created almost 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Terraform code and scripts for deploying a Google Kubernetes Engine (GKE) cluster.

Sunset notice

We believe there is an opportunity to create a truly outstanding developer experience for deploying to the cloud, however developing this vision requires that we temporarily limit our focus to just one cloud. Gruntwork has hundreds of customers currently using AWS, so we have temporarily suspended our maintenance efforts on this repo. Once we have implemented and validated our vision for the developer experience on the cloud, we look forward to picking this up. In the meantime, you are welcome to use this code in accordance with the open source license, however we will not be responding to GitHub Issues or Pull Requests.

If you wish to be the maintainer for this project, we are open to considering that. Please contact us at [email protected].


GitHub tag (latest SemVer) Terraform Version

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.

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 [email protected].

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.

More Repositories

1

terragrunt

Terragrunt is a flexible orchestration tool that allows Infrastructure as Code written in OpenTofu/Terraform to scale.
Go
7,998
star
2

terratest

Terratest is a Go library that makes it easier to write automated tests for your infrastructure code.
Go
7,425
star
3

cloud-nuke

A tool for cleaning up your cloud accounts by nuking (deleting) all resources within it
Go
2,722
star
4

git-xargs

git-xargs is a command-line tool (CLI) for making updates across multiple Github repositories with a single command.
Go
928
star
5

terragrunt-infrastructure-live-example

A repo used to show examples file/folder structures you can use with Terragrunt and Terraform
HCL
748
star
6

bash-commons

A collection of reusable Bash functions for handling common tasks such as logging, assertions, string manipulation, and more
Shell
747
star
7

intro-to-terraform

Sample code for the blog post series "A Comprehensive Guide to Terraform."
HCL
732
star
8

fetch

Download files, folders, and release assets from a specific git commit, branch, or tag of public and private GitHub repos.
Go
586
star
9

kubergrunt

Kubergrunt is a standalone go binary with a collection of commands to fill in the gaps between Terraform, Helm, and Kubectl. https://www.gruntwork.io
Go
510
star
10

pre-commit

A collection of pre-commit hooks used by Gruntwork tools
Shell
476
star
11

infrastructure-as-code-training

Materials for learning how to use infrastructure-as-code
Ruby
351
star
12

terragrunt-infrastructure-modules-example

A repo used to show examples file/folder structures you can use with Terragrunt and Terraform
HCL
298
star
13

terraform-aws-utilities

A collection of useful Terraform utilities
HCL
214
star
14

helm-kubernetes-services

Helm charts that can be used to package your applications into production ready deployments for Kubernetes. https://www.gruntwork.io
Go
192
star
15

infrastructure-as-code-testing-talk

Sample code for the talk "How to test your infrastructure code: automated testing for Terraform, Docker, Packer, Kubernetes, and more" by Yevgeniy Brikman
Go
186
star
16

boilerplate

A tool for generating files and folders ("boilerplate") from a set of templates
Go
166
star
17

toc

A Table of Contents of all Gruntwork Code
Shell
117
star
18

terraform-google-network

Terraform code and scripts for deploying a GCP Virtual Private Cloud (VPC).
HCL
107
star
19

health-checker

A simple HTTP server that will return 200 OK if all configured health checks pass.
Go
98
star
20

terraform-google-load-balancer

Terraform modules for deploying Load Balancers in GCP
HCL
93
star
21

terraform-google-sql

Terraform modules for deploying Google Cloud SQL (e.g. MySQL, PostgreSQL) in GCP
Go
92
star
22

terraform-aws-couchbase

Reusable infrastructure modules for running Couchbase on AWS
HCL
92
star
23

gruntwork-installer

A script to make it easy to install Gruntwork Modules
Shell
92
star
24

terragrunt-action

A GitHub Action for installing and running Terragrunt
Shell
91
star
25

terraform-training-solutions

The solutions for the exercises in the Infrastructure as Code with Terraform Workshop
HCL
81
star
26

terraform-kubernetes-helm

Terraform code and scripts for deploying Helm Server (Helm v2) on a Kubernetes cluster. https://www.gruntwork.io
HCL
65
star
27

terraform-fake-modules

HCL
45
star
28

private-tls-cert

A simple Terraform module to generate self-signed TLS certificates for private use
HCL
43
star
29

terratest-helm-testing-example

Example Helm Chart and corresponding test code using terratest.
Go
42
star
30

gruntwork-io.github.io

The gruntwork.io website
HTML
41
star
31

terraform-google-static-assets

Modules for managing static assets (CSS, JS, images) in GCP
HCL
36
star
32

go-commons

A standard library to use in all Gruntwork CLI tools
Go
34
star
33

knowledge-base

Gruntwork Knowledge Base. You are more than welcomed to create questions and share knowledge with our community.
34
star
34

docs

Gruntwork docs files plus a set of tools to auto-generate a docs website from package markdown files.
JavaScript
26
star
35

terraform-google-ci

Terraform code and scripts for deploying automated CI/CD pipelines on GCP.
HCL
19
star
36

patcher-action

A GitHub Action for running Patcher, including setting up promotion workflows.
TypeScript
17
star
37

terraform-kubernetes-namespace

This repo contains a Module for managing Kubernetes Namespaces with Terraform.
HCL
17
star
38

tflint-ruleset-aws-cis

Tflint rules for CIS AWS Foundations Benchmark compliance checks. These rules work in addition to the recommendations from Gruntwork's CIS Service Catalog.
Go
11
star
39

helmcharts

Holds Gruntwork's public helm chart repository
6
star
40

sample-app-docker

Sample app for use with Google Cloud Build
JavaScript
6
star
41

terragrunt-engine-opentofu

Go
5
star
42

terraform-hiera-like-example

A repo that shows an example of how to deploy services dynamically from Hiera-like YAML files using Terraform/Terragrunt
HCL
2
star
43

module-ci-update-terraform-variable-test

This repo is used as part of the automated tests for the terraform-update-tests script in module-ci
HCL
2
star
44

pipelines-orchestrate

Shell
2
star
45

terragrunt-engine-go

Go
2
star
46

terraform-module-in-root-for-terragrunt-test

This repo is used during automated tests for Terragrunt. It is not meant for any production usage.
HCL
1
star
47

pipelines-dispatch

Shell
1
star
48

terraform-null-terragrunt-registry-test

HCL
1
star
49

legal

1
star
50

pipelines-aws-execute

1
star
51

pipelines-workflows

1
star
52

pipelines-baseline-account-action

1
star
53

website-comments

This repository captures all comments written in the guides
1
star
54

pipelines-provision-repo-action

1
star
55

fetch-test-public

A public repo meant solely for testing with gruntwork-io/fetch
1
star
56

pipelines-execute

Shell
1
star
57

pipelines-status-update

Shell
1
star
58

pipelines-provision-access-control-action

1
star
59

pipelines-baseline-child-account-action

1
star
60

pipelines-bootstrap

1
star
61

pipelines-preflight-action

1
star
62

pipelines-provision-account-action

1
star