Skip to content
Permalink
Browse files

feat: add new module to handle kubernetes + helm

  • Loading branch information...
etienne-napoleone committed May 13, 2019
1 parent 4687675 commit c0ffedd2384fe388a22232005f75ca8584fe9693
@@ -10,10 +10,6 @@ provider "kubernetes" {
cluster_ca_certificate = "${base64decode(digitalocean_kubernetes_cluster.devnet.kube_config.0.cluster_ca_certificate)}"
}

module "netdata" {
source = "../modules/netdata"
}

# module "tomomaster" {
# source = "../modules/tomomaster"
# }
@@ -6,6 +6,6 @@ output "tomoscan_ip" {
# value = "${module.tomomaster.loadbalancer_ip}"
# }

output "netdata_ip" {
value = "${module.netdata.loadbalancer_ip}"
}
# output "netdata_ip" {
# value = "${module.netdata.loadbalancer_ip}"
# }
@@ -0,0 +1,11 @@
resource "digitalocean_kubernetes_cluster" "cluster" {
name = "${var.name}"
region = "${var.region}"
version = "1.13.3-do.0"

node_pool {
name = "workers"
size = "s-6vcpu-16gb"
node_count = 3
}
}
@@ -0,0 +1,15 @@
resource "kubernetes_cluster_role_binding" "helm" {
metadata {
name = "helm"
}
role_ref {
api_group = "rbac.authorization.k8s.io"
kind = "ClusterRole"
name = "cluster-admin"
}
subject {
kind = "ServiceAccount"
name = "helm"
namespace = "kube-system"
}
}
@@ -0,0 +1,7 @@
provider "kubernetes" {
host = "${digitalocean_kubernetes_cluster.cluster.endpoint}"

client_certificate = "${base64decode(digitalocean_kubernetes_cluster.cluster.kube_config.0.client_certificate)}"
client_key = "${base64decode(digitalocean_kubernetes_cluster.cluster.kube_config.0.client_key)}"
cluster_ca_certificate = "${base64decode(digitalocean_kubernetes_cluster.cluster.kube_config.0.cluster_ca_certificate)}"
}
@@ -0,0 +1,6 @@
resource "kubernetes_service_account" "helm" {
metadata {
name = "helm"
namespace = "kube-system"
}
}
@@ -0,0 +1,5 @@
variable "name" {}

variable "region" {
default = "blr1"
}

0 comments on commit c0ffedd

Please sign in to comment.
You can’t perform that action at this time.