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 module loads (`system.build.k8sImages`);
|
||||||
# - the cluster encrypts its Secrets, runs CoreDNS, and runs neither traefik
|
# - the cluster encrypts its Secrets, runs CoreDNS, and runs neither traefik
|
||||||
# nor metrics-server;
|
# nor metrics-server;
|
||||||
# - the cluster holds no hyperhive workload: its namespace does not exist and
|
# - the cluster's only hyperhive workload is the poller's CronJob, with the
|
||||||
# no pod runs one of the images;
|
# 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
|
# - 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;
|
# hive bridge keeps its own, so the two do not share a subnet;
|
||||||
# - the firewall trusts `cni0`, and still guards the other interfaces;
|
# - the firewall trusts `cni0`, and still guards the other interfaces;
|
||||||
|
|
@ -188,8 +189,17 @@ pkgs.testers.runNixOSTest {
|
||||||
for name in ["traefik", "metrics-server"]:
|
for name in ["traefik", "metrics-server"]:
|
||||||
assert f"deployment.apps/{name}" not in deployments, deployments
|
assert f"deployment.apps/{name}" not in deployments, deployments
|
||||||
|
|
||||||
with subtest("the cluster holds no hyperhive workload"):
|
with subtest("the cluster's only hyperhive workload is the poller's CronJob, behind the default-deny policy"):
|
||||||
machine.fail("kubectl get namespace hyperhive")
|
# 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"]
|
pods = json.loads(kube(machine, "get pods -A -o json"))["items"]
|
||||||
images = [c["image"] for p in pods for c in p["spec"]["containers"]]
|
images = [c["image"] for p in pods for c in p["spec"]["containers"]]
|
||||||
assert images, "no pod runs: the lookup finds nothing"
|
assert images, "no pod runs: the lookup finds nothing"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue