Skip to content

Commit

Permalink
Merge branch 'eks-cluster-update' into dop-2328
Browse files Browse the repository at this point in the history
  • Loading branch information
ltellesfl authored Nov 27, 2024
2 parents 450ddfd + b08166b commit 38c286f
Show file tree
Hide file tree
Showing 15 changed files with 663 additions and 401 deletions.
3 changes: 1 addition & 2 deletions aws_specific_modules.tf
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,9 @@ resource "aws_eks_addon" "guardduty" {
]
count = var.eks_addon_version_guardduty != null ? 1 : 0


cluster_name = var.label
addon_name = "aws-guardduty-agent"
addon_version = "v1.5.0-eksbuild.1"
addon_version = "v1.7.1-eksbuild.1"
resolve_conflicts = "OVERWRITE"

preserve = true
Expand Down
54 changes: 27 additions & 27 deletions azure/ipa.tf
Original file line number Diff line number Diff line change
Expand Up @@ -470,33 +470,33 @@ resource "kubernetes_config_map" "azure_dns_credentials" {
}


resource "kubectl_manifest" "thanos-storage-secret" {
count = var.thanos_enabled ? 1 : 0
depends_on = [helm_release.ipa-crds, module.secrets-operator-setup]
yaml_body = <<YAML
apiVersion: "secrets.hashicorp.com/v1beta1"
kind: "VaultStaticSecret"
metadata:
name: vault-thanos-storage
namespace: default
spec:
type: "kv-v2"
namespace: default
mount: customer-Indico-Devops
path: thanos-storage
refreshAfter: 60s
rolloutRestartTargets:
- name: prometheus-monitoring-kube-prometheus-prometheus
kind: StatefulSet
destination:
annotations:
reflector.v1.k8s.emberstack.com/reflection-allowed: "true"
reflector.v1.k8s.emberstack.com/reflection-auto-enabled: "true"
create: true
name: thanos-storage
vaultAuthRef: default
YAML
}
# resource "kubectl_manifest" "thanos-storage-secret" {
# count = var.thanos_enabled ? 1 : 0
# depends_on = [helm_release.ipa-crds, module.secrets-operator-setup]
# yaml_body = <<YAML
# apiVersion: "secrets.hashicorp.com/v1beta1"
# kind: "VaultStaticSecret"
# metadata:
# name: vault-thanos-storage
# namespace: default
# spec:
# type: "kv-v2"
# namespace: default
# mount: customer-Indico-Devops
# path: thanos-storage
# refreshAfter: 60s
# rolloutRestartTargets:
# - name: prometheus-monitoring-kube-prometheus-prometheus
# kind: StatefulSet
# destination:
# annotations:
# reflector.v1.k8s.emberstack.com/reflection-allowed: "true"
# reflector.v1.k8s.emberstack.com/reflection-auto-enabled: "true"
# create: true
# name: thanos-storage
# vaultAuthRef: default
# YAML
# }


resource "kubectl_manifest" "custom-cluster-issuer" {
Expand Down
2 changes: 1 addition & 1 deletion azure/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ terraform {
}
kubernetes = {
source = "hashicorp/kubernetes"
version = ">= 2.12.1"
version = ">= 2.33.0"
}
kubectl = {
source = "gavinbunney/kubectl"
Expand Down
136 changes: 71 additions & 65 deletions azure/monitoring.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,25 @@ ingress-nginx:
EOT
) : ""

# thanos_config = var.thanos_enabled == true ? (<<EOT
# thanos: # this is the one being used
# blockSize: 5m
# objectStorageConfig:
# existingSecret:
# name: thanos-storage
# key: thanos_storage.yaml
# EOT
# ) : (<<EOT
# thanos: {}
# EOT
# )
thanos_config = var.thanos_enabled == true ? (<<EOT
thanos: # this is the one being used
blockSize: 5m
objectStorageConfig:
existingSecret:
name: thanos-storage
key: thanos_storage.yaml
thanos: {}
EOT
) : (<<EOT
thanos: {}
EOT
)

# )
alerting_configuration_values = var.alerting_enabled == false ? (<<EOT
noExtraConfigs: true
EOT
Expand Down Expand Up @@ -70,13 +76,13 @@ EOT
reloader.stakater.com/auto: "true"
thanosServiceMonitor:
enabled: ${var.thanos_enabled}
enabled: false #${var.thanos_enabled}
thanosService:
enabled: ${var.thanos_enabled}
enabled: false #${var.thanos_enabled}
prometheusSpec:
disableCompaction: ${var.thanos_enabled}
disableCompaction: false #${var.thanos_enabled}
externalLabels:
clusterAccount: ${var.account}
clusterRegion: ${var.region}
Expand Down Expand Up @@ -129,13 +135,13 @@ ${local.thanos_config}
reloader.stakater.com/auto: "true"
thanosServiceMonitor:
enabled: ${var.thanos_enabled}
enabled: false #${var.thanos_enabled}
thanosService:
enabled: ${var.thanos_enabled}
enabled: false #${var.thanos_enabled}
prometheusSpec:
disableCompaction: ${var.thanos_enabled}
disableCompaction: false #${var.thanos_enabled}
externalLabels:
clusterAccount: ${var.account}
clusterRegion: ${var.region}
Expand Down Expand Up @@ -300,57 +306,57 @@ ${local.private_dns_config}
]
}

resource "kubectl_manifest" "thanos-datasource-credentials" {
count = var.thanos_enabled ? 1 : 0
provider = kubectl.thanos-kubectl
yaml_body = <<YAML
apiVersion: v1
stringData:
admin-password: ${random_password.monitoring-password.result}
kind: Secret
metadata:
name: ${replace(local.dns_name, ".", "-")}
namespace: default
type: Opaque
YAML
}

resource "kubectl_manifest" "thanos-datasource" {
count = var.thanos_enabled ? 1 : 0
depends_on = [kubectl_manifest.thanos-datasource-credentials]
provider = kubectl.thanos-kubectl
yaml_body = <<YAML
apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaDatasource
metadata:
name: ${replace(local.dns_name, ".", "-")}
namespace: default
spec:
valuesFrom:
- targetPath: "secureJsonData.basicAuthPassword"
valueFrom:
secretKeyRef:
name: ${replace(local.dns_name, ".", "-")}
key: admin-password
datasource:
basicAuth: true
basicAuthUser: monitoring
editable: false
access: proxy
editable: true
jsonData:
timeInterval: 5s
tlsSkipVerify: true
name: ${local.dns_name}
secureJsonData:
basicAuthPassword: $${admin-password}
type: prometheus
url: https://prometheus.${local.dns_name}/prometheus
instanceSelector:
matchLabels:
dashboards: external-grafana
YAML
}
# resource "kubectl_manifest" "thanos-datasource-credentials" {
# count = var.thanos_enabled ? 1 : 0
# provider = kubectl.thanos-kubectl
# yaml_body = <<YAML
# apiVersion: v1
# stringData:
# admin-password: ${random_password.monitoring-password.result}
# kind: Secret
# metadata:
# name: ${replace(local.dns_name, ".", "-")}
# namespace: default
# type: Opaque
# YAML
# }

# resource "kubectl_manifest" "thanos-datasource" {
# count = var.thanos_enabled ? 1 : 0
# depends_on = [kubectl_manifest.thanos-datasource-credentials]
# provider = kubectl.thanos-kubectl
# yaml_body = <<YAML
# apiVersion: grafana.integreatly.org/v1beta1
# kind: GrafanaDatasource
# metadata:
# name: ${replace(local.dns_name, ".", "-")}
# namespace: default
# spec:
# valuesFrom:
# - targetPath: "secureJsonData.basicAuthPassword"
# valueFrom:
# secretKeyRef:
# name: ${replace(local.dns_name, ".", "-")}
# key: admin-password
# datasource:
# basicAuth: true
# basicAuthUser: monitoring
# editable: false
# access: proxy
# editable: true
# jsonData:
# timeInterval: 5s
# tlsSkipVerify: true
# name: ${local.dns_name}
# secureJsonData:
# basicAuthPassword: $${admin-password}
# type: prometheus
# url: https://prometheus.${local.dns_name}/prometheus
# instanceSelector:
# matchLabels:
# dashboards: external-grafana
# YAML
# }


resource "helm_release" "keda-monitoring" {
Expand Down
2 changes: 1 addition & 1 deletion azure/user_vars.auto.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ vnet_cidr = "192.168.0.0/20"
subnet_cidrs = ["192.168.0.0/22"]
storage_account_name = ""
private_cluster_enabled = false
k8s_version = "1.29"
k8s_version = "1.31"

default_node_pool = {
name = "defaultpool"
Expand Down
4 changes: 2 additions & 2 deletions azure/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ variable "svp_client_secret" {

variable "k8s_version" {
type = string
default = "1.29"
default = "1.31"
description = "The version of the kubernetes cluster"
}

Expand Down Expand Up @@ -642,7 +642,7 @@ variable "thanos_cluster_name" {

variable "thanos_enabled" {
type = bool
default = false
default = true
}

variable "harness_delegate" {
Expand Down
Loading

0 comments on commit 38c286f

Please sign in to comment.