kubenix/docs/content/examples/pod/default.nix

19 lines
671 B
Nix
Raw Normal View History

2022-08-29 02:04:47 -04:00
# let's creata a function whose only input is the kubenix package
2023-07-07 22:01:34 -04:00
{ kubenix ? import ../../../.. }:
2022-08-29 02:04:47 -04:00
# evalModules is our main entrypoint
kubenix.evalModules.${builtins.currentSystem} {
# to it, we pass a module that accepts a (different) kubenix object
2023-07-07 22:01:34 -04:00
module = { kubenix, ... }: {
2022-08-29 02:04:47 -04:00
# in order to define options, we need to import their definitions
2023-07-07 22:01:34 -04:00
imports = [ kubenix.modules.k8s ];
2022-08-29 02:04:47 -04:00
# now we have full access to define Kubernetes resources
2023-06-03 02:38:28 -04:00
kubernetes.resources.pods = {
# "example" is the name of our pod
example.spec.containers = {
# "ex" is the name of the container in our pod
ex.image = "nginx";
};
};
2022-08-29 02:04:47 -04:00
};
}