Placement delegation
A namespace administrator can let members set placement keys on cloud workstations, or refuse keys for everyone.
A namespace member sets only the keys of a cloud workstation that size it, label it or ask for a public address. The keys that place it and shape its network come from the CloudIdentity. Placement delegation is how an administrator changes that: let members set named keys, refuse keys for everyone, or let one person place one workstation.
Keys you set and keys an administrator sets explains the rule from a member’s side. Keys a namespace member may set lists the keys a member may set on each cloud. If you need no exception to that list, you are done.
Three ways to change who may set a key
- The
cloudconfigright. A writer who holds it sets any of these keys on the workstation in front of them. It comes in two forms. Thecloudconfigverb onworkstationsis one, whichnamespace-adminholds, andorg-adminholds in every namespace of the organization.namespace-memberandnamespace-readerdo not. AcloudconfigGrant on one workstation is the other, and it lets its beneficiary place that workstation and no other. - The CloudIdentity’s
allowlist. It lets members set named keys of its own cloud on the workstations it selects. - The CloudIdentity’s
denylist. It refuses named keys for everyone, a holder of thecloudconfigright included, and it wins overallow.
The key that names a workstation’s runtime identity is the one exception to all three. Nobody sets it on a workstation, and the CloudIdentity sets it. Cloud runtime identities covers it.
Allow and deny lists
spec.providerConfigKeys holds two lists of keys of the identity’s own provider. Spell each key as
Provider images and keys does.
allowlets a member set a key that is otherwise yours alone. It matches the key exactly as written, soZonestays admin-only when you allowzone.denyrefuses a key for every writer, and it works on a key a member may always set too. A key in both lists is denied. It matches without regard to capitals, and it covers a setting’s other spelling: denyingregionalso denieslocation, and denyingzonealso deniesavailabilityZone.
Applying a CloudIdentity refuses a key its provider does not have, and names the keys it does. A typo
in deny therefore cannot leave a key open. It also refuses a runtime-identity key in allow, because no one sets
those on a workstation: serviceAccount on gcp, managedIdentity on azure and iamInstanceProfile
on aws. The CloudIdentity sets them.
A zone that a member may set through allow has to stay in the identity’s region. The
CloudIdentity’s own defaultProviderConfig and overrideProviderConfig name that region, through a
region, a zone, or a full gcp subnetwork or spec.subnet. Ringleader refuses a zone outside it, and the
message names both regions. An identity that names no region refuses every zone, and so does any azure zone,
because Ringleader cannot read a region from one. A holder of the cloudconfig right sets any zone.
Allowing region, location or a subnet key lets the member choose the region too, so this check covers
zone alone.
Scope of the lists
The lists apply to a write that adds or changes a key. Tightening deny leaves workstations that already
carry the key as they are, and a stop, start or restart is not judged at all.
A write that changes a workstation’s labels is the exception. If the new labels select a different
CloudIdentity, Ringleader judges every key the workstation carries again under that identity’s lists. A
workstation cannot move into an identity that denies a key it holds, or out of the identity whose allow
opened one. The refusal says the write changes which CloudIdentity selects the workstation.
Ringleader judges a WorkstationPool template the same way (the fields are in WorkstationPool and WorkstationPoolLease), as a workstation carrying the label that names the pool. A write that carries a block for more than one cloud meets the CloudIdentity that would serve each cloud. A cloud with no CloudIdentity or no lists is judged by the fixed list alone.
Deny does not stop a member from relabeling
deny rules the workstations an identity selects, and it does not bound which identity a member
picks.The cloudconfig Grant
A cloudconfig Grant lets someone place one workstation without holding the verb. Four rules bound it:
- It names one workstation. A target that uses
matchLabelsormatchName: "*"is refused, and so is addingcloudconfigto an existingsshGrant that selects by label. A label selector would reach every workstation that the beneficiary labels into it. To let someone place several workstations, write one Grant for each. - Only an administrator writes it. Ringleader refuses a writer who does not hold the
cloudconfigverb, so a member cannot grant it to anyone, themselves included. Its Grant has administrator scope. It reaches the named workstation whoever owns it. - It does not cover a pool. A Grant names a workstation, so Ringleader judges a WorkstationPool’s template by the verb alone.
- It does not cover the runtime identity, and a
denylist still applies. Neither the verb nor a Grant lets anyone setserviceAccount,managedIdentityoriamInstanceProfileon a workstation. A key that the CloudIdentity denies stays refused.
A Grant that names a workstation not yet created applies to a new workstation of the same name, as any Grant does. It keeps the scope it was written with, so an administrator who is later demoted leaves the Grant working until someone deletes it.
Allow or deny a key
To let members set a key, add it to allow on the CloudIdentity that selects their workstations. To
refuse a key for everyone, add it to deny. This identity lets members choose the zone and stops anyone
changing assignPublicIp:
spec:
provider: gcp
providerConfigKeys:
allow: [zone]
deny: [assignPublicIp]Nobody can then change assignPublicIp on a workstation, so it stays whatever the CloudIdentity gives it.
Let one person place one workstation
Write a Grant for the workstation and apply it with rl apply. rl workstation share never writes
one, so the ssh Grants it makes are unchanged.
apiVersion: core.ringleader.dev/v1
kind: Grant
metadata:
name: build-box-placement-to-alice
namespace: dev
spec:
target:
kind: Workstation
matchName: build-box
subjects:
- user:alice@acme.com
rights:
- cloudconfigAlice may then set any placement or network key on build-box, when she creates it and when she updates
it, and on no other workstation.
Next steps
- Grant: the fields of a Grant.
- Subnet claims: give a subnet to one namespace, which also places its workstations.