let a second machine join the main node's k3s and run pods from images only the main node holds
This commit is contained in:
parent
c0cc44705f
commit
272af0b3e8
1 changed files with 1106 additions and 96 deletions
|
|
@ -6,6 +6,12 @@
|
|||
packages ? { },
|
||||
}:
|
||||
let
|
||||
# The registry host every image name carries. `.invalid` is reserved by RFC 6761
|
||||
# and never resolves, so a node that holds no copy of an image, and finds none
|
||||
# at a peer, fails to pull it instead of asking a public registry for a name
|
||||
# it does not own. ../host-modules/k8s/node.nix mirrors this host.
|
||||
registryHost = "registry.hyperhive.invalid";
|
||||
|
||||
# The conventional nonroot id. An OCI image has no `config.ids` to take it
|
||||
# from, so it is defined once here: the image's `User`, the smoke check and
|
||||
# a pod's `securityContext.runAsUser`/`runAsGroup` must all read this.
|
||||
|
|
@ -31,7 +37,7 @@ let
|
|||
env ? { },
|
||||
}:
|
||||
pkgs.dockerTools.buildLayeredImage {
|
||||
name = "hyperhive/${name}";
|
||||
name = "${registryHost}/${name}";
|
||||
contents = [
|
||||
package
|
||||
pkgs.cacert
|
||||
|
|
@ -55,7 +61,7 @@ let
|
|||
};
|
||||
in
|
||||
{
|
||||
inherit mkServiceImage serviceUser;
|
||||
inherit mkServiceImage registryHost serviceUser;
|
||||
|
||||
images = lib.genAttrs [
|
||||
"swarm-controller"
|
||||
|
|
|
|||
Loading…
Reference in a new issue