GithubHelp home page GithubHelp logo

jeket / terraform-digitalocean-k8s Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hajowieland/terraform-digitalocean-k8s

0.0 1.0 0.0 28 KB

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

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

License: GNU General Public License v3.0

HCL 81.17% Shell 18.83%

terraform-digitalocean-k8s's Introduction

Terraform Kubernetes on Digital Ocean

This repository contains the Terraform module for creating a Kubernetes Cluster on Digital Ocean.

It uses the latest available Digital Ocean Kubernetes slug version available 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/#digital-ocean

Digital Ocean Logo

Requirements

You need a Digital Ocean account and a Personal access token.

Features

  • Always uses latest available Kubernetes version on Digital Ocean
  • Kubernetes Cluster with 1 + 2 = 3 worker nodes (default node pool + additional node pool)
  • kubeconfig file generation at completion

Notes

  • The resources will be created in your default Digital Ocean project
  • If you want to add/remove worker nodes, just edit the do_k8s_nodepool_size variable
  • It can take 2-3 minutes after Terraform completes until the Kubernetes nodes are available
  • export KUBECONFIG=./kubeconfig_do in repo root dir to use the generated kubeconfig file
  • The enable_digitalocean 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: fra1 (Frankfurt, Germany)
  • Default Kubernetes version: 1.14.2-do.0
  • Default Node type: s-1vcpu-2gb (1x vCPU, 2GB memory)
  • Default main pool size: 1
  • Default additional node pool size: 2

Runtime

Runtime terraform apply:

~5-7min

2.56s user
0.89s system
7:16.37 total
2.38s user
0.75s system
5:15.77 total

Terraform Inputs

Name Description Type Default Required
enable_digitalocean Enable / Disable Digital Ocean bool true yes
random_cluster_suffix Random 6 byte hex suffix for cluster name string yes
do_k8s_nodes Worker nodes int 2 yes
do_token Digital Ocean Personal access token string DUMMY yes
do_region Digital Ocean region string fra1 yes
do_k8s_name Digital Ocean Kubernetes cluster name string k8s-do yes
do_k8s_pool_name Digital Ocean Kubernetes default node pool name string k8s-nodepool-do yes
do_k8s_nodes Digital Ocean Kubernetes default node pool size number 1 yes
do_k8s_node_type Digital Ocean Kubernetes default node pool type string s-1vcpu-2gb yes
do_k8s_nodepool_type Digital Ocean Kubernetes additional node pool type string s-1vcpu-2gb yes
do_k8s_nodepool_size Digital Ocean Kubernetes additional node pool size number 2 yes

Outputs

Name Description
kubeconfig_path_do Kubernetes kubeconfig file

terraform-digitalocean-k8s's People

Contributors

hajowieland avatar

Watchers

 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.