feat(examples): add nginx deployment

This commit is contained in:
Jaka Hudoklin 2019-03-07 18:03:51 +01:00
parent 5d8b66f8a0
commit 432cc9e347
No known key found for this signature in database
GPG key ID: 6A08896BFD32BD95
6 changed files with 140 additions and 0 deletions

View file

@ -0,0 +1,33 @@
{ kubenix ? import ../.. {} }:
with kubenix.lib;
let
registy = "docker.io/gatehub";
in rec {
# evaluated configuration
config = (kubenix.evalModules {
modules = [
./module.nix
{ docker.registry.url = registy; }
];
}).config;
# list of kubernetes objects
objects = config.kubernetes.objects;
# hashed kubernetes List object
listObject = k8s.mkHashedList { items = config.kubernetes.objects; };
# YAML file you can deploy to kubernetes
yaml = toYAML listObject;
# Exported docker images
images = config.docker.export;
# script to push docker images to registry
pushDockerImages = docker.copyDockerImages {
inherit images;
dest = "docker://${registy}";
};
}