Skip to content

Instantly share code, notes, and snippets.

@donalmacc
Created February 10, 2024 12:27
Show Gist options
  • Save donalmacc/0efbb0b377533232da3f776c60690869 to your computer and use it in GitHub Desktop.
Save donalmacc/0efbb0b377533232da3f776c60690869 to your computer and use it in GitHub Desktop.
terraform {
required_providers {
digitalocean = {
source = "digitalocean/digitalocean"
version = "~> 2.0"
}
}
}
# Set the variable value in *.tfvars file
# or using -var="do_token=..." CLI option
variable "do_token" {}
# Configure the DigitalOcean Provider
provider "digitalocean" {
token = var.do_token
}
resource "digitalocean_kubernetes_cluster" "foo" {
name = "foo"
region = "nyc1"
# Grab the latest version slug from `doctl kubernetes options versions`
version = "1.22.8-do.1"
node_pool {
name = "worker-pool"
size = "s-2vcpu-2gb"
node_count = 3
taint {
key = "workloadKind"
value = "database"
effect = "NoSchedule"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment