bind health listeners to the pod's loopback and probe them by exec
This commit is contained in:
parent
448c3bf1b3
commit
9c64b80538
1 changed files with 255 additions and 185 deletions
|
|
@ -166,7 +166,7 @@ of more than one node needs one before the controller may run there.
|
|||
the controller on the host the locations dial that name. The Service has a
|
||||
NetworkPolicy that selects the pod for ingress and allows nothing: the
|
||||
cluster's policy engine always admits traffic from an address of the node, so
|
||||
the gateway's connection and the kubelet's probes reach the pod, and no other
|
||||
the gateway's connection reaches the pod, and no other
|
||||
pod does. A Service works on a cluster of more than one node, but the
|
||||
controller's Deployment still has the one replica.
|
||||
- **The listener's leaf.** The pod issues its own, from the store's
|
||||
|
|
@ -186,8 +186,9 @@ of more than one node needs one before the controller may run there.
|
|||
`swarmctl` reaches the controller only through the gateway: run
|
||||
`swarmctl login` once. The host's wrapper defaults `--swarm` to the host's own
|
||||
swarm and sets no socket path, since a socket path on the host serves nothing.
|
||||
- **Probes.** The pod binds `SWARM_CONTROLLER_HEALTH_ADDR`, with liveness on
|
||||
`/healthz` and readiness on `/readyz`. Readiness needs the queue connection
|
||||
- **Probes.** The pod binds `SWARM_CONTROLLER_HEALTH_ADDR` on the pod's
|
||||
loopback, with liveness on `/healthz` and readiness on `/readyz`, both `exec`
|
||||
probes of `wget` in the container. Readiness needs the queue connection
|
||||
and a fresh store login, so a store role that refuses the pod's token leaves
|
||||
it NotReady.
|
||||
- **State.** `/var/lib/swarm-controller` is an `emptyDir`. The record of the
|
||||
|
|
@ -254,7 +255,7 @@ strategy, and the removed container stops before the pod can start.
|
|||
client, and only the node may read it. The pod's NetworkPolicy selects it for
|
||||
ingress and allows the client port from any source and nothing else. The
|
||||
cluster's policy engine always admits traffic from an address of the node, so
|
||||
the gateway and the kubelet's probes reach the pod, and a pod of the cluster,
|
||||
the gateway reaches the pod, and a pod of the cluster,
|
||||
or a client of the bridge that the host forwards, doesn't reach the exporter.
|
||||
- **The exporter's login.** The node's processes reach the exporter too, so it
|
||||
asks every request for a login. The exporter's container runs with
|
||||
|
|
@ -321,7 +322,7 @@ strategy, and the removed container stops before the pod can start.
|
|||
The claim and its volume stay until the operator deletes them, as every claim
|
||||
does, with the directory.
|
||||
- **Readiness.** The pod is Ready when the responder's `/readyz`, on the pod's
|
||||
port 8080, passes and the server's exec probe does. The probe runs
|
||||
loopback port 8080, passes and the server's exec probe does. The probe runs
|
||||
`wget` against `/healthz?js-enabled-only=true` on the server's monitor, which
|
||||
stays on the pod's loopback; the server's image holds `wget` and nothing else
|
||||
of busybox.
|
||||
|
|
@ -423,7 +424,7 @@ writes to the store and Grafana that reads it.
|
|||
Security `restricted` refuses a `hostPath` for it.
|
||||
- **Who reaches what.** Both pods have a NetworkPolicy that selects them for
|
||||
ingress and allows none, so only the node's own traffic reaches them: the
|
||||
host's nginx, which dials the Services, and the kubelet's probes. The policy
|
||||
host's nginx, which dials the Services, and the kubelet's `/health` probe. The policy
|
||||
refuses a pod of the cluster. The log store asks for its credential on every route, so a
|
||||
process on the host that dials the Service gets 401: see
|
||||
[the stores' listener credential](#the-stores-listener-credential). The responders' policy
|
||||
|
|
@ -507,13 +508,14 @@ pushes to the store and Grafana that reads it.
|
|||
the pod has one ServiceAccount and one jwt role of that name, and both read the
|
||||
store with the pod's token. They hold no state, so the pod has no node label
|
||||
and runs on any node. Each serves TCP (`--listen`) on 8083 and 8084 behind a
|
||||
Service of its own. The second container names its ports `grafana-api` and
|
||||
`grafana-health`: a Service resolves a named port to the first container of the
|
||||
pod that declares the name, so a shared name would send Grafana's bearer to the
|
||||
agents' responder.
|
||||
Service of its own. The second container names its port `grafana-api`: a Service
|
||||
resolves a named port to the first container of the pod that declares the
|
||||
name, so a shared name would send Grafana's bearer to the agents' responder.
|
||||
Each container's health listener (8085 on the second) binds to the pod's
|
||||
loopback, and the kubelet runs `wget` in the container against it.
|
||||
- **Who reaches what.** Both pods have a NetworkPolicy that selects them for
|
||||
ingress and allows none, so only the node's own traffic reaches them: the
|
||||
host's nginx, which dials the Services, and the kubelet's probes. The store
|
||||
host's nginx, which dials the Services. The store
|
||||
asks for its credential on every route, so a process on the host that dials the
|
||||
Service gets 401: see [the stores' listener credential](#the-stores-listener-credential).
|
||||
The responders' policy also lets the pod reach cluster DNS and the secret
|
||||
|
|
@ -557,8 +559,8 @@ seccomp profile and no API token.
|
|||
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
|
||||
admits no ingress. The pod's health listener binds to its loopback and the
|
||||
kubelet probes it from inside the container, and the pod doesn't serve anything
|
||||
else: requests reach it as queue messages, over the connection it opens. The
|
||||
policy also allows the pods of the queue's
|
||||
load balancer, in `kube-system`, on the queue's port, because the node forwards
|
||||
|
|
|
|||
Loading…
Reference in a new issue