Giter VIP home page Giter VIP logo

ngouru / terraform-google-k8s Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hajowieland/terraform-google-k8s

0.0 0.0 0.0 29 KB

Terraform module for creating a Kubernetes cluster on Google Cloud Platform with latest available version, kubeconfig file creation and addititonal node pool.

Home Page: https://registry.terraform.io/modules/hajowieland/k8s/google

License: GNU General Public License v3.0

HCL 100.00%

terraform-google-k8s's Introduction

Terraform Kubernetes on Google Cloud

This repository contains the Terraform module for creating a simple but ready-to-use Kubernetes Cluster on Google Cloud Kubernetes Engine (GKE).

It uses the latest available Kubernetes version available in the Google Cloud location and creates a kubeconfig file at completion.

Link to my comprehensive blog post (beginner friendly):

https://napo.io/posts/terraform-kubernetes-multi-cloud-ack-aks-dok-eks-gke-oke/#google-cloud

Google Cloud Logo

Requirements

You need a Google Cloud account with billing enabled (if you already exceeded the Trial).

Features

  • Always uses latest Kubernetes version available at Google Cloud location
  • kubeconfig file generation
  • Master nodes are available from workstation IP address only (master_authorized_networks_config)
  • Create zonal (default) or regional GKE cluster (enable_regional_cluster)

Notes

  • export KUBECONFIG=./kubeconfig_gke in repo root dir to use the generated kubeconfig file
  • If you want to create a regional cluster set enable_regional_cluster to true (keep in mind that number of gke_nodes will be deployed in every zone - e.g. 3 zones in a region * 2 gke_nodes => 6 worker nodes)
  • The enable_google variable is used in the hajowieland/terraform-kubernetes-multi-cloud module

Defaults

See tables at the end for a comprehensive list of inputs and outputs.

  • Default region: europe-west3 (Frankfurt, Germany)
  • Default node type: n1-standard-2 (1x vCPU, 7.5GB memory)
  • Default node pool size: 2

Runtime

terraform apply:

~5-6min

4.28s user
1.11s system
4:58.60 total
4.72s user
1.39s system
5:03.16 total
4.74s user
1.40s system
5:34.30 total

Terraform Inputs

Name Description Type Default Required
enable_google Enable / Disable Google Cloud k8s bool true yes
enable_regional_cluster Create regional GKE cluster instead of zonal bool true no
random_cluster_suffix Random 6 byte hex suffix for cluster name string no
gcp_project GCP Project ID string yes
gcp_region GCP region string europe-west3 no
gke_name GKE cluster name string k8s no
gke_pool_name GKE node pool name string k8snodepool no
gke_nodes GKE Kubernetes worker nodes number 2 no
gke_preemptible Use GKE preemptible nodes bool false no
gke_node_type GKE node instance type string n1-standard-2 no
gke_serviceaccount GCP service account for GKE string default no
gke_oauth_scopes GCP OAuth scopes for GKE list(string) "https://www.googleapis.com/auth/compute", "https://www.googleapis.com/auth/devstorage.read_only", "https://www.googleapis.com/auth/logging.write", "https://www.googleapis.com/auth/monitoring" no

Outputs

Name Description
kubeconfig_path_gke Kubernetes kubeconfig file
latest_k8s_master_version Latest Kubernetes master Version available in Google Cloud location

terraform-google-k8s's People

Contributors

hajowieland avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.