You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I removed the other data blocks as they are working fine.
data "kubernetes_service" "service" {
metadata {
name = "hellonode"
namespace = "default"
}
}
resource "kubernetes_ingress" "ingress" {
depends_on = [google_compute_global_address.vs_address]
wait_for_load_balancer = true
metadata {
name = "hello-test3-foo-io"
//namespace = "edge" <-- I'd like to create the ingress in this namespace and use a backend service in default
annotations = {
"kubernetes.io/ingress.global-static-ip-name" = google_compute_global_address.vs_address.name
"kubernetes.io/ingress.class" = "gce"
}
}
spec {
backend {
service_name = data.kubernetes_service.service.metadata.0.name
service_port = 80
}
}
}
Debug Output
no gist
Panic Output
none
Steps to Reproduce
Expected Behavior
ingress created in edge namespace with backend in default
Actual Behavior
This error:
"Translation failed: invalid ingress spec: could not find service "edge/hellonode""
It's looking for the service name in the same namespace instead of using the default based on the data resource:
Important Factoids
None
References
None
Community Note
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
If you are interested in working on this issue or have submitted a pull request, please leave a comment
The text was updated successfully, but these errors were encountered:
If I put the namespace in the name, it gives this error:
service_name = "default/${data.kubernetes_service.service.metadata.0.name}"
Error: Failed to create Ingress 'edge/hello-test3-foo-io' because: Ingress.extensions "hello-test3-foo-io" is invalid: spec.backend.serviceName: Invalid value: "default/hellonode": a DNS-1035 label must consist of lower case alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character (e.g. 'my-name', or 'abc-123', regex used for validation is '[a-z]([-a-z0-9]*[a-z0-9])?')
Thanks for opening this @goobysnack – unfortunately this is not possible and is a limitation of this API. The documentation says the backend must be in the same namespace as the ingress so this is not something we can change in Terraform.
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!
hashicorp
locked as resolved and limited conversation to collaborators
May 8, 2021
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Terraform Version, Provider Version and Kubernetes Version
Affected Resource(s)
Terraform Configuration Files
I removed the other data blocks as they are working fine.
Debug Output
no gist
Panic Output
none
Steps to Reproduce
Expected Behavior
ingress created in edge namespace with backend in default
Actual Behavior
This error:
"Translation failed: invalid ingress spec: could not find service "edge/hellonode""
It's looking for the service name in the same namespace instead of using the default based on the data resource:
Important Factoids
None
References
None
Community Note
The text was updated successfully, but these errors were encountered: