-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Remove namespace from ingress-nginx, let user set it. #3994
Comments
Closing. One of the reasons why we cannot do this is related to RBAC. Please check https://github.com/kubernetes/ingress-nginx/blob/master/deploy/rbac.yaml |
So everyone has to use this namespace? Then take out rbac!
It's not mandatory to have rbac for every user, and if they need it, it's simple command line entries--WHERE THEY CAN SPECIFY A NAMESPACE. Imagine that! Wow! Such kube! Many namespace! What isn't simple is having to go through each file and manually change namespaces and names, but that's only after you've figured out that it has to be specific to a namespace. At no point in https://github.com/kubernetes/ingress-nginx/blob/master/docs/deploy/index.md, is it clear that you can only use it for one namespace. Do you not see how mind-numbingly stupid this is? You can have the user specify the namespace, or it can be default. It doesn't need to be hard-coded in to some weirdly specific namespace name, that is only meant to serve one namespace. This just perpetuates the idea that ingress is namespace agnostic. Your docs imply it, tutorials imply it, and your dismissive response implies it. It's been almost four years since this: kubernetes/kubernetes#17088 Either make the change, provide more clarification on how a user can apply it to a specific namespace--and that they pretty much should. I mean, LITERALLY APPLY IT, not |
Configurability in static kubernetes yaml files has always been a problem. Its been kind of rare in my experience that static yaml's provided by a project are directly usable without changes. There have been many tools built on top of k8s to try and address this problem. The goal I think of the static manifests are to, as much as possible, let the user just kubectl apply -f thingy you could document stuff like:
but you get down the rabbit hole of, maybe that should be documented bash: namespace=<namespace>
serviceaccount=<serviceaccount>
kubectl create namespace $namespace
kubectl create serviceaccount $serviceaccount --namespace $namespace
kubectl create clusterrolebinding $serviceaccount --clusterrole cluster-admin --serviceaccount=$namespace:$serviceaccount and then if your going there, why not just provide a bash script in the git repo, deploy.sh #!/bin/bash
namespace="$1"
serviceaccount="$2"
kubectl create namespace $namespace
kubectl create serviceaccount $serviceaccount --namespace $namespace
kubectl create clusterrolebinding $serviceaccount --clusterrole cluster-admin --serviceaccount=$namespace:$serviceaccount
#usage
deploy.sh <namespace> <serviceaccount> and on and on... At some point, we just need to stop reinventing the wheel and just start standardizing on some packaging tools. |
No, you can change that.
For most of the users this is not an option
There is nothing we can do about it in ingress-nginx. That issue only can be solved if the Ingress spec, defined in the Kubernetes project changes, and that is out of the scope of this project.
Why? Yaml files are static, there is no way to make things dynamics. For that you have things like kustomize or helm. Something like:
Have you seen the number of options you can change? Plain yaml files are not enough |
You literally just described Helm. |
So, for example, users can currently download the resource manifests from this repository (or make a submodule or whatever else), and then tie them together with a
With a file like this, It's also possible to make this even simpler by providing bases in this repository, so people could just make a file like this:
I'll make a pull request to demonstrate. |
Ah, the only thing that approach cannot do automatically is create the correct namespace. So my example would actually need to be changed to this:
And you'd need to also create a
And even then, deployment would still create the |
The problem I see is that if we install ingress-nginx using the two command line entries provided (Azure example), we have no way of changing the namespace. To most people this would imply that it is namespace agnostic.
Remove the namespace from ingress-nginx so the user can set it with
-n <namespace>
.The text was updated successfully, but these errors were encountered: