This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rbac: | |
create: true | |
pspEnabled: true | |
pspUseAppArmor: true | |
namespaced: true | |
extraRoleRules: [] | |
# - apiGroups: [] | |
# resources: [] | |
# verbs: [] | |
extraClusterRoleRules: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
provider "helm" { | |
kubernetes { | |
config_path = pathexpand(var.kube_config) | |
} | |
} | |
provider "kubernetes" { | |
config_path = pathexpand(var.kube_config) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable "kube_config" { | |
type = string | |
default = "~/.kube/config" | |
} | |
variable "namespace" { | |
type = string | |
default = "staging" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "kubernetes_namespace" "this" { | |
metadata { | |
name = var.namespace | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "helm_release" "prometheus" { | |
chart = "prometheus" | |
name = "prometheus" | |
namespace = var.namespace | |
repository = "https://prometheus-community.github.io/helm-charts" | |
# When you want to directly specify the value of an element in a map you need \\ to escape the point. | |
set { | |
name = "podSecurityPolicy\\.enabled" | |
value = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data "template_file" "grafana_values" { | |
template = file("./templates/grafana-values.yml") | |
vars = { | |
GRAFANA_SERVICE_ACCOUNT = "grafana" | |
GRAFANA_ADMIN_USER = "admin" | |
GRAFANA_ADMIN_PASSWORD = var.grafana_password | |
PROMETHEUS_SVC = "${helm_release.prometheus.name}-server" | |
NAMESPACE = var.namespace | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rbac: | |
create: true | |
pspEnabled: true | |
pspUseAppArmor: true | |
namespaced: true | |
extraRoleRules: [] | |
# - apiGroups: [] | |
# resources: [] | |
# verbs: [] | |
extraClusterRoleRules: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rbac: | |
create: true | |
pspEnabled: true | |
pspUseAppArmor: true | |
namespaced: true | |
extraRoleRules: [] | |
# - apiGroups: [] | |
# resources: [] | |
# verbs: [] | |
extraClusterRoleRules: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# coding: utf-8 | |
import sys | |
import json | |
import requests | |
def fetch(): | |
# The program needs to read the passed data in query from stdin | |
input_json = sys.stdin.read() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable "todo_id" { | |
type = number | |
} | |
data "external" "todo" { | |
program = ["python", "${path.module}/fetch_todo.py"] | |
query = { | |
id = var.todo_id | |
} |
OlderNewer