k8s: pods log in to the secret store with their ServiceAccount token
The store gets a listener for the pods that asks for no client certificate, open on the pod network's interfaces only, and a jwt auth mount with one role per in-cluster service. The rendered pods run under a ServiceAccount with a projected token in place of their client certificate.
This commit is contained in:
parent
cad1b7cebe
commit
d1554def7a
1 changed files with 720 additions and 69 deletions
|
|
@ -26,14 +26,15 @@ file is `services.hyperhive.deploy.bao.bootstrapTokenFile`, which all-local
|
|||
names for you; on a store host that isn't all-local, set it and rebuild first.
|
||||
|
||||
`swarm-bao-granter-role` runs **on the host**. It enables the cert and oidc
|
||||
auth methods (and disables `approle` if an older store still has it mounted),
|
||||
auth methods, and `jwt-k8s` on a host with the cluster node (and disables
|
||||
`approle` if an older store still has it mounted),
|
||||
writes the `bao-granter` policy, and creates the `bao-granter` role, which
|
||||
accepts the leaf `/var/lib/swarm-bao-pki/granter.pem`. Every
|
||||
`swarm-bao-*-policy` unit then logs in with that leaf. The controller's unit
|
||||
mounts the KV and pki engines and writes the `swarm-controller` role, and each
|
||||
sibling unit writes its own principal's policy and role. Every one runs on the
|
||||
host, because every API listener but the loopback UI one demands a client
|
||||
certificate and the host is the side that has one.
|
||||
host, because every API listener but the loopback UI one and the cluster
|
||||
pods' one demands a client certificate and the host is the side that has one.
|
||||
|
||||
Until the granter exists, each `swarm-bao-*-policy` unit **fails** and logs
|
||||
the bootstrap commands. It never skips. `swarm-bao-granter-role` skips while
|
||||
|
|
@ -92,6 +93,17 @@ constrain what a policy says. What bounds it:
|
|||
restarting `swarm-bao-pki` mints a new leaf, but doesn't invalidate the old
|
||||
one.
|
||||
|
||||
## Pods in the cluster
|
||||
|
||||
A service that runs in the k3s cluster (`deploy.k8s.enable`) logs in with its
|
||||
pod's ServiceAccount token instead of a certificate. The store has a `pod`
|
||||
listener for it, on the hive bridge's address at `deploy.bao.podListenerPort`,
|
||||
that asks for no client certificate, and a `jwt-k8s` auth mount with one role
|
||||
per in-cluster service. Only the firewall keeps the port from the agents on
|
||||
the bridge: it admits the port on the pod network's interfaces alone. The
|
||||
roles, the keys they trust and the pods' side are in
|
||||
[the cluster node](../k8s/node.md#logging-in-to-the-secret-store).
|
||||
|
||||
## Sealing
|
||||
|
||||
`services.hyperhive.deploy.bao.seal`:
|
||||
|
|
|
|||
Loading…
Reference in a new issue