-
Notifications
You must be signed in to change notification settings - Fork 4
/
do-k8s.tf
58 lines (49 loc) · 1.13 KB
/
do-k8s.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
locals {
do_cluster_name = local.stack_name
}
# List available Droplet sizes by `doctl compute size list`
resource "digitalocean_kubernetes_cluster" "cluster" {
name = local.do_cluster_name
region = "lon1"
version = "1.28.13-do.0"
auto_upgrade = true
node_pool {
name = "worker-pool"
size = "s-2vcpu-4gb"
auto_scale = true
min_nodes = 3
max_nodes = 4
}
lifecycle {
prevent_destroy = true
}
}
# resource "digitalocean_kubernetes_node_pool" "s-4vcpu-8gb" {
# cluster_id = digitalocean_kubernetes_cluster.cluster.id
# name = "s-4vcpu-8gb"
# size = "s-4vcpu-8gb"
# node_count = 1
# }
provider "kubernetes" {
alias = "do"
# run `earthly +do-kubeconfig` to generate this file
config_path = "./kubeconfig_do"
}
provider "helm" {
alias = "do"
kubernetes {
config_path = "./kubeconfig_do"
}
}
resource "kubernetes_namespace_v1" "do-monitoring" {
provider = kubernetes.do
metadata {
name = "monitoring"
}
}
resource "kubernetes_namespace_v1" "do-mysql-operator" {
provider = kubernetes.do
metadata {
name = "mysql-operator"
}
}