Skip to content

Commit

Permalink
WIP-20240824173034
Browse files Browse the repository at this point in the history
  • Loading branch information
andreyev committed Aug 24, 2024
1 parent 11c85cb commit d12fc61
Showing 1 changed file with 37 additions and 1 deletion.
38 changes: 37 additions & 1 deletion monitoring/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,46 @@ terraform {
name = "k8s1-cicd"
}
}

required_providers {
kubernetes = {
source = "hashicorp/kubernetes"
version = "~> 2.22.0"
}
helm = {
source = "hashicorp/helm"
version = "~> 2.9.0"
}
}
}

provider "kubernetes" {
config_path = "/tmp/kubeconfig"
}

provider "helm" {
kubernetes {
config_path = "~/.kube/config"
config_path = "/tmp/kubeconfig"
}
}

resource "local_file" "kubeconfig" {
content = var.kubeconfig
filename = "/tmp/kubeconfig"
}

variable "kubeconfig" {
description = "The contents of the kubeconfig file"
type = string
}

resource "null_resource" "cleanup" {
provisioner "local-exec" {
command = "rm -f /tmp/kubeconfig"
}

triggers = {
always_run = "${timestamp()}"
}
}

Expand All @@ -20,6 +55,7 @@ resource "helm_release" "prometheus_operator" {
force_update = true
chart = "kube-prometheus-stack"
version = "47.0.0"
depends_on = [null_resource.cleanup]

set {
name = "prometheus.prometheusSpec.serviceMonitorSelectorNilUsesHelmValues"
Expand Down

0 comments on commit d12fc61

Please # to comment.