The CRD schema freezes what the object changes. So the only field that a patch can still change is the approval.
A person who holds patch sets approvedBy to their own name. Permission to patch is permission to approve.
The admission policies refuse an approval in another name, a second approval, and an approval by the operator. They refuse an approval of your own proposal only if the site sets selfApproval: Forbidden.
Generated from the +kubebuilder:rbac markers of the controllers. The ClusterRole holds the kinds. The Role in pk-metal holds Secrets, ConfigMaps, Jobs, the lease and certificate requests.
pk-metal-approver (ClusterRole)
Read and patch operations and rollouts. Read Hosts, clusters and nodes. Nothing binds it by default. A patch can also set annotations on an operation: abort, retry, and the guard overrides metal.platform-kit.org/ignore-window and metal.platform-kit.org/override-cluster-guard. So an approver can also lift these guards. The guard-lift policy makes the value name the approver.
pk-metal-oncall (ClusterRole)
What the runbooks do. Read each pk-metal kind and the events. Delete operations and rollouts, patch claims, Hosts, Assets and clusters. It has no patch on operations or rollouts, so it cannot approve. It holds no Secret. Nothing binds it by default.
pk-metal-backup (ClusterRole)
Read backup policies and snapshots, and ask for a snapshot now. It holds no Secret and cannot decrypt a backup. Nothing binds it by default.
A holder of create on operations. A holder of pk-metal-approver approves.
A person on call usually holds pk-metal-oncall and pk-metal-approver. With selfApproval: Forbidden, the admission policies stop them from approving their own proposal. With Allowed, they can propose and approve alone. See Set up approval permissions.
The admin group is pk-metal:admins. It comes from the ConfigMap hostoperation-approval in pk-metal.
Kubernetes has no group objects. A ClusterRoleBinding to a group gives permissions to the members of the group. It does not make a person a member.
The API server takes your groups from your credential:
Credential
Where the group comes from
Client certificate
Each O= of the subject is a group. Issue the certificate with O=pk-metal:admins.
OIDC token
The groups claim of your identity provider. Put the person in a group with the name pk-metal:admins, or add a prefix and set that name in the ConfigMap.
Impersonation
kubectl --as=<you> --as-group=pk-metal:admins. You need the impersonate verb on users and groups. The virtual lab uses this: mise run lab:apply.