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
Simplify namespaces in Tanka #308
Comments
Issue-Label Bot is automatically applying the label Links: app homepage, dashboard and code for this bot. |
I like simplicity. We should still make a token effort to not put namespaces on cluster wide objects. But there are not very many of those. A simple list will probably suffice. So to summarize:
It might make sense for tanka to then remove the namespaced label if it finds it. Then if you have a library for a crd (or maybe even the main k8s lib) you can put the label in with the constructor and it will have the right effect without altering the final objects. Just an idea. The list of types can probably be simpler than the generated store the other or uses. I think our full config really only uses 3 or 4 global kinds. |
@captncraig I'd suggest an annotation instead of a label, as annotations can have bool values. Apart from that, I am not sure if it's worth maintaining a list, if kubectl (or even the apiServer?) ignores such data anyways. After all, all objects seem to include |
If we don't want a preset list of cluster wide objects inside Tanka, could we create a 'cluster-wide mixin' for k.libsonnet?
|
I can get behind the library idea. Would such a thing live in jsonnet-libs/k8s or in tanka? |
Currently, party defers namespace handling to
kubectl
. This means thespec.namespace
set inspec.json
is set as the default namespace during run for the used context, by injecting a custom YAML snippet into$KUBECONFIG
. This is a hack.The big downside is that namespaces are different during
show
andapply
. YAML won't include full namespace information, which is a challenge forexport
and CD.Previously we took a more naive approach, where we always injected the namespace, regardless of whether an object actually needs / accepts one. This also led to errors on pseudo types like
List
objects.As part of #306,
List
types won't exist at the time we inject namespaces anymore, as they were unwrapped already. This should allow us to revert back to the naive behaviour, so thatexport
also includes namespace data.Although we are not aware of any kinds this causes problems with, I also suggest introducing a
tanka.dev/namespaced
annotation, to manually override the behaviour if required.The text was updated successfully, but these errors were encountered: