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.
https://napo.io/posts/terraform-kubernetes-multi-cloud-ack-aks-dok-eks-gke-oke/#digital-ocean
- Terraform Kubernetes on Digital Ocean
- Requirements
- Features
- Notes
- Defaults
- Runtime
- Terraform Inputs
- Outputs
You need a Digital Ocean account and a Personal access token.
- 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
- 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
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 terraform apply
:
~5-7min
2.56s user
0.89s system
7:16.37 total
2.38s user
0.75s system
5:15.77 total
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 |
Name | Description |
---|---|
kubeconfig_path_do | Kubernetes kubeconfig file |