Created
July 29, 2020 20:57
-
-
Save dixneuf19/811b84163c051f3c791d289d005425e4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# main.tf | |
# Deploy the actual Kubernetes cluster | |
resource "digitalocean_kubernetes_cluster" "kubernetes_cluster" { | |
name = "terraform-do-cluster" | |
region = "ams3" | |
version = "1.18.6-do.0" | |
tags = ["my-tag"] | |
# This default node pool is mandatory | |
node_pool { | |
name = "default-pool" | |
size = "s-1vcpu-2gb" # minimum size, list available options with `doctl compute size list` | |
auto_scale = false | |
node_count = 2 | |
tags = ["node-pool-tag"] | |
labels = { | |
"padok.fr/en/blog" = "up" | |
} | |
} | |
} | |
# Another node pool for applications | |
resource "digitalocean_kubernetes_node_pool" "app_node_pool" { | |
cluster_id = digitalocean_kubernetes_cluster.kubernetes_cluster.id | |
name = "app-pool" | |
size = "s-2vcpu-4gb" # bigger instances | |
tags = ["applications"] | |
# you can setup autoscaling | |
auto_scale = true | |
min_nodes = 2 | |
max_nodes = 5 | |
labels = { | |
service = "apps" | |
priority = "high" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment