Zero-to-jupyterhub-k8s: Defining a namespace in yaml?

Created on 27 Jun 2018  路  3Comments  路  Source: jupyterhub/zero-to-jupyterhub-k8s

Can it make sense for us to define a namespace in yamlfiles? Hmm... Eh... It would allow our values.yaml to name the namespace...

I realized that possibility by watching this video but I figure there will be a one or multiple issues with this... But what would they be?

Most helpful comment

You need to provide it on the commandline to helm commands regardless. If you look at the kubernetes API reference, you'll see almost all calls have the {namespace} in the URL itself. So helm does need to know about the namespace your objects are going to be in in the commandline.

Hence there are no advantages.

It also has a disadvantage, which is that regular helm tooling won't work. For example, if you do a helm install on a namespace that doesn't exist, Helm will create it for you & order things appropriately, since it knows about namespaces. Lots of tools that wrap helm also rely on the standardized `--namespace`` flag to helm commands, and this would break their assumption. Finally, there might be RBAC issues - maybe the tiller SA only has rights to create objects in a namespace, but not a namespace itself (this is fairly common). I'm sure there are other reasons :)

Thank you for thinking about it, @consideRatio. I hope this explanation was useful (and correct!!! :D)

All 3 comments

What's the advantage over defining it on the helm command line?

You need to provide it on the commandline to helm commands regardless. If you look at the kubernetes API reference, you'll see almost all calls have the {namespace} in the URL itself. So helm does need to know about the namespace your objects are going to be in in the commandline.

Hence there are no advantages.

It also has a disadvantage, which is that regular helm tooling won't work. For example, if you do a helm install on a namespace that doesn't exist, Helm will create it for you & order things appropriately, since it knows about namespaces. Lots of tools that wrap helm also rely on the standardized `--namespace`` flag to helm commands, and this would break their assumption. Finally, there might be RBAC issues - maybe the tiller SA only has rights to create objects in a namespace, but not a namespace itself (this is fairly common). I'm sure there are other reasons :)

Thank you for thinking about it, @consideRatio. I hope this explanation was useful (and correct!!! :D)

@manics @yuvipanda Thanks for helping me process this!!!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

consideRatio picture consideRatio  路  4Comments

jgerardsimcock picture jgerardsimcock  路  4Comments

betatim picture betatim  路  4Comments

sgibson91 picture sgibson91  路  3Comments

consideRatio picture consideRatio  路  3Comments