-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhelm_setup.tf
63 lines (52 loc) · 1.41 KB
/
helm_setup.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
59
60
61
62
resource "kubernetes_service_account" "tiller" {
metadata {
name = "tiller"
namespace = "default"
}
depends_on = [
local_file.kube_config,
null_resource.linkerd,
]
}
/*
create a clusterrolebinding for tiller
*/
resource "kubernetes_cluster_role_binding" "tiller" {
metadata {
name = "tiller"
}
role_ref {
api_group = "rbac.authorization.k8s.io"
kind = "ClusterRole"
name = "cluster-admin"
}
subject {
kind = "ServiceAccount"
name = "tiller"
namespace = "default"
}
# Ensure that config is existent upon creation and destruction of cluster.
depends_on = [
local_file.kube_config,
null_resource.linkerd,
]
}
provider "helm" {
kubernetes {
host = digitalocean_kubernetes_cluster.trainingscenter.endpoint
load_config_file = false
token = digitalocean_kubernetes_cluster.trainingscenter.kube_config[0].token
client_certificate = base64decode(
digitalocean_kubernetes_cluster.trainingscenter.kube_config[0].client_certificate,
)
client_key = base64decode(
digitalocean_kubernetes_cluster.trainingscenter.kube_config[0].client_key,
)
cluster_ca_certificate = base64decode(
digitalocean_kubernetes_cluster.trainingscenter.kube_config[0].cluster_ca_certificate,
)
}
service_account = "tiller"
namespace = "default"
install_tiller = true
}