k8s: the controller's listener is a ClusterIP service the host dials by name
The controller's api port was a hostPort on the node, which Pod Security baseline and restricted forbid. It is a ClusterIP Service now, behind a NetworkPolicy that admits only the node. The host's resolver (the hive's dnsmasq) forwards cluster.local to CoreDNS, and the gateway dials the Service by name through nginx's resolver. tcp.hostAddress goes.
This commit is contained in:
parent
4e60183bfa
commit
3cf89f25f1
1 changed files with 355 additions and 103 deletions
|
|
@ -35,6 +35,22 @@ let
|
|||
# The four auth responder packages pinned to four distinct derivations, so
|
||||
# a unit's ExecStart names which option it read. Nothing else reads them.
|
||||
marker = name: pkgs.runCommand "auth-marker-${name}" { } "mkdir $out";
|
||||
|
||||
# The all-local host with the k3s node on, and the controller's TCP listener
|
||||
# that a controller in the cluster needs and the one on the host serves as
|
||||
# well. It does not set `k8s.enable`: the node turns the rendering on.
|
||||
k8sNodeSettings = {
|
||||
deploy.singleHostSwarm = true;
|
||||
deploy.k8s.enable = true;
|
||||
deploy.victorialogs.authPackage = marker "logs";
|
||||
deploy.victorialogs.grafanaAuthPackage = marker "logs-grafana";
|
||||
deploy.victoriametrics.authPackage = marker "metrics";
|
||||
deploy.victoriametrics.agentAuthPackage = marker "metrics-agent";
|
||||
swarm.controller.tcp = {
|
||||
enable = true;
|
||||
domain = "controller.t.local";
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
agentBare = agent { };
|
||||
|
|
@ -55,6 +71,9 @@ in
|
|||
deploy.victoriametrics.agentAuthPackage = marker "metrics-agent";
|
||||
};
|
||||
|
||||
inherit k8sNodeSettings;
|
||||
k8sNode = hiveWithController k8sNodeSettings;
|
||||
|
||||
autheliaOnly = hive { deploy.authelia.enable = true; };
|
||||
|
||||
forgeHere = hive { deploy.forgejo.enable = true; };
|
||||
|
|
|
|||
Loading…
Reference in a new issue