1

I'm creating an ingress using terraform kubernetes_ingress resource:

resource "kubernetes_ingress" "this" { metadata { name = "mongodb-ingress" } spec { backend { service_name = "mongodb" service_port = 9092 } rule { http { path { path = "/mongodb/*" backend { service_name = "mongodb" service_port = 9092 } } } } } } 

It's not clear to me which namespace will be assigned this ingress rule on.

I've tried to get if there's any namespace property, but I don't quite figure out where is it.

Any ideas?

1
  • 1
    If you don't specify it and apply it does it not just end up in the default namespace? Commented May 22, 2020 at 13:11

1 Answer 1

2

There is a namespace property in terraform kubernetes provider. Please take a loot at here.

If you don't specify a namespace then it'll be created in default namespace.

resource "kubernetes_ingress" "this" { metadata { name = "mongodb-ingress" namespace = "dev" } spec { backend { service_name = "mongodb" service_port = 9092 } rule { http { path { path = "/mongodb/*" backend { service_name = "mongodb" service_port = 9092 } } } } } } kubectl get ing -n dev NAME CLASS HOSTS ADDRESS PORTS AGE mongodb-ingress <none> * 80 7s 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.