Watch
0
0
Fork
You've already forked hyperhive
0

k8s: deploy.notify-router.runtime moves the router between its container and the cluster

This commit is contained in:
atlas 2026-11-21 15:16:32 +01:00 • committed by maia
commit a1d44ed046

View file

@ -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;