Replica of the same Helm chart can not be installed in different namespaces
I want to install the same helm chart with different configurations into different namespaces, e.g. like this:
```nix
{ lib, kubenix, ... }:
{
imports = with kubenix.modules; [
k8s
helm
];
kubernetes.helm.releases = {
openwebui1 = {
namespace = "openwebui-group1";
chart = kubenix.lib.helm.fetch {
repo = "https://helm.openwebui.com/";
chart = "open-webui";
version = "8.12.2";
sha256 = "sha256-ytSKdcrLQ5g3J8s/FYtmn92waqPNh1EFBtMFI4SFxf4=";
};
values = {
replicaCount = 3;
ollama.enabled = false;
ollamaUrls = [ "https://exampleUrl" ];
ingress.enabled = true;
persistence = {
enabled = true;
size = "500Gi";
accessModes = [ "ReadWriteMany" ];
};
tika.enabled = true;
pipelines.enabled = false;
websocket.enabled = true;
};
};
openwebui2 = {
namespace = "openwebui-group2";
chart = kubenix.lib.helm.fetch {
repo = "https://helm.openwebui.com/";
chart = "open-webui";
version = "8.12.2";
sha256 = "sha256-ytSKdcrLQ5g3J8s/FYtmn92waqPNh1EFBtMFI4SFxf4=";
};
values = {
replicaCount = 3;
ollama.enabled = false;
ollamaUrls = [ "https://someUrl" ];
ingress.enabled = true;
persistence = {
enabled = true;
size = "10Gi";
accessModes = [ "ReadWriteMany" ];
};
};
};
};
}
```
Which should be perfectly fine for Kubernetes. However, when evaluating that, I get an error message about conflicting definitions:
```
error: The option `kubernetes.api.resources.core.v1.PersistentVolumeClaim.open-webui.metadata.namespace' has conflicting definition values:
- In `/nix/store/pgqzqdyb6593pqvlqzhwwyjykn89nihg-source/modules/helm.nix': "openwebui-group1"
- In `/nix/store/pgqzqdyb6593pqvlqzhwwyjykn89nihg-source/modules/helm.nix': "openwebui-group2"
Use `lib.mkForce value` or `lib.mkDefault value` to change the priority on any of these definitions.
```
I can only work around that by separating that into two modules and evaluating as two separate packages and deployments, but the `kubenix` CLI with autopruning does not work within this restriction. Is there another better workaround for this?
关闭于 2025-10-24 2 条评论