mirror of
https://github.com/TECHNOFAB11/kubenix.git
synced 2025-12-12 16:10:05 +01:00
feat(examples/nginx-deployment): minor refactor, fixes and e2e test
This commit is contained in:
parent
eac2d78667
commit
fc9abaa519
4 changed files with 54 additions and 14 deletions
|
|
@ -1,26 +1,36 @@
|
|||
{ kubenix ? import ../.. {} }:
|
||||
{ kubenix ? import ../.. {}, registry ? "docker.io/gatehub" }:
|
||||
|
||||
with kubenix.lib;
|
||||
|
||||
let
|
||||
registry = "docker.io/gatehub";
|
||||
in rec {
|
||||
rec {
|
||||
# evaluated configuration
|
||||
config = (kubenix.evalModules {
|
||||
modules = [
|
||||
./module.nix
|
||||
{ docker.registry.url = registry; }
|
||||
|
||||
kubenix.modules.testing
|
||||
{
|
||||
testing.tests = [ ./test.nix ];
|
||||
testing.defaults = ({ lib, ... }: with lib; {
|
||||
docker.registry.url = mkForce "";
|
||||
kubernetes.version = config.kubernetes.version;
|
||||
});
|
||||
}
|
||||
];
|
||||
}).config;
|
||||
|
||||
# list of kubernetes objects
|
||||
objects = config.kubernetes.objects;
|
||||
# e2e test
|
||||
test = config.testing.result;
|
||||
|
||||
# nixos test script for running the test
|
||||
test-script = config.testing.testsByName.nginx-deployment.test;
|
||||
|
||||
# hashed kubernetes List object
|
||||
listObject = k8s.mkHashedList { items = config.kubernetes.objects; };
|
||||
result = k8s.mkHashedList { items = config.kubernetes.objects; };
|
||||
|
||||
# YAML file you can deploy to kubernetes
|
||||
yaml = toYAML listObject;
|
||||
yaml = toYAML k8s-result;
|
||||
|
||||
# Exported docker images
|
||||
images = config.docker.export;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue