k8s: stt's pod gets a network policy: dns and four host ports out, nothing in
This commit is contained in:
parent
513be8f7d0
commit
6051a83044
1 changed files with 262 additions and 22 deletions
|
|
@ -92,9 +92,10 @@ Job:
|
|||
cluster doesn't apply it again. The rename also records what remains to
|
||||
delete. With no link, nothing went in, so the unit does nothing and needs no
|
||||
cluster.
|
||||
2. Wait for the cluster's API, then delete the service's Deployment, CronJob and
|
||||
ServiceAccount (selected by `app.kubernetes.io/name`), and wait until its pods
|
||||
have gone. A pod exits 0 within its termination grace period.
|
||||
2. Wait for the cluster's API, then delete the service's Deployment, CronJob,
|
||||
NetworkPolicy and ServiceAccount (selected by `app.kubernetes.io/name`), and
|
||||
wait until its pods have gone. A pod exits 0 within its termination grace
|
||||
period.
|
||||
3. Delete the cluster's AddOn for the file, so that a later switch to `"k8s"`
|
||||
applies the same manifest again. Then remove the renamed link.
|
||||
|
||||
|
|
@ -274,12 +275,20 @@ The pod takes the unit's `MemoryMax` and `CPUQuota` as its container's limits
|
|||
([manifests](manifests.md#pods)), so `swarm-stt` keeps its 3 GiB and four-core
|
||||
ceilings. The pod requests nothing (memory `0`, cpu `0`, as the unit sets no
|
||||
`MemoryMin` or `MemoryLow`), so the node reserves nothing for it and the pod is
|
||||
Burstable. `TasksMax` has no pod counterpart, so the renderer drops it. The systemd sandbox
|
||||
(`MemoryDenyWriteExecute`, `SystemCallFilter`, `PrivateUsers`, the read-only
|
||||
`ProtectSystem` and the rest) stays on the host. The pod is a non-root user with
|
||||
a read-only root filesystem, every capability dropped, the runtime's default
|
||||
seccomp profile and no API token, which is its whole sandbox. Neither side
|
||||
restricts the network.
|
||||
Burstable. `TasksMax` has no pod counterpart, so the renderer drops it. The
|
||||
systemd sandbox (`MemoryDenyWriteExecute`, `SystemCallFilter`, `PrivateUsers`,
|
||||
the read-only `ProtectSystem` and the rest) stays on the host. The pod is a
|
||||
non-root user with a read-only root filesystem, every capability dropped, the
|
||||
runtime's default seccomp profile and no API token. The host unit doesn't
|
||||
restrict the network. The pod has a NetworkPolicy (`swarm-stt`, rendered with
|
||||
the pod): it may reach cluster DNS, and on the node's bridge address the store's
|
||||
pod listener, the identity provider, the queue and the hive collector, each on
|
||||
its one port. It admits no ingress. The kubelet's probes still reach the pod,
|
||||
because the node's own traffic to a pod is always admitted, and the pod doesn't
|
||||
serve anything else: requests reach it as queue messages, over the connection it
|
||||
opens. Where the queue runs in the cluster, the policy also allows the queue's
|
||||
pod on its port, because the node forwards the queue's `hostPort` to the pod
|
||||
before the policy sees the packet.
|
||||
|
||||
## Telemetry and credentials of the poller
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue