splunk / qbec

configure kubernetes objects on multiple clusters using jsonnet
https://qbec.io
Apache License 2.0
168 stars 37 forks source link

Add flag to include/exclude components by namespace #270

Closed hooten closed 2 years ago

hooten commented 2 years ago

Feature request

Add flag to include/exclude components that evaluate to a given namespace. For example:

qbec apply k8s-cluster -n namespaceA

would only apply k8s resources that have namespace: namespaceA. A similar command with a -N flag could exclude k8s resources with the given namespace.

This feature would be similar to the component or kind flags, which are as follows:

-c, --component stringArray           include just this component
-C, --exclude-component stringArray   exclude this component
-k, --kind stringArray                include objects with this kind
-K, --exclude-kind stringArray        exclude objects with this kind

This feature would not be applicable for cluster-scoped resources. In the case that there are cluster-scoped resources in the repo and and include/exclude namespace flag is specified, I would expect no cluster resources to be returned.

Use case

I have a mono-repo that deploys to k8s resources to multiple namespaces, but I would like to create separate jobs for each namespace in order to limit deployment permissions and blast radius for each job.

gotwarlost commented 2 years ago
hooten commented 2 years ago
gotwarlost commented 2 years ago

Let's leave the namespace object out of it. We can add it later if needed