-
Notifications
You must be signed in to change notification settings - Fork 42
Open
Description
Hello,
Defining kubernetes.namespace is a practical way to set the namespace to all resources but it's also applied to ones which shouldn't have it.
let
kubenix = import (builtins.fetchGit {
url = "https://github.com/hall/kubenix.git";
ref = "main";
});
in
(kubenix.evalModules.${builtins.currentSystem} {
module = {kubenix, ...}: {
imports = [
kubenix.modules.k8s
{ kubernetes.resources.namespaces.a-namespace = {}; }
];
kubernetes.namespace = "an-other-namespace";
};
})
.config
.kubernetes
.objects$ nix eval -f poc.nix --json | jq .
[
{
"apiVersion": "v1",
"kind": "Namespace",
"metadata": {
"annotations": {
"kubenix/k8s-version": "1.30",
"kubenix/project-name": "kubenix"
},
"name": "a-namespace",
"namespace": "an-other-namespace"
}
}
]
Kubenix should be aware of namespaced/clusterwide resources to decide if the namespace is needed.
I'm not familiar enough with the codebase to open a PR but I can probably do it with some direction pointing :) .
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels