mirror of
https://github.com/TECHNOFAB11/kubenix.git
synced 2025-12-12 16:10:05 +01:00
docs: add helm section on patching resources
This commit is contained in:
parent
baa1a6c949
commit
6c27c1d52b
1 changed files with 23 additions and 1 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
To define a helm release, use the {{< option "kubernetes.helm.releases" >}} option.
|
To define a Helm release, use the {{< option "kubernetes.helm.releases" >}} option.
|
||||||
|
|
||||||
{{< source "default.nix" >}}
|
{{< source "default.nix" >}}
|
||||||
|
|
||||||
|
|
@ -7,3 +7,25 @@ Fetch and render the chart just as we did with plain manifests:
|
||||||
```sh
|
```sh
|
||||||
nix eval -f . --json config.kubernetes.generated
|
nix eval -f . --json config.kubernetes.generated
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## patching
|
||||||
|
|
||||||
|
A common issue with Helm charts is the need to template everything under the sun.
|
||||||
|
Kubenix solves this issue by merging configuration during evaluation.
|
||||||
|
|
||||||
|
For example, to patch the deployment created by the release above:
|
||||||
|
|
||||||
|
```nix
|
||||||
|
{
|
||||||
|
# define a resource with the same name
|
||||||
|
kubernetes.resources.deployments.nginx = {
|
||||||
|
# be sure to match the corresponding namespace as well
|
||||||
|
metadata.namespace = "default";
|
||||||
|
# here we can configure anything and are no longer bound by `values.yaml`
|
||||||
|
spec.template.spec.containers.nginx.env = [{
|
||||||
|
name = "MY_VARIABLE";
|
||||||
|
value = "100";
|
||||||
|
}];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
```
|
||||||
Loading…
Add table
Add a link
Reference in a new issue