k8s-node asserts the poller's CronJob and default-deny policy in the hyperhive namespace, which the cluster now holds
This commit is contained in:
parent
1a9fab57f5
commit
b7a8410769
1 changed files with 14 additions and 4 deletions
|
|
@ -8,8 +8,9 @@
|
|||
# the module loads (`system.build.k8sImages`);
|
||||
# - the cluster encrypts its Secrets, runs CoreDNS, and runs neither traefik
|
||||
# nor metrics-server;
|
||||
# - the cluster holds no hyperhive workload: its namespace does not exist and
|
||||
# no pod runs one of the images;
|
||||
# - the cluster's only hyperhive workload is the poller's CronJob, with the
|
||||
# namespace's default-deny ingress policy, and no pod runs one of the images
|
||||
# under the hive's own name;
|
||||
# - the node takes pod and service addresses from the module's ranges and the
|
||||
# hive bridge keeps its own, so the two do not share a subnet;
|
||||
# - the firewall trusts `cni0`, and still guards the other interfaces;
|
||||
|
|
@ -188,8 +189,17 @@ pkgs.testers.runNixOSTest {
|
|||
for name in ["traefik", "metrics-server"]:
|
||||
assert f"deployment.apps/{name}" not in deployments, deployments
|
||||
|
||||
with subtest("the cluster holds no hyperhive workload"):
|
||||
machine.fail("kubectl get namespace hyperhive")
|
||||
with subtest("the cluster's only hyperhive workload is the poller's CronJob, behind the default-deny policy"):
|
||||
# k3s applies the manifests once it is Ready, the CronJob's file after
|
||||
# the namespace's.
|
||||
machine.wait_until_succeeds(
|
||||
"kubectl -n hyperhive get cronjob/swarm-ci-metrics networkpolicy/default-deny-ingress", timeout=120
|
||||
)
|
||||
names = kube(machine, "-n hyperhive get cronjob,deployment,statefulset,daemonset,networkpolicy -o name").split()
|
||||
assert sorted(names) == [
|
||||
"cronjob.batch/swarm-ci-metrics",
|
||||
"networkpolicy.networking.k8s.io/default-deny-ingress",
|
||||
], names
|
||||
pods = json.loads(kube(machine, "get pods -A -o json"))["items"]
|
||||
images = [c["image"] for p in pods for c in p["spec"]["containers"]]
|
||||
assert images, "no pod runs: the lookup finds nothing"
|
||||
|
|
|
|||
Loading…
Reference in a new issue