Created
May 11, 2022 17:30
-
-
Save sergsoares/a73d088bafa52b987ce3eb9cf6d7fb7d to your computer and use it in GitHub Desktop.
Example of kubernetes_ingress with Kubernetes provider for terraform
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "kubernetes_ingress" "node0_ingress" { | |
metadata { | |
name = local.node0 | |
namespace = local.namespace | |
annotations = { | |
"kubernetes.io/ingress.class" = "nginx" | |
"nginx.ingress.kubernetes.io/backend-protocol" = "HTTP" | |
"nginx.ingress.kubernetes.io/enable-cors" = "true" | |
} | |
} | |
spec { | |
rule { | |
host = "${local.node0}-my-custom-domain" | |
http { | |
path { | |
backend { | |
service_name = local.node0 | |
service_port = local.port | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment