Skip to content

Commit

Permalink
Merge pull request #44 from maddevsio/count_of_helm_releases
Browse files Browse the repository at this point in the history
Set helm releases history size.
  • Loading branch information
mglotov authored Apr 28, 2021
2 parents 0776763 + caaf034 commit dbb3e95
Show file tree
Hide file tree
Showing 27 changed files with 199 additions and 168 deletions.
13 changes: 7 additions & 6 deletions terraform/layer2-k8s/eks-aws-node-termination-handler.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
resource "helm_release" "aws_node_termination_handler" {
name = "aws-node-termination-handler"
chart = "aws-node-termination-handler"
version = var.aws_node_termination_handler_version
repository = local.helm_repo_eks
namespace = kubernetes_namespace.sys.id
wait = false
name = "aws-node-termination-handler"
chart = "aws-node-termination-handler"
version = var.aws_node_termination_handler_version
repository = local.helm_repo_eks
namespace = kubernetes_namespace.sys.id
wait = false
max_history = var.helm_release_history_size

values = [
file("${path.module}/templates/aws-node-termination-handler-values.yaml")
Expand Down
13 changes: 7 additions & 6 deletions terraform/layer2-k8s/eks-cert-manager.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ data "template_file" "cert_manager" {
}

resource "helm_release" "cert_manager" {
name = "cert-manager"
chart = "cert-manager"
repository = local.helm_repo_certmanager
namespace = kubernetes_namespace.certmanager.id
version = var.cert_manager_version
wait = true
name = "cert-manager"
chart = "cert-manager"
repository = local.helm_repo_certmanager
namespace = kubernetes_namespace.certmanager.id
version = var.cert_manager_version
wait = true
max_history = var.helm_release_history_size

values = [
data.template_file.cert_manager.rendered,
Expand Down
9 changes: 5 additions & 4 deletions terraform/layer2-k8s/eks-certificate.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ data "template_file" "certificate" {
}

resource "helm_release" "certificate" {
name = "certificate"
chart = "../../helm-charts/certificate"
namespace = module.ing_namespace.name
wait = false
name = "certificate"
chart = "../../helm-charts/certificate"
namespace = module.ing_namespace.name
wait = false
max_history = var.helm_release_history_size

values = [
data.template_file.certificate.rendered,
Expand Down
11 changes: 6 additions & 5 deletions terraform/layer2-k8s/eks-cluster-autoscaler.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ data "template_file" "cluster_autoscaler" {
}

resource "helm_release" "cluster_autoscaler" {
name = "cluster-autoscaler"
chart = "cluster-autoscaler"
repository = local.helm_repo_cluster_autoscaler
version = var.cluster_autoscaler_chart_version
namespace = kubernetes_namespace.sys.id
name = "cluster-autoscaler"
chart = "cluster-autoscaler"
repository = local.helm_repo_cluster_autoscaler
version = var.cluster_autoscaler_chart_version
namespace = kubernetes_namespace.sys.id
max_history = var.helm_release_history_size

values = [
data.template_file.cluster_autoscaler.rendered,
Expand Down
9 changes: 5 additions & 4 deletions terraform/layer2-k8s/eks-cluster-issuer.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ data "template_file" "cluster_issuer" {
}

resource "helm_release" "cluster_issuer" {
name = "cluster-issuer"
chart = "../../helm-charts/cluster-issuer"
namespace = kubernetes_namespace.certmanager.id
wait = false
name = "cluster-issuer"
chart = "../../helm-charts/cluster-issuer"
namespace = kubernetes_namespace.certmanager.id
wait = false
max_history = var.helm_release_history_size

values = [
data.template_file.cluster_issuer.rendered,
Expand Down
11 changes: 6 additions & 5 deletions terraform/layer2-k8s/eks-external-dns.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ data "template_file" "external_dns" {


resource "helm_release" "external_dns" {
name = "external-dns"
chart = "external-dns"
repository = local.helm_repo_bitnami
version = var.external_dns_version
namespace = kubernetes_namespace.dns.id
name = "external-dns"
chart = "external-dns"
repository = local.helm_repo_bitnami
version = var.external_dns_version
namespace = kubernetes_namespace.dns.id
max_history = var.helm_release_history_size

values = [
data.template_file.external_dns.rendered,
Expand Down
24 changes: 13 additions & 11 deletions terraform/layer2-k8s/eks-external-secrets.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,26 @@ data "template_file" "external_secrets" {
}

resource "helm_release" "external_secrets" {
name = "external-secrets"
chart = "kubernetes-external-secrets"
repository = local.helm_repo_external_secrets
version = var.external_secrets_version
namespace = kubernetes_namespace.sys.id
name = "external-secrets"
chart = "kubernetes-external-secrets"
repository = local.helm_repo_external_secrets
version = var.external_secrets_version
namespace = kubernetes_namespace.sys.id
max_history = var.helm_release_history_size

values = [
data.template_file.external_secrets.rendered,
]
}

resource "helm_release" "reloader" {
name = "reloader"
chart = "reloader"
repository = local.helm_repo_stakater
version = var.reloader_version
namespace = kubernetes_namespace.sys.id
wait = false
name = "reloader"
chart = "reloader"
repository = local.helm_repo_stakater
version = var.reloader_version
namespace = kubernetes_namespace.sys.id
wait = false
max_history = var.helm_release_history_size
}

#module "aws_iam_wp_external_secrets" {
Expand Down
18 changes: 7 additions & 11 deletions terraform/layer2-k8s/eks-kube-prometheus-stack.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,13 @@ module "aws_iam_grafana" {
}

resource "helm_release" "prometheus_operator" {
name = "kube-prometheus-stack"
chart = "kube-prometheus-stack"
repository = local.helm_repo_prometheus_community
namespace = kubernetes_namespace.monitoring.id
version = var.prometheus_operator_version
wait = false

set {
name = "rbac.create"
value = "true"
}
name = "kube-prometheus-stack"
chart = "kube-prometheus-stack"
repository = local.helm_repo_prometheus_community
namespace = kubernetes_namespace.monitoring.id
version = var.prometheus_operator_version
wait = false
max_history = var.helm_release_history_size

values = [
local.kube_prometheus_stack_template
Expand Down
13 changes: 7 additions & 6 deletions terraform/layer2-k8s/eks-loki-stack.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ locals {
}

resource "helm_release" "loki_stack" {
name = "loki-stack"
chart = "loki-stack"
repository = local.helm_repo_grafana
namespace = kubernetes_namespace.monitoring.id
version = var.loki_stack
wait = false
name = "loki-stack"
chart = "loki-stack"
repository = local.helm_repo_grafana
namespace = kubernetes_namespace.monitoring.id
version = var.loki_stack
wait = false
max_history = var.helm_release_history_size

values = [
local.loki_stack_template
Expand Down
13 changes: 7 additions & 6 deletions terraform/layer2-k8s/eks-network-policy.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ data "template_file" "calico_daemonset" {
}

resource "helm_release" "calico_daemonset" {
name = "aws-calico"
chart = "aws-calico"
repository = local.helm_repo_eks
version = var.calico_daemonset
namespace = "kube-system"
wait = false
name = "aws-calico"
chart = "aws-calico"
repository = local.helm_repo_eks
version = var.calico_daemonset
namespace = "kube-system"
max_history = var.helm_release_history_size
wait = false

values = [
data.template_file.calico_daemonset.rendered,
Expand Down
13 changes: 7 additions & 6 deletions terraform/layer2-k8s/eks-nginx-ingress-controller.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ data "template_file" "nginx_ingress" {
}

resource "helm_release" "nginx_ingress" {
name = "ingress-nginx"
chart = "ingress-nginx"
repository = local.helm_repo_ingress_nginx
namespace = module.ing_namespace.name
version = var.nginx_ingress_controller_version
wait = false
name = "ingress-nginx"
chart = "ingress-nginx"
repository = local.helm_repo_ingress_nginx
namespace = module.ing_namespace.name
version = var.nginx_ingress_controller_version
wait = false
max_history = var.helm_release_history_size

values = [
data.template_file.nginx_ingress.rendered,
Expand Down
13 changes: 7 additions & 6 deletions terraform/layer2-k8s/examples/eks-alb-ingress-controller.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@ data "template_file" "alb_ingress_controller" {
}

resource "helm_release" "alb_ingress_controller" {
name = "aws-alb-ingress-controller"
chart = "aws-alb-ingress-controller"
repository = local.helm_repo_incubator
version = var.alb_ingress_chart_version
namespace = kubernetes_namespace.ing.id
name = "aws-alb-ingress-controller"
chart = "aws-alb-ingress-controller"
repository = local.helm_repo_incubator
version = var.alb_ingress_chart_version
namespace = kubernetes_namespace.ing.id
max_history = var.helm_release_history_size

values = [
"${data.template_file.alb_ingress_controller.rendered}",
data.template_file.alb_ingress_controller.rendered
]
}
15 changes: 8 additions & 7 deletions terraform/layer2-k8s/examples/eks-apm-server.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ data "template_file" "apm-server" {
}

resource "helm_release" "apm-server" {
name = "apm-server"
chart = "apm-server"
repository = local.helm_repo_elastic
version = var.elk_version
namespace = kubernetes_namespace.elk.id
wait = false
name = "apm-server"
chart = "apm-server"
repository = local.helm_repo_elastic
version = var.elk_version
namespace = kubernetes_namespace.elk.id
wait = false
max_history = var.helm_release_history_size

values = [
"${data.template_file.apm.rendered}",
data.template_file.apm.rendered,
]

# This dep needs for correct apply
Expand Down
15 changes: 8 additions & 7 deletions terraform/layer2-k8s/examples/eks-elasticsearch.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@ data "template_file" "elasticsearch" {
}

resource "helm_release" "elasticsearch" {
name = "elasticsearch"
chart = "elasticsearch"
repository = local.helm_repo_elastic
version = var.elk_version
namespace = kubernetes_namespace.elk.id
wait = false
name = "elasticsearch"
chart = "elasticsearch"
repository = local.helm_repo_elastic
version = var.elk_version
namespace = kubernetes_namespace.elk.id
wait = false
max_history = var.helm_release_history_size

values = [
"${data.template_file.elasticsearch.rendered}",
data.template_file.elasticsearch.rendered
]

# This dep needs for correct apply
Expand Down
11 changes: 6 additions & 5 deletions terraform/layer2-k8s/examples/eks-elk.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ data "template_file" "elk" {
}

resource "helm_release" "elk" {
name = "elk"
chart = "../../helm-charts/elk"
namespace = kubernetes_namespace.elk.id
wait = false
name = "elk"
chart = "../../helm-charts/elk"
namespace = kubernetes_namespace.elk.id
wait = false
max_history = var.helm_release_history_size

values = [
"${data.template_file.elk.rendered}",
data.template_file.elk.rendered
]
}

Expand Down
15 changes: 8 additions & 7 deletions terraform/layer2-k8s/examples/eks-filebeat.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@ data "template_file" "filebeat" {
}

resource "helm_release" "filebeat" {
name = "filebeat"
chart = "filebeat"
repository = local.helm_repo_elastic
version = var.elk_version
namespace = kubernetes_namespace.elk.id
wait = false
name = "filebeat"
chart = "filebeat"
repository = local.helm_repo_elastic
version = var.elk_version
namespace = kubernetes_namespace.elk.id
wait = false
max_history = var.helm_release_history_size

values = [
"${data.template_file.filebeat.rendered}",
data.template_file.filebeat.rendered
]

# This dep needs for correct apply
Expand Down
13 changes: 7 additions & 6 deletions terraform/layer2-k8s/examples/eks-gitlab-runner.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@ module "eks_rbac_gitlab_runner" {
}

resource "helm_release" "gitlab_runner" {
name = "gitlab-runner"
chart = "gitlab-runner"
repository = local.helm_repo_gitlab
version = var.gitlab_runner_version
namespace = kubernetes_namespace.ci.id
wait = false
name = "gitlab-runner"
chart = "gitlab-runner"
repository = local.helm_repo_gitlab
version = var.gitlab_runner_version
namespace = kubernetes_namespace.ci.id
wait = false
max_history = var.helm_release_history_size

values = [
local.gitlab_runner_template
Expand Down
Loading

0 comments on commit dbb3e95

Please sign in to comment.