Skip to content
Permalink
Browse files

Merge pull request #143 from tomochain/feature/tf-monitoring

Add k8s monitoring (netdata) module to terraform
  • Loading branch information...
etienne-napoleone committed May 16, 2019
2 parents 70307b7 + 9258a39 commit 265dfd3ea74f697993123457fc9e52d51124b9b7
Showing with 1,582 additions and 16 deletions.
  1. +26 βˆ’4 terraform/devnet/main.tf
  2. +1 βˆ’3 terraform/devnet/output.tf
  3. +0 βˆ’4 terraform/devnet/variables.tf
  4. +2 βˆ’2 terraform/modules/dns/acme.tf
  5. +0 βˆ’1 terraform/modules/dns/digitalocean.tf
  6. +2 βˆ’2 terraform/{devnet/k8s.tf β†’ modules/providers/digitalocean/kubernetes/cluster.tf}
  7. +17 βˆ’0 terraform/modules/providers/digitalocean/kubernetes/clusterrolebinding.tf
  8. +19 βˆ’0 terraform/modules/providers/digitalocean/kubernetes/outputs.tf
  9. +6 βˆ’0 terraform/modules/providers/digitalocean/kubernetes/serviceaccount.tf
  10. +5 βˆ’0 terraform/modules/providers/digitalocean/kubernetes/variables.tf
  11. +5 βˆ’0 terraform/modules/providers/helm/netdata/charts/netdata/.gitignore
  12. +10 βˆ’0 terraform/modules/providers/helm/netdata/charts/netdata/Chart.yaml
  13. +674 βˆ’0 terraform/modules/providers/helm/netdata/charts/netdata/LICENSE
  14. +157 βˆ’0 terraform/modules/providers/helm/netdata/charts/netdata/README.md
  15. +33 βˆ’0 terraform/modules/providers/helm/netdata/charts/netdata/templates/NOTES.txt
  16. +32 βˆ’0 terraform/modules/providers/helm/netdata/charts/netdata/templates/_helpers.tpl
  17. +26 βˆ’0 terraform/modules/providers/helm/netdata/charts/netdata/templates/clusterrole.yaml
  18. +19 βˆ’0 terraform/modules/providers/helm/netdata/charts/netdata/templates/clusterrolebinding.yaml
  19. +38 βˆ’0 terraform/modules/providers/helm/netdata/charts/netdata/templates/configmap.yaml
  20. +129 βˆ’0 terraform/modules/providers/helm/netdata/charts/netdata/templates/daemonset.yaml
  21. +33 βˆ’0 terraform/modules/providers/helm/netdata/charts/netdata/templates/ingress.yaml
  22. +21 βˆ’0 terraform/modules/providers/helm/netdata/charts/netdata/templates/service.yaml
  23. +11 βˆ’0 terraform/modules/providers/helm/netdata/charts/netdata/templates/serviceaccount.yaml
  24. +144 βˆ’0 terraform/modules/providers/helm/netdata/charts/netdata/templates/statefulset.yaml
  25. +139 βˆ’0 terraform/modules/providers/helm/netdata/charts/netdata/values.yaml
  26. +24 βˆ’0 terraform/modules/providers/helm/netdata/helmrelease.tf
  27. +9 βˆ’0 terraform/modules/providers/helm/netdata/variables.tf
@@ -3,11 +3,33 @@ provider "digitalocean" {
}

provider "kubernetes" {
host = "${digitalocean_kubernetes_cluster.devnet.endpoint}"
host = "${module.kubernetes.endpoint}"

client_certificate = "${base64decode(digitalocean_kubernetes_cluster.devnet.kube_config.0.client_certificate)}"
client_key = "${base64decode(digitalocean_kubernetes_cluster.devnet.kube_config.0.client_key)}"
cluster_ca_certificate = "${base64decode(digitalocean_kubernetes_cluster.devnet.kube_config.0.cluster_ca_certificate)}"
client_certificate = "${module.kubernetes.client_certificate}"
client_key = "${module.kubernetes.client_key}"
cluster_ca_certificate = "${module.kubernetes.cluster_ca_certificate}"
}

provider "helm" {
service_account = "${module.kubernetes.service_account}"

kubernetes {
host = "${module.kubernetes.endpoint}"

client_certificate = "${module.kubernetes.client_certificate}"
client_key = "${module.kubernetes.client_key}"
cluster_ca_certificate = "${module.kubernetes.cluster_ca_certificate}"
}
}

module "kubernetes" {
source = "../modules/providers/digitalocean/kubernetes"

name = "devnet"
}

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

module "tomoscan" {
@@ -1,3 +1 @@
output "tomoscan_ip" {
value = "${module.tomoscan.loadbalancer_ip}"
}

@@ -1,5 +1 @@
variable "do_token" {}

variable "region" {
default = "blr1"
}
@@ -16,11 +16,11 @@ resource "acme_certificate" "certificate" {
common_name = "${var.fqdn}"

dns_challenge {
provider = "cloudflare"
provider = "cloudflare"

config {
CLOUDFLARE_EMAIL = "${var.cloudflare_email}"
CLOUDFLARE_API_KEY = "${var.cloudflare_api_key}"
CLOUDFLARE_API_KEY = "${var.cloudflare_api_key}"
}
}
}
@@ -2,5 +2,4 @@ resource "digitalocean_certificate" "cert" {
name = "${var.name}"
private_key = "${acme_certificate.certificate.private_key_pem}"
leaf_certificate = "${acme_certificate.certificate.certificate_pem}"

}
@@ -1,5 +1,5 @@
resource "digitalocean_kubernetes_cluster" "devnet" {
name = "devnet"
resource "digitalocean_kubernetes_cluster" "cluster" {
name = "${var.name}"
region = "${var.region}"
version = "1.13.3-do.0"

@@ -0,0 +1,17 @@
resource "kubernetes_cluster_role_binding" "admin" {
metadata {
name = "admin"
}

role_ref {
api_group = "rbac.authorization.k8s.io"
kind = "ClusterRole"
name = "cluster-admin"
}

subject {
kind = "ServiceAccount"
name = "admin"
namespace = "kube-system"
}
}
@@ -0,0 +1,19 @@
output "endpoint" {
value = "${digitalocean_kubernetes_cluster.cluster.endpoint}"
}

output "client_certificate" {
value = "${base64decode(digitalocean_kubernetes_cluster.cluster.kube_config.0.client_certificate)}"
}

output "client_key" {
value = "${base64decode(digitalocean_kubernetes_cluster.cluster.kube_config.0.client_key)}"
}

output "cluster_ca_certificate" {
value = "${base64decode(digitalocean_kubernetes_cluster.cluster.kube_config.0.cluster_ca_certificate)}"
}

output "service_account" {
value = "${kubernetes_service_account.admin.metadata.0.name}"
}
@@ -0,0 +1,6 @@
resource "kubernetes_service_account" "admin" {
metadata {
name = "admin"
namespace = "kube-system"
}
}
@@ -0,0 +1,5 @@
variable "name" {}

variable "region" {
default = "blr1"
}
@@ -0,0 +1,5 @@
# IntelliJ project files
.idea
*.iml
out
gen
@@ -0,0 +1,10 @@
name: netdata
home: https://github.com/netdata/netdata
version: 0.0.11
appVersion: v1.14.0
description: Real-time performance monitoring, done right! https://my-netdata.io/
maintainer:
name: Chris Akritidis
email: chris@netdata.cloud
name: Vladimir Ryumin
email: vryumin@gmail.com
Oops, something went wrong.

0 comments on commit 265dfd3

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