Custom resources¶
Every field of every custom resource Protem defines, with its type, whether it is required, its default, allowed values and constraints. Generated from the CRDs in config/crd/bases.
AccessGrant¶
- API version:
protem.dev/v1alpha1 - Scope: Namespaced
- Resource names:
accessgrants,agrant
AccessGrant represents an active, time-bound access lease for a user.
| Field | Type | Required | Default | Enum | Constraints | Description |
|---|---|---|---|---|---|---|
spec |
object | no | AccessGrant core spec is immutable after creation | AccessGrantSpec defines the immutable lease snapshot and revocation state. | ||
spec.clusters |
[]string | no | Clusters targeted by this grant | |||
spec.expiresAt |
string (date-time) | yes | ExpiresAt is the absolute time when access elevation expires | |||
spec.namespaces |
[]string | no | Namespaces targeted by this grant | |||
spec.profileRef |
string | yes | ProfileRef is the name of the AccessProfile in the same namespace | |||
spec.requestRef |
string | yes | RequestRef is the name of the AccessRequest in the same namespace | |||
spec.requester |
object | yes | Requester is the snapshot of the user identity | |||
spec.requester.email |
string | yes | ||||
spec.requester.groups |
[]string | no | ||||
spec.requester.username |
string | yes | ||||
spec.revocation |
object | no | Revocation is set when access is revoked early; presence indicates revoked state | |||
spec.revocation.at |
string (date-time) | yes | At is the timestamp when revocation took effect | |||
spec.revocation.by |
string | no | By is the identity that revoked the elevation | |||
spec.revocation.reason |
string | no | Reason explains why elevation was revoked | |||
spec.role |
object | yes | Role snapshot to bind | |||
spec.role.kind |
string | yes | "Role", "ClusterRole" |
Kind is either "Role" or "ClusterRole" | ||
spec.role.name |
string | yes | Name is the name of the Role or ClusterRole | |||
spec.scope |
string | yes | "Namespaced", "Cluster" |
Scope indicates Namespaced or Cluster | ||
status |
object | no | AccessGrantStatus defines the observed state of AccessGrant. | |||
status.clusters |
[]object | no | Clusters tracks per-cluster enforcement state in multi-cluster environments | |||
status.clusters[].bindings |
[]object | no | ||||
status.clusters[].bindings[].kind |
string | yes | ||||
status.clusters[].bindings[].name |
string | yes | ||||
status.clusters[].bindings[].namespace |
string | no | ||||
status.clusters[].clusterName |
string | yes | ||||
status.clusters[].lastTransitionTime |
string (date-time) | no | ||||
status.clusters[].message |
string | no | ||||
status.clusters[].state |
string | yes | "Pending", "Active", "Revoked", "Failed" |
ClusterBindingStatePhase defines the phase of a binding on a specific cluster. | ||
status.conditions |
[]object | no | Conditions represent observations of the grant state | |||
status.conditions[].lastTransitionTime |
string (date-time) | yes | lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. | |||
status.conditions[].message |
string | yes | max length 32768 | message is a human readable message indicating details about the transition. This may be an empty string. | ||
status.conditions[].observedGeneration |
integer (int64) | no | minimum 0 | observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. | ||
status.conditions[].reason |
string | yes | pattern ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$; min length 1; max length 1024 |
reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. | ||
status.conditions[].status |
string | yes | "True", "False", "Unknown" |
status of the condition, one of True, False, Unknown. | ||
status.conditions[].type |
string | yes | pattern ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$; max length 316 |
type of condition in CamelCase or in foo.example.com/CamelCase. | ||
status.managedBindings |
[]object | no | ManagedBindings tracks created bindings on the local cluster | |||
status.managedBindings[].kind |
string | yes | ||||
status.managedBindings[].name |
string | yes | ||||
status.managedBindings[].namespace |
string | no | ||||
status.phase |
string | no | "Active", "Expired", "Revoked" |
Phase is Active, Expired, or Revoked |
AccessProfile¶
- API version:
protem.dev/v1alpha1 - Scope: Namespaced
- Resource names:
accessprofiles,aprofile
AccessProfile defines an eligible privileged role and its multi-cluster approval policy.
| Field | Type | Required | Default | Enum | Constraints | Description |
|---|---|---|---|---|---|---|
spec |
object | no | Cluster scoped profiles require role.kind=ClusterRole; namespaces is required when scope is Namespaced; requesters must name at least one group or user; clusters must specify exactly one of selector or names; duration.default must be less than or equal to duration.max; duration.default must be greater than zero | AccessProfileSpec defines the desired state of AccessProfile. | ||
spec.approval |
object | yes | Approval rules and workflow | |||
spec.approval.pendingTimeout |
string | no | PendingTimeout defines when an unapproved request expires (e.g. 24h) | |||
spec.approval.rules |
[]object | yes | min items 1 | Rules evaluated in order; first match per target cluster governs | ||
spec.approval.rules[].allowSelfApproval |
boolean | no | false |
AllowSelfApproval permits a requester in an approver group to approve their own request | ||
spec.approval.rules[].approvers |
object | no | Approvers specifies who can approve this rule | |||
spec.approval.rules[].approvers.groups |
[]string | no | Groups of approvers | |||
spec.approval.rules[].approvers.users |
[]string | no | Specific approver usernames/emails | |||
spec.approval.rules[].maxDuration |
string | no | MaxDuration can tighten the maximum duration for this rule | |||
spec.approval.rules[].mode |
string | yes | "Auto", "Manual" |
Mode determines if elevation is self-service (Auto) or requires approval (Manual) | ||
spec.approval.rules[].name |
string | yes | Name uniquely identifies this rule | |||
spec.approval.rules[].requiredApprovals |
integer | no | 1 |
RequiredApprovals is the number of distinct approvals needed (default 1) | ||
spec.approval.rules[].when |
object | no | When conditions under which this rule applies | |||
spec.approval.rules[].when.clusterSelector |
object | no | ClusterSelector matches target cluster labels | |||
spec.approval.rules[].when.clusterSelector.matchExpressions |
[]object | no | matchExpressions is a list of label selector requirements. The requirements are ANDed. | |||
spec.approval.rules[].when.clusterSelector.matchExpressions[].key |
string | yes | key is the label key that the selector applies to. | |||
spec.approval.rules[].when.clusterSelector.matchExpressions[].operator |
string | yes | operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. | |||
spec.approval.rules[].when.clusterSelector.matchExpressions[].values |
[]string | no | values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. | |||
spec.approval.rules[].when.clusterSelector.matchLabels |
map[string]string | no | matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. | |||
spec.approval.rules[].when.requesterGroups |
[]string | no | RequesterGroups matches requester groups | |||
spec.approval.rules[].when.requesterUsers |
[]string | no | RequesterUsers matches requester usernames or emails | |||
spec.clusters |
object | yes | Clusters specifies targeted fleet clusters (either selector or names) | |||
spec.clusters.names |
[]string | no | Names explicitly lists target cluster names | |||
spec.clusters.selector |
object | no | Selector dynamically matches target clusters by label | |||
spec.clusters.selector.matchExpressions |
[]object | no | matchExpressions is a list of label selector requirements. The requirements are ANDed. | |||
spec.clusters.selector.matchExpressions[].key |
string | yes | key is the label key that the selector applies to. | |||
spec.clusters.selector.matchExpressions[].operator |
string | yes | operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. | |||
spec.clusters.selector.matchExpressions[].values |
[]string | no | values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. | |||
spec.clusters.selector.matchLabels |
map[string]string | no | matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. | |||
spec.description |
string | no | ||||
spec.displayName |
string | yes | ||||
spec.duration |
object | yes | Duration constraints | |||
spec.duration.default |
string | yes | Default duration granted if requester does not specify | |||
spec.duration.max |
string | yes | Maximum allowable duration | |||
spec.justification |
object | yes | Justification requirements | |||
spec.justification.reason |
string | yes | "Required" |
"Required", "Optional" |
Reason requirement policy | |
spec.justification.ticketPattern |
string | no | TicketPattern is an optional regex pattern validating ticket IDs (e.g. ^(INC|OPS)-[0-9]+$) | |||
spec.namespaces |
[]string | no | Namespaces permitted for elevation (required iff Scope is Namespaced) | |||
spec.requesters |
object | yes | Requesters permitted to request this profile | |||
spec.requesters.groups |
[]string | no | Groups allowed to request this profile | |||
spec.requesters.users |
[]string | no | Users (usernames or emails) allowed to request this profile | |||
spec.role |
object | yes | Role is the target Role or ClusterRole | |||
spec.role.kind |
string | yes | "Role", "ClusterRole" |
Kind is either "Role" or "ClusterRole" | ||
spec.role.name |
string | yes | Name is the name of the Role or ClusterRole | |||
spec.scope |
string | yes | "Namespaced" |
"Namespaced", "Cluster" |
Scope is either Namespaced or Cluster | |
status |
object | no | AccessProfileStatus defines the observed state of AccessProfile. | |||
status.activeGrantsCount |
integer | no | ||||
status.conditions |
[]object | no | Conditions represent observations of the profile's readiness | |||
status.conditions[].lastTransitionTime |
string (date-time) | yes | lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. | |||
status.conditions[].message |
string | yes | max length 32768 | message is a human readable message indicating details about the transition. This may be an empty string. | ||
status.conditions[].observedGeneration |
integer (int64) | no | minimum 0 | observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. | ||
status.conditions[].reason |
string | yes | pattern ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$; min length 1; max length 1024 |
reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. | ||
status.conditions[].status |
string | yes | "True", "False", "Unknown" |
status of the condition, one of True, False, Unknown. | ||
status.conditions[].type |
string | yes | pattern ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$; max length 316 |
type of condition in CamelCase or in foo.example.com/CamelCase. |
AccessRequest¶
- API version:
protem.dev/v1alpha1 - Scope: Namespaced
- Resource names:
accessrequests,areq
AccessRequest represents a user request for temporary privileged access.
| Field | Type | Required | Default | Enum | Constraints | Description |
|---|---|---|---|---|---|---|
spec |
object | no | AccessRequest spec is immutable after creation | AccessRequestSpec defines the requested elevation. | ||
spec.clusters |
[]string | no | Clusters requests a subset of the profile's matched clusters | |||
spec.duration |
string | no | Duration requested (optional, defaults to profile default) | |||
spec.justification |
object | no | Justification for the requested access | |||
spec.justification.reason |
string | no | Reason explains why access elevation is necessary | |||
spec.justification.ticket |
string | no | Ticket is an incident or change ticket ID (e.g. INC-1234) | |||
spec.namespaces |
[]string | no | Namespaces requests a subset of the profile's namespaces | |||
spec.profileRef |
string | yes | ProfileRef is the name of the AccessProfile in the same namespace | |||
spec.requester |
object | yes | Requester is stamped from request.userInfo by admission/operator | |||
spec.requester.email |
string | yes | ||||
spec.requester.groups |
[]string | no | ||||
spec.requester.username |
string | yes | ||||
status |
object | no | AccessRequestStatus defines the observed state of AccessRequest. | |||
status.approvals |
[]object | no | Approvals records decisions made on this request | |||
status.approvals[].at |
string (date-time) | yes | ||||
status.approvals[].comment |
string | no | ||||
status.approvals[].decision |
string | yes | "Approved", "Rejected", "Cancelled" |
ApprovalDecisionType defines whether a person approved, rejected, or cancelled a request. | ||
status.approvals[].rule |
string | no | ||||
status.approvals[].user |
string | yes | ||||
status.auditedEvents |
integer (int32) | no | AuditedEvents counts this request's audit events the operator has already written to its audit log, so each is written once and none is skipped across restarts. | |||
status.conditions |
[]object | no | Conditions represent observations of the request lifecycle | |||
status.conditions[].lastTransitionTime |
string (date-time) | yes | lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. | |||
status.conditions[].message |
string | yes | max length 32768 | message is a human readable message indicating details about the transition. This may be an empty string. | ||
status.conditions[].observedGeneration |
integer (int64) | no | minimum 0 | observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. | ||
status.conditions[].reason |
string | yes | pattern ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$; min length 1; max length 1024 |
reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. | ||
status.conditions[].status |
string | yes | "True", "False", "Unknown" |
status of the condition, one of True, False, Unknown. | ||
status.conditions[].type |
string | yes | pattern ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$; max length 316 |
type of condition in CamelCase or in foo.example.com/CamelCase. | ||
status.grantRef |
string | no | GrantRef references the provisioned AccessGrant in the same namespace | |||
status.phase |
string | no | "Pending", "Approved", "Rejected", "Cancelled", "TimedOut" |
Phase of the request workflow | ||
status.resolved |
object | no | Resolved frozen target clusters, namespaces, and duration | |||
status.resolved.clusters |
[]string | yes | Clusters frozen at request creation | |||
status.resolved.duration |
string | yes | Duration determined from request, profile max, and matched rules | |||
status.resolved.namespaces |
[]string | no | Namespaces frozen at request creation | |||
status.resolved.requirements |
[]object | no | Requirements per cluster computed from approval rules | |||
status.resolved.requirements[].allowSelfApproval |
boolean | no | ||||
status.resolved.requirements[].approverGroups |
[]string | no | ||||
status.resolved.requirements[].approverUsers |
[]string | no | ||||
status.resolved.requirements[].clusterName |
string | yes | ||||
status.resolved.requirements[].mode |
string | yes | "Auto", "Manual" |
ApprovalMode defines how an approval rule evaluates. | ||
status.resolved.requirements[].requiredApprovals |
integer | yes | ||||
status.resolved.requirements[].ruleName |
string | yes | ||||
status.resolved.role |
object | no | Role frozen at request creation; the grant binds this role, not the profile's current one | |||
status.resolved.role.kind |
string | yes | "Role", "ClusterRole" |
Kind is either "Role" or "ClusterRole" | ||
status.resolved.role.name |
string | yes | Name is the name of the Role or ClusterRole | |||
status.resolved.scope |
string | no | "Namespaced", "Cluster" |
Scope frozen at request creation |
ClusterGrant¶
- API version:
protem.dev/v1alpha1 - Scope: Namespaced
- Resource names:
clustergrants,cgrant,clgrant
ClusterGrant represents a single-cluster slice of an AccessGrant, living in protem-cluster-
| Field | Type | Required | Default | Enum | Constraints | Description |
|---|---|---|---|---|---|---|
spec |
object | no | ClusterGrantSpec defines the per-cluster elevation lease dispatched to a spoke cluster's namespace. | |||
spec.expiresAt |
string (date-time) | yes | ExpiresAt is the absolute time when access elevation expires | |||
spec.grantRef |
string | yes | GrantRef references the parent AccessGrant in its origin namespace | |||
spec.namespaces |
[]string | no | Namespaces targeted by this grant on this cluster | |||
spec.profileRef |
string | yes | ProfileRef is the AccessProfile name | |||
spec.requester |
object | yes | Requester is the snapshot of the user identity | |||
spec.requester.email |
string | yes | ||||
spec.requester.groups |
[]string | no | ||||
spec.requester.username |
string | yes | ||||
spec.revocation |
object | no | Revocation details if revoked early | |||
spec.revocation.at |
string (date-time) | yes | At is the timestamp when revocation took effect | |||
spec.revocation.by |
string | no | By is the identity that revoked the elevation | |||
spec.revocation.reason |
string | no | Reason explains why elevation was revoked | |||
spec.role |
object | yes | Role snapshot to bind | |||
spec.role.kind |
string | yes | "Role", "ClusterRole" |
Kind is either "Role" or "ClusterRole" | ||
spec.role.name |
string | yes | Name is the name of the Role or ClusterRole | |||
spec.scope |
string | yes | "Namespaced", "Cluster" |
Scope indicates Namespaced or Cluster | ||
spec.subject |
string | no | Subject is the resolved username/subject mapped for this cluster | |||
status |
object | no | ClusterGrantStatus defines the observed state reported by the spoke agent. | |||
status.bindings |
[]object | no | Bindings created on the spoke cluster | |||
status.bindings[].kind |
string | yes | ||||
status.bindings[].name |
string | yes | ||||
status.bindings[].namespace |
string | no | ||||
status.lastTransitionTime |
string (date-time) | no | LastTransitionTime timestamp of last status change | |||
status.message |
string | no | Message describes error or enforcement status from spoke | |||
status.phase |
string | no | "Pending", "Active", "Expired", "Revoked", "Failed" |
Phase is Pending, Active, Expired, Revoked, or Failed | ||
status.rules |
[]object | no | Rules are the rules of the ClusterRole the agent bound, as read on that cluster. Empty for a namespaced Role, whose rules can differ per namespace. | |||
status.rules[].apiGroups |
[]string | no | APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of the enumerated resources in any API group will be allowed. "" represents the core API group and "*" represents all API groups. | |||
status.rules[].nonResourceURLs |
[]string | no | NonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path Since non-resource URLs are not namespaced, this field is only applicable for ClusterRoles referenced from a ClusterRoleBinding. Rules can either apply to API resources (such as "pods" or "secrets") or non-resource URL paths (such as "/api"), but not both. | |||
status.rules[].resourceNames |
[]string | no | ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. | |||
status.rules[].resources |
[]string | no | Resources is a list of resources this rule applies to. '*' represents all resources. | |||
status.rules[].verbs |
[]string | yes | Verbs is a list of Verbs that apply to ALL the ResourceKinds contained in this rule. '*' represents all verbs. |
TargetCluster¶
- API version:
protem.dev/v1alpha1 - Scope: Cluster
- Resource names:
targetclusters,tcluster
TargetCluster represents a managed spoke Kubernetes cluster registered with the Protem fleet Hub.
| Field | Type | Required | Default | Enum | Constraints | Description |
|---|---|---|---|---|---|---|
spec |
object | no | TargetClusterSpec defines the desired configuration and connection settings for a cluster. | |||
spec.description |
string | no | ||||
spec.displayName |
string | yes | ||||
spec.enforcement |
string | no | "RoleBinding" |
"RoleBinding", "Authorizer" |
Enforcement selects the enforcement mechanism on this cluster (default: RoleBinding) | |
spec.paused |
boolean | no | false |
Paused suspends new elevation leases on this cluster for maintenance | ||
spec.subject |
string | no | "{{.Email}}" |
Subject defines the username mapping template on this cluster (e.g. {{.Email}} or oidc:{{.Email}}) | ||
status |
object | no | TargetClusterStatus defines the observed health and connectivity of the cluster. | |||
status.activeGrantsCount |
integer | no | ActiveGrantsCount tracks currently active leases on this cluster | |||
status.agentVersion |
string | no | AgentVersion reports the running spoke agent version | |||
status.conditions |
[]object | no | Conditions represent observations of cluster readiness and agent connectivity | |||
status.conditions[].lastTransitionTime |
string (date-time) | yes | lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. | |||
status.conditions[].message |
string | yes | max length 32768 | message is a human readable message indicating details about the transition. This may be an empty string. | ||
status.conditions[].observedGeneration |
integer (int64) | no | minimum 0 | observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. | ||
status.conditions[].reason |
string | yes | pattern ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$; min length 1; max length 1024 |
reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. | ||
status.conditions[].status |
string | yes | "True", "False", "Unknown" |
status of the condition, one of True, False, Unknown. | ||
status.conditions[].type |
string | yes | pattern ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$; max length 316 |
type of condition in CamelCase or in foo.example.com/CamelCase. | ||
status.lastHeartbeat |
string (date-time) | no | LastHeartbeat timestamp of last contact from spoke agent | |||
status.phase |
string | no | "Ready", "Disconnected", "Maintenance" |
Phase is Ready, Disconnected, or Maintenance |