Skip to content
Merged
Show file tree
Hide file tree
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
Next Next commit
fix cert manager timeout
Signed-off-by: Zach Jacobson <[email protected]>
  • Loading branch information
zjaco13 committed Sep 6, 2024
commit f4bc16a5e6f91a307847e30871ade860bfee20ad
10 changes: 6 additions & 4 deletions terraform/cert-manager.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@ resource "kubectl_manifest" "application_argocd_cert_manager" {
yaml_body = templatefile("${path.module}/templates/argocd-apps/cert-manager.yaml", {
REPO_URL = local.repo_url
})
}

resource "null_resource" "wait_for_cert_manager" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

null_resource is deprecated. let's use what's suggested in the doc here: https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource

provisioner "local-exec" {
command = "kubectl wait --for=jsonpath=.status.health.status=Healthy -n argocd application/cert-manager && kubectl wait --for=jsonpath=.status.sync.status=Synced --timeout=300s -n argocd application/cert-manager && sleep 60"

interpreter = ["/bin/bash", "-c"]
}

depends_on = [kubectl_manifest.application_argocd_cert_manager]
}

resource "kubectl_manifest" "cluster_issuer_prod" {
depends_on = [
kubectl_manifest.application_argocd_cert_manager,
depends_on = [
null_resource.wait_for_cert_manager,
kubectl_manifest.application_argocd_ingress_nginx
]
yaml_body = templatefile("${path.module}/templates/manifests/cluster-issuer.yaml", {
Expand Down
1 change: 1 addition & 0 deletions terraform/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ terraform {
source = "alekc/kubectl"
version = ">= 2.0.0"
}
null = {}
}
}