Skip to content

Commit

Permalink
update adding variables and using kubectl provider
Browse files Browse the repository at this point in the history
  • Loading branch information
jdongo-aneo committed Nov 5, 2024
1 parent 83cbf39 commit c405527
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 9 deletions.
1 change: 1 addition & 0 deletions infrastructure/quick-deploy/aws/ecr.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ locals {
var.grafana == null ? null : [var.grafana.image_name, var.grafana.image_tag],
var.node_exporter == null ? null : [var.node_exporter.image_name, var.node_exporter.image_tag],
var.windows_exporter == null ? null : [var.windows_exporter.image_name, var.windows_exporter.image_tag],
var.windows_exporter == null ? null : [var.windows_exporter.init_image_name, var.windows_exporter.init_image_tag],
var.partition_metrics_exporter == null ? null : [var.partition_metrics_exporter.image_name, var.partition_metrics_exporter.image_tag],
var.ingress == null ? null : [var.ingress.image, var.ingress.tag],
var.authentication == null ? null : [var.authentication.image, var.authentication.tag],
Expand Down
6 changes: 5 additions & 1 deletion infrastructure/quick-deploy/aws/monitoring.tf
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,11 @@ module "windows_exporter" {
tag = local.ecr_images["${var.windows_exporter.image_name}:${try(coalesce(var.windows_exporter.image_tag), "")}"].tag
image_pull_secrets = var.windows_exporter.pull_secrets
}
kubeconfig_file = module.eks.kubeconfig_file
init_docker_image = {
image = local.ecr_images["${var.windows_exporter.init_image_name}:${try(coalesce(var.windows_exporter.init_image_tag), "")}"].image
tag = local.ecr_images["${var.windows_exporter.init_image_name}:${try(coalesce(var.windows_exporter.init_image_tag), "")}"].tag
image_pull_secrets = var.windows_exporter.init_pull_secrets
}
}

# Metrics exporter
Expand Down
3 changes: 1 addition & 2 deletions infrastructure/quick-deploy/aws/parameters.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -361,9 +361,8 @@ node_exporter = {

windows_exporter = {
node_selector = {
"service" = "windows"
"plateform" = "windows"
}
# image_tag = "0.29.2-ltsc2022"
}

prometheus = {
Expand Down
12 changes: 12 additions & 0 deletions infrastructure/quick-deploy/aws/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@ provider "aws" {
profile = var.profile
}

provider "kubectl" {
host = module.eks.cluster_endpoint
cluster_ca_certificate = base64decode(module.eks.cluster_certificate_authority_data)

exec {
api_version = "client.authentication.k8s.io/v1beta1"
command = "aws"
# This requires the awscli to be installed locally where Terraform is executed
args = ["eks", "get-token", "--cluster-name", module.eks.cluster_name, "--profile", var.profile]
}
}

provider "kubernetes" {
host = module.eks.cluster_endpoint
cluster_ca_certificate = base64decode(module.eks.cluster_certificate_authority_data)
Expand Down
11 changes: 7 additions & 4 deletions infrastructure/quick-deploy/aws/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -826,10 +826,13 @@ variable "static" {
variable "windows_exporter" {
description = "Windows exporter configuration"
type = object({
image_name = optional(string, "ghcr.io/prometheus-community/windows-exporter")
image_tag = optional(string)
pull_secrets = optional(string, "")
node_selector = optional(any, {})
image_name = optional(string, "ghcr.io/prometheus-community/windows-exporter")
image_tag = optional(string)
pull_secrets = optional(string, "")
init_image_name = optional(string, "mcr.microsoft.com/windows/nanoserver")
init_image_tag = optional(string)
init_pull_secrets = optional(string, "")
node_selector = optional(any, {})
})
default = null
}
5 changes: 3 additions & 2 deletions versions.tfvars.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"armonik_versions": {
"armonik": "2.20.0",
"infra": "0.5.0-pre-8-f5b8bd3",
"infra": "0.5.1-pre-1-84546ad",
"infra_plugins": "0.1.1",
"core": "0.24.3",
"api": "3.19.0",
Expand Down Expand Up @@ -74,7 +74,8 @@
"ghcr.io/chaos-mesh/chaos-mesh": "v2.6.3",
"ghcr.io/chaos-mesh/chaos-daemon": "v2.6.3",
"ghcr.io/chaos-mesh/chaos-dashboard": "v2.6.3",
"ghcr.io/prometheus-community/windows-exporter": "0.29.2-ltsc2022"
"ghcr.io/prometheus-community/windows-exporter": "0.29.2-ltsc2022",
"mcr.microsoft.com/windows/nanoserver": "ltsc2022"
},
"helm_charts" : {
"keda" : { "repository" : "https://kedacore.github.io/charts" , "version" : "2.9.3"},
Expand Down

0 comments on commit c405527

Please sign in to comment.