generated from thesis/terraform-module-template-repo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
37 lines (31 loc) · 846 Bytes
/
main.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
resource "kubernetes_namespace" "tiller" {
metadata {
annotations {
description = "Namespace dedicated to tiller install."
}
name = "${var.tiller_namespace_name}"
}
count = "${var.tiller_namespace_name == "kube-system" ? 0 : 1}"
}
resource "kubernetes_service_account" "tiller" {
metadata {
name = "tiller"
namespace = "${var.tiller_namespace_name}"
}
}
resource "kubernetes_cluster_role_binding" "tiller-cluster-role-binding" {
metadata {
name = "tiller-cluster-admin-binding"
}
role_ref {
api_group = "rbac.authorization.k8s.io"
kind = "ClusterRole"
name = "cluster-admin"
}
subject {
kind = "ServiceAccount"
name = "${kubernetes_service_account.tiller.metadata.0.name}"
namespace = "${var.tiller_namespace_name}"
api_group = ""
}
}