Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue terraform scripts not working on windows #238

Merged
merged 2 commits into from
Sep 12, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion terraform/modules/helm/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,14 @@ resource "kubectl_manifest" "selfsigned_issuer" {
yaml_body = file("${path.module}/clusterissuer-selfsigned.yaml")
}

locals {
jsonpatch = jsonencode([{
jfaltermeier marked this conversation as resolved.
Show resolved Hide resolved
"op" = "add",
"path" = "/spec/template/spec/containers/0/args/-",
"value" = "--default-ssl-certificate=keycloak/${var.hostname}-tls"
}])
}

resource "helm_release" "keycloak" {
depends_on = [helm_release.theia-cloud-base, kubectl_manifest.selfsigned_issuer] # we need an existing issuer
name = "keycloak"
Expand Down Expand Up @@ -207,7 +215,7 @@ resource "helm_release" "keycloak" {
# Below command connects to the cluster in the local environment and patches the ingress-controller accordingly.
# Theia Cloud is then installed with path based hosts reusing the same certificate.
provisioner "local-exec" {
command = "kubectl patch deploy ingress-nginx-controller --type='json' -n ingress-nginx -p '[{ \"op\": \"add\", \"path\": \"/spec/template/spec/containers/0/args/-\", \"value\": \"--default-ssl-certificate=keycloak/${var.hostname}-tls\" }]' && kubectl wait pods -n ingress-nginx -l app.kubernetes.io/component=controller --for condition=Ready --timeout=90s && kubectl wait certificate -n keycloak ${var.hostname}-tls --for condition=Ready --timeout=90s"
command = "kubectl patch deploy ingress-nginx-controller --type=json -n ingress-nginx -p ${local.jsonpatch} && kubectl wait pods -n ingress-nginx -l app.kubernetes.io/component=controller --for condition=Ready --timeout=90s && kubectl wait certificate -n keycloak ${var.hostname}-tls --for condition=Ready --timeout=90s"
jfaltermeier marked this conversation as resolved.
Show resolved Hide resolved
}
}

Expand Down