Skip to content

Commit

Permalink
Split endpoint information into parts.
Browse files Browse the repository at this point in the history
  • Loading branch information
zawac002 committed Sep 15, 2023
1 parent 228c79d commit eeaa067
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 13 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# tfmod-keycloak
2 changes: 1 addition & 1 deletion copy_images.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
locals {
keycloak_key = format("%v#%v", "keycloak", var.keycloak_tag)
keycloak_key = format("%v#%v", "keycloak", var.keycloak_tag)
gogatekeeper_key = format("%v#%v", "gogatekeeper", var.gogatekeeper_tag)

image_config = [
Expand Down
6 changes: 5 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
locals {
public_hostname = format("%v.%v", var.keycloak_hostname, var.cluster_domain)
public_port_number = "80"
public_url = format("https://%v:%v/", local.public_hostname, local.public_port_number)

secrets_job_script = <<SECRETS
ensure_secret keycloak-db-creds database-password "${var.external_database_password}"
ensure_secret keycloak-admin-creds keycloak-password $(mkpasswd 32 false)
Expand Down Expand Up @@ -56,7 +60,7 @@ module "service-ingress" {
publicDomain = var.cluster_domain
certificateIssuer = var.certificate_issuer
istioNamespace = var.istio_namespace
serviceName = "keycloak-http"
serviceHostname = "keycloak-http"
serviceNamespace = helm_release.keycloak.namespace
servicePortNumber = "80"
}
20 changes: 12 additions & 8 deletions outputs.tf
Original file line number Diff line number Diff line change
@@ -1,30 +1,34 @@
output "public_url" {
description = "The URL to use to retrieve the OpenID configuration"
value = format("https://%v.%v/", var.keycloak_hostname, var.cluster_domain)
output "public_endpoint" {
description = "The endpoint to use to access keycloak"
value = {
hostname = local.public_hostname
port_number = local.public_port_number
url = local.public_url
}
}

output "gogatekeeper_chart_version" {
description = "The version of the gogatekeeper chart prepared"
value = var.gogatekeeper_version
value = var.gogatekeeper_version
}

output "gogatekeeper_registry" {
description = "Installed gogatekeeper in this registry"
value = module.images.images[local.gogatekeeper_key].dest_registry
value = module.images.images[local.gogatekeeper_key].dest_registry
}

output "gogatekeeper_repository" {
description = "Installed gogatekeeper in this repository"
value = module.images.images[local.gogatekeeper_key].dest_repository
value = module.images.images[local.gogatekeeper_key].dest_repository
}

output "gogatekeeper_full_path" {
description = "Installed gogatekeeper with this full path"
value = module.images.images[local.gogatekeeper_key].dest_full_path
value = module.images.images[local.gogatekeeper_key].dest_full_path
}

output "gogatekeeper_tag" {
description = "Installed gogatekeeper with this tag"
value = module.images.images[local.gogatekeeper_key].tag
value = module.images.images[local.gogatekeeper_key].tag
}

6 changes: 3 additions & 3 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ variable "keycloak_tag" {
# helm repo add gogatekeeper https://gogatekeeper.github.io/helm-gogatekeeper
# helm search repo gogatekeeper/gatekeeper
variable "gogatekeeper_version" {
description = "The version of the gogatekeeper helm chart that is the basis for gogatekeeper deployments."
default = "0.1.37"
description = "The version of the gogatekeeper helm chart that is the basis for gogatekeeper deployments."
default = "0.1.37"
}

variable "gogatekeeper_tag" {
description = "The tag associated with the gogatekeeper_version"
default = "2.6.2"
default = "2.6.2"
}

# Keycloak will be accessible at <keycloak_hostname>.<cluster_domain>
Expand Down

0 comments on commit eeaa067

Please sign in to comment.