k8s: deploy.notify-router.runtime moves the router between its container and the cluster
This commit is contained in:
parent
40519f9123
commit
30567ad28f
1 changed files with 671 additions and 187 deletions
|
|
@ -1,7 +1,8 @@
|
|||
# Kubernetes manifests for the swarm services this host deploys, rendered by
|
||||
# ./render.nix from their systemd units. Rendering only: nothing here applies
|
||||
# them or changes a unit. docs/4-implementation/k8s/manifests.md has the
|
||||
# design.
|
||||
# ./render.nix from their systemd units, and the per-service switch that moves
|
||||
# a service between its host unit and the cluster (./runtime.nix). Rendering
|
||||
# alone changes no unit and applies nothing. docs/4-implementation/k8s/manifests.md
|
||||
# and runtime.md have the design.
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
|
|
@ -25,6 +26,7 @@ in
|
|||
./host-services.nix
|
||||
./node.nix
|
||||
./pod-logs.nix
|
||||
./runtime.nix
|
||||
];
|
||||
|
||||
options.services.hyperhive.k8s = {
|
||||
|
|
@ -39,7 +41,9 @@ in
|
|||
The manifests reference their Secrets by name only.
|
||||
|
||||
Rendering only: the host's units stay as they are, and nothing
|
||||
applies the manifests to a cluster.
|
||||
applies the manifests to a cluster. A service with a `runtime` option
|
||||
is applied when it says `k8s`, on a host with
|
||||
{option}`services.hyperhive.deploy.k8s.enable`.
|
||||
'';
|
||||
};
|
||||
|
||||
|
|
@ -48,9 +52,26 @@ in
|
|||
default = "hyperhive";
|
||||
description = "The Kubernetes namespace the rendered objects live in.";
|
||||
};
|
||||
|
||||
rendered = lib.mkOption {
|
||||
type = lib.types.raw;
|
||||
readOnly = true;
|
||||
internal = true;
|
||||
description = ''
|
||||
What ./runtime.nix moves services with: each enabled service's
|
||||
objects and switch, the namespace object, and the CA ConfigMap's name
|
||||
and host files.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.hyperhive.k8s.rendered = {
|
||||
inherit (rendered) caConfigMap caSources switches;
|
||||
services = withoutContext rendered.services;
|
||||
namespaceObject = withoutContext rendered.objects.namespace;
|
||||
};
|
||||
|
||||
# The images those pods run, for a node to load: ./node.nix.
|
||||
system.build.k8sImages = rendered.images;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue