From 520f146b21f2f55e991a4b1e87adf08db36aaf81 Mon Sep 17 00:00:00 2001 From: mcgin314 Date: Wed, 12 Mar 2025 10:49:21 -0400 Subject: [PATCH] Code cleanup --- copy_images.tf | 8 +-- main.tf | 159 +------------------------------------------------ outputs.tf | 6 +- variables.tf | 32 ---------- 4 files changed, 7 insertions(+), 198 deletions(-) diff --git a/copy_images.tf b/copy_images.tf index 72f2a49..32b3c5f 100644 --- a/copy_images.tf +++ b/copy_images.tf @@ -10,8 +10,8 @@ locals { name = "istio-tools/kiali-operator" source_image = "kiali/kiali-operator" source_registry = "quay.io" - source_tag = local.kiali_operator_version - tag = local.kiali_operator_version + source_tag = var.kiali_operator_version + tag = var.kiali_operator_version }, { enabled = true @@ -19,8 +19,8 @@ locals { name = "istio-tools/kiali" source_image = "kiali/kiali" source_registry = "quay.io" - source_tag = local.kiali_operator_version - tag = local.kiali_operator_version + source_tag = var.kiali_operator_version + tag = var.kiali_operator_version }, ] } diff --git a/main.tf b/main.tf index c4325d1..473812f 100644 --- a/main.tf +++ b/main.tf @@ -87,7 +87,7 @@ resource "helm_release" "kiali_operator" { resource "helm_release" "kiali" { depends_on = [ - helm_release.kiali-operator, + helm_release.kiali_operator, module.preinstall, ] @@ -134,8 +134,7 @@ resource "helm_release" "kiali" { module "ingress_resources" { # tflint-ignore: terraform_module_version # tflint-ignore: terraform_module_pinned_source - # source = "git@github.e.it.census.gov:SCT-Engineering/tfmod-istio-service-ingress.git?ref=main" - source = "/apps/terraform/workspaces/mcgin314/tfmod-istio-service-ingress" + source = "git@github.e.it.census.gov:SCT-Engineering/tfmod-istio-service-ingress.git?ref=main" public_hostname = "kiali" public_domain = format("%v.%v", var.cluster_name, var.cluster_domain) @@ -143,157 +142,3 @@ module "ingress_resources" { service_namespace = var.namespace service_port = local.internal_port_number } - -# grafana: -# enabled: true -# auth: -# type: basic -# username: "admin" -# password: "Q8rktnHqzYFEf591U35Uf66T1xFJ4HZZFqiOn4fh" - -# tracing: -# enabled: true -# internalUrl: "http://tempo.tempo.svc.cluster.local:3100" -# use_grpc: false -# provider: "tempo" -# tempo_config: -# org_id: "1" -# datasource_uid: "fedkp0zap3uv4d" -# url_format: "grafana" - - -# resource "helm_release" "kiali" { -# depends_on = [ -# helm_release.kiali-operator, -# # module.preinstall, -# ] - -# chart = "kiali" -# name = "kiali" -# namespace = local.ns -# repository = "./charts" -# # repository = "${path.module}/charts" - -# set { -# name = "image_name" -# value = format("%v/%v", -# module.images.images[local.kiali_key].dest_registry, -# module.images.images[local.kiali_key].dest_repository -# ) -# } -# set { -# name = "image_version" -# value = module.images.images[local.kiali_key].tag -# } - -# set { -# name = "kialiAuthStrategy" -# value = "anonymous" -# } - -# set { -# name = "publicHostname" -# value = var.public_hostname -# } -# set { -# name = "publicDomain" -# value = var.cluster_domain -# } - -# set { -# name = "istioNamespace" -# value = var.istio_namespace -# } -# set { -# name = "prometheusInClusterUrl" -# value = var.prometheus_internal_url -# } -# set { -# name = "jaegerInClusterUrl" -# value = var.jaeger_internal_url -# } -# set { -# name = "grafanaInClusterUrl" -# value = var.grafana_internal_url -# } -# set { -# name = "grafanaPublicUrl" -# value = var.grafana_public_url -# } -# set { -# name = "grafanaUserName" -# value = "YWRtaW4=" -# # value = "admin" -# } -# set { -# name = "grafanaSecretName" -# value = "kiali" -# } -# set { -# name = "grafanaPasswordKey" -# value = "grafana_password" -# } -# } - - - - # dynamic "set" { - # for_each = local.have_keycloak ? ["openid"] : ["anonymous"] - # content { - # name = "kialiAuthStrategy" - # value = set.value - # } - # } - # dynamic "set" { - # for_each = local.have_keycloak ? [var.sso_client_id] : [] - # content { - # name = "openid.clientId" - # value = set.value - # } - # } - # dynamic "set" { - # for_each = local.have_keycloak ? [var.sso_client_secret] : [] - # content { - # name = "openid.secret" - # value = set.value - # } - # } - # dynamic "set" { - # for_each = local.have_keycloak ? [local.keycloak_issuer_uri] : [] - # content { - # name = "openid.issuerUri" - # value = set.value - # } - # } - # dynamic "set" { - # for_each = local.have_keycloak ? ["username_claim"] : [] - # content { - # name = "openid.username_claim" - # value = set.value - # } - # } - - -# module "kiali_ingress" { -# depends_on = [helm_release.kiali] - -# #source = "git@github.it.census.gov:SOA/tfmod-gogatekeeper.git//>ref=1.0.0" -# source = "git@github.it.census.gov:SOA/tfmod-gogatekeeper.git//" - -# certificate_issuer = var.certificate_issuer - -# namespace = local.ns -# application_name = "kiali" -# public_hostname = "kiali" -# cluster_domain = var.cluster_domain -# upstream_hostname = local.internal_hostname -# upstream_port = local.internal_port_number -# redirection_url = local.public_url -# client_id = var.sso_client_id -# client_secret = var.sso_client_secret -# keycloak_public_url = var.keycloak_public_url -# gogatekeeper_chart_version = var.gogatekeeper_chart_version -# gogatekeeper_registry = var.gogatekeeper_registry -# gogatekeeper_repository = var.gogatekeeper_repository -# gogatekeeper_tag = var.gogatekeeper_tag -# } diff --git a/outputs.tf b/outputs.tf index 8664c39..d3b64bb 100644 --- a/outputs.tf +++ b/outputs.tf @@ -1,11 +1,7 @@ output "public_endpoint" { description = "The public endpoint to use to access kiali" - value = { - hostname = local.public_hostname - port_number = local.public_port_number - url = local.public_url - } + value = module.ingress_resources.service_url } output "internal_endpoint" { diff --git a/variables.tf b/variables.tf index 3986584..e019c65 100644 --- a/variables.tf +++ b/variables.tf @@ -26,12 +26,6 @@ variable "istio_namespace" { default = "istio-system" } -variable "keycloak_namespace" { - description = "The namespace holding the keycloak instance." - type = string - default = "" -} - variable "grafana_namespace" { description = "The namespace holding the grafana instance, used to look up the grafana password." type = string @@ -67,38 +61,12 @@ variable "tempo_datasource_id" { type = string } -variable "sso_client_id" { - description = "The client id to use for SSO" - type = string - default = "" -} - -variable "sso_client_secret" { - description = "The secret associated with the sso_client_id" - type = string - default = "" -} - -variable "keycloak_public_url" { - description = "The hostname used with the cluster domain to access keycloak" - type = string - default = "" -} - -variable "keycloak_realm" { - description = "The existing keycloak realm in which the client should be created" - type = string - default = "" -} - variable "public_hostname" { description = "The hostname to use for kiali that will be publicly available" type = string default = "kiali" } - - # helm repo add kiali https://kiali.org/helm-charts # helm search repo kiali/kiali-operator variable "kiali_operator_version" {