diff --git a/dashboard.tf b/dashboard.tf new file mode 100644 index 0000000..25f7d18 --- /dev/null +++ b/dashboard.tf @@ -0,0 +1,32 @@ +resource "kubernetes_service_account" "dashboard" { + metadata { + name = "dashboard-admin" + namespace = "kube-system" + + labels = { + app = "dashboard" + } + } +} + +resource "kubernetes_cluster_role_binding" "dashboard" { + metadata { + name = "dashboard-admin" + + labels = { + app = "dashboard" + } + } + + role_ref { + api_group = "rbac.authorization.k8s.io" + kind = "ClusterRole" + name = "cluster-admin" + } + + subject { + kind = "ServiceAccount" + name = "dashboard-admin" + namespace = "kube-system" + } +} diff --git a/main.tf b/main.tf index 07577d9..7f8553d 100755 --- a/main.tf +++ b/main.tf @@ -3,6 +3,29 @@ resource hcloud_server control { name = "control${count.index}" image = "ubuntu-18.04" server_type = "cx21" + + ssh_keys = ["${hcloud_ssh_key.terraform.id}"] + + connection { + private_key = "${file("./keys/id_terraform")}" + } + + user_data = <