Packages:
Package v1alpha1 contains API Schema definitions for the templates v1alpha1 API group
(Appears on:ExecAccessTemplateSpec, PodAccessTemplateSpec)
AccessConfig provides a common interface for our Template structs (which implement ITemplateResource) for defining which entities are being granted access to a resource, and for how long they are granted that access.
| Field | Description |
|---|---|
allowedGroups[]string |
AllowedGroups lists out the groups (in string name form) that will be allowed to Exec into the target pod. |
defaultDurationstring |
DefaultDuration sets the default time that an access request resource will live. Must be set below MaxDuration. Valid time units are “ns”, “us” (or “µs”), “ms”, “s”, “m”, “h”. |
maxDurationstring |
MaxDuration sets the maximum duration that an access request resource can request to stick around. Valid time units are “ns”, “us” (or “µs”), “ms”, “s”, “m”, “h”. |
accessCommandstring |
AccessCommand is used to describe to the user how they can make use of their temporary access. The AccessCommand can reference data from a Pod ObjectMeta. |
(Appears on:CrossVersionObjectReference)
ControllerKind is a string that represents an Apps/V1 known controller kind that this codebase supports. This is used to limit the inputs on the AccessTemplate and ExecAccessTemplate CRDs.
| Value | Description |
|---|---|
"DaemonSet" |
DaemonSetController maps to APIVersion: apps/v1, Kind: DaemonSet |
"Deployment" |
DeploymentController maps to APIVersion: apps/v1, Kind: Deployment |
"StatefulSet" |
StatefulSetController maps to APIVersion: apps/v1, Kind: StatfulSet |
(Appears on:ExecAccessRequestStatus, ExecAccessTemplateStatus, PodAccessRequestStatus, PodAccessTemplateStatus)
CoreStatus provides a common set of .Status fields and functions. The goal is to conform to the interfaces.OzResource interface commonly across all of our core CRDs.
| Field | Description |
|---|---|
conditions[]Kubernetes meta/v1.Condition |
Current status of the Access Template |
readybool |
Simple boolean to let us know if the resource is ready for use or not |
accessMessagestring |
AccessMessage is used to describe to the user how they can make use of their temporary access request. Eg, for a PodAccessTemplate the value set here would be something like: “Access Granted, connect to your pod with: kubectl exec -ti -n namespace pod-xyz – /bin/bash” |
(Appears on:ExecAccessTemplateSpec, PodAccessTemplateSpec)
CrossVersionObjectReference provides us a generic way to define a reference to an APIGroup, Kind and Name of a particular resource. Primarily used for the AccessTemplate and ExecAccessTemplate, but generic enough to be used in other resources down the road.
| Field | Description |
|---|---|
apiVersionstring |
Defines the “APIVersion” of the resource being referred to. Eg, “apps/v1”. TODO: Figure out how to regex validate that it has a “/” in it |
kindControllerKind |
Defines the “Kind” of resource being referred to. |
namestring |
Defines the “metadata.Name” of the target resource. |
ExecAccessRequest is the Schema for the execaccessrequests API
| Field | Description | ||||||
|---|---|---|---|---|---|---|---|
metadataKubernetes meta/v1.ObjectMeta |
Refer to the Kubernetes API documentation for the fields of the
metadata field.
|
||||||
specExecAccessRequestSpec |
|
||||||
statusExecAccessRequestStatus |
(Appears on:ExecAccessRequest)
ExecAccessRequestSpec defines the desired state of ExecAccessRequest
| Field | Description |
|---|---|
templateNamestring |
Defines the name of the |
targetPodstring |
TargetPod is used to explicitly define the target pod that the Exec privilges should be granted to. If not supplied, then a random pod is chosen. |
durationstring |
Duration sets the length of time from the If omitted, the spec.defautlDuration from the ExecAccessTemplate is used. Valid time units are “ns”, “us” (or “µs”), “ms”, “s”, “m”, “h”. |
(Appears on:ExecAccessRequest)
ExecAccessRequestStatus defines the observed state of ExecAccessRequest
| Field | Description |
|---|---|
CoreStatusCoreStatus |
(Members of |
podNamestring |
The Target Pod Name where access has been granted |
ExecAccessTemplate is the Schema for the execaccesstemplates API
| Field | Description | ||||
|---|---|---|---|---|---|
metadataKubernetes meta/v1.ObjectMeta |
Refer to the Kubernetes API documentation for the fields of the
metadata field.
|
||||
specExecAccessTemplateSpec |
|
||||
statusExecAccessTemplateStatus |
(Appears on:ExecAccessTemplate)
ExecAccessTemplateSpec defines the desired state of ExecAccessTemplate
| Field | Description |
|---|---|
accessConfigAccessConfig |
AccessConfig provides a common struct for defining who has access to the resources this template controls, how long they have access, etc. |
controllerTargetRefCrossVersionObjectReference |
ControllerTargetRef provides a pattern for referencing objects from another API in a generic way. |
(Appears on:ExecAccessTemplate)
ExecAccessTemplateStatus is the core set of status fields that we expect to be in each and every one of our template (AccessTemplate, ExecAccessTemplate, etc) resources.
| Field | Description |
|---|---|
CoreStatusCoreStatus |
(Members of |
IConditionType provides an interface for accepting any condition string that has a String() function. This simplifies the controllers/internal/status/update_status.go code to have a single UpdateStatus() function.
The ICoreResource interface wraps a standard client.Object resource (metav1.Object + runtime.Object) with a few additional requirements for common methods that we use throughout our reconciliation process.
ICoreStatus is used to define the core common status functions that all Status structs in this API must adhere to. These common functions simplify the reconciler() functions so that they can easily get/set status on the resources in a common way.
IPodRequestResource is a Pod-access specific request interface that exposes a few more functions for storing references to specific Pods that the requestor is being granted access to.
IRequestResource represents a common “AccesRequest” resource for the Oz Controller. These requests have a common set of required methods that are used by the OzRequestReconciler.
IRequestStatus is a more specific Status interface that enables getting and setting access instruction methods.
ITemplateResource represents a common “AccessTemplate” resource for the Oz Controller. These templates provide different types of access into resources (eg, “Exec” vs “Debug” vs “launch me a dedicated pod”). A set of common methods are required though that are used by the OzTemplateReconciler.
ITemplateStatus provides a more specific Status interface for Access Templates. Functionality to come in the future.
(Appears on:PodTemplateSpecMutationConfig)
JSONPatchOperation represents a JSON Patch operation defined in https://www.rfc-editor.org/rfc/rfc6902.html
| Field | Description |
|---|---|
opJSONPatchOperationType |
|
pathstring |
|
valuek8s.io/apimachinery/pkg/util/intstr.IntOrString |
(Appears on:JSONPatchOperation)
JSONPatchOperationType represents a JSON Patch operation defined in https://www.rfc-editor.org/rfc/rfc6902.html. Eg, “add”, “remove”, etc.
| Value | Description |
|---|---|
"add" |
|
"copy" |
|
"move" |
|
"remove" |
|
"replace" |
|
"test" |
PodAccessRequest is the Schema for the accessrequests API
| Field | Description | ||||
|---|---|---|---|---|---|
metadataKubernetes meta/v1.ObjectMeta |
Refer to the Kubernetes API documentation for the fields of the
metadata field.
|
||||
specPodAccessRequestSpec |
|
||||
statusPodAccessRequestStatus |
(Appears on:PodAccessRequest)
PodAccessRequestSpec defines the desired state of AccessRequest
| Field | Description |
|---|---|
templateNamestring |
Defines the name of the |
durationstring |
Duration sets the length of time from the If omitted, the spec.defautlDuration from the ExecAccessTemplate is used. Valid time units are “s”, “m”, “h”. |
(Appears on:PodAccessRequest)
PodAccessRequestStatus defines the observed state of AccessRequest
| Field | Description |
|---|---|
CoreStatusCoreStatus |
(Members of |
podNamestring |
The Target Pod Name where access has been granted |
PodAccessTemplate is the Schema for the accesstemplates API
| Field | Description | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
metadataKubernetes meta/v1.ObjectMeta |
Refer to the Kubernetes API documentation for the fields of the
metadata field.
|
||||||||||||||
specPodAccessTemplateSpec |
|
||||||||||||||
statusPodAccessTemplateStatus |
(Appears on:PodAccessTemplate)
PodAccessTemplateSpec defines the desired state of AccessTemplate
| Field | Description |
|---|---|
accessConfigAccessConfig |
AccessConfig provides a common struct for defining who has access to the resources this template controls, how long they have access, etc. |
controllerTargetRefCrossVersionObjectReference |
ControllerTargetRef provides a pattern for referencing objects from another API in a generic way. |
controllerTargetMutationConfigPodTemplateSpecMutationConfig |
ControllerTargetMutationConfig contains parameters that allow for customizing the copy of a controller-sourced PodSpec. This setting is only valid if controllerTargetRef is set. |
podSpecKubernetes core/v1.PodSpec |
PodSpec … |
maxStoragek8s.io/apimachinery/pkg/api/resource.Quantity |
Upper bound of the ephemeral storage that an AccessRequest can make against this template for the primary container. |
maxCpuk8s.io/apimachinery/pkg/api/resource.Quantity |
Upper bound of the CPU that an AccessRequest can make against this tmemplate for the primary container. |
maxMemoryk8s.io/apimachinery/pkg/api/resource.Quantity |
Upper bound of the memory that an AccessRequest can make against this template for the primary container. |
(Appears on:PodAccessTemplate)
PodAccessTemplateStatus defines the observed state of PodAccessTemplate
| Field | Description |
|---|---|
CoreStatusCoreStatus |
(Members of |
(Appears on:PodAccessTemplateSpec)
PodTemplateSpecMutationConfig provides a common pattern for describing mutations to an existing PodSpec that should be applied. The primary use case is in the PodAccessTemplate, where an existing controller (Deployment, DaemonSet, StatefulSet) can be used as the reference for the PodSpec that is launched for the user. However, the operator may want to make modifications to the PodSpec at launch time (eg, change the entrypoint command or arguments).
TODO: Add affinity
| Field | Description |
|---|---|
defaultContainerNamestring |
DefaultContainerName allows the operator to define which container is considered the default container, and that is the container that this mutation configuration applies to. If not set, then the first container defined in the spec.containers[] list is patched. |
commandstring |
Command is used to override the .Spec.containers[0].command field for the target Pod and Container. This can be handy in ensuring that the default application does not start up and do any work. If set, this overrides the Spec.conatiners[0].args property as well. |
argsstring |
Args will override the Spec.containers[0].args property. |
env[]Kubernetes core/v1.EnvVar |
Env allows overriding specific environment variables (or adding new ones). Note, we do not purge the original environmnt variables. |
resourcesKubernetes core/v1.ResourceRequirements |
If supplied these resource requirements will override the default .Spec.containers[0].resource requested for the the pod. Note though that we do not override all of the resource requests in the Pod because there may be many containers. |
podAnnotationsstring |
If supplied, these
annotations
are applied to the target
|
podLabelsstring |
If supplied, Oz will insert these
labels
into the target
|
purgeAnnotationsbool |
By default, Oz keeps the original
|
patchSpecOperations[]JSONPatchOperation |
PatchSpecOperations contains a list of JSON patch operations to apply to the PodSpec.
|
keepTerminationGracePeriodbool |
By default, Oz wipes out the PodSpec
|
keepLivenessProbebool |
By default, Oz wipes out the PodSpec
|
keepReadinessProbebool |
By default, Oz wipes out the PodSpec
|
keepStartupProbebool |
By default, Oz wipes out the PodSpec
|
keepTopologySpreadConstraintsbool |
By default, Oz wipes out the PodSpec
|
nodeSelectorstring |
If supplied, Oz will insert these
nodeSelector
into the target
|
RequestConditionTypes defines a set of known Status.Condition[].ConditionType fields that are used throughout the AccessRequest and AccessTemplate reconcilers.
| Value | Description |
|---|---|
"AccessMessage" |
ConditionAccessMessage is used to record |
"AccessResourcesCreated" |
ConditionAccessResourcesCreated indicates whether or not the target access request resources have been properly created. |
"AccessResourcesReady" |
ConditionAccessResourcesReady indicates that all of the “access resources” (eg, a Pod) are up and in the ready state. |
"AccessStillValid" |
ConditionAccessStillValid is continaully updated based on whether or not the Access Request has timed out. |
"AccessDurationsValid" |
ConditionRequestDurationsValid is used by both AccessTemplate and AccessRequest resources. It indicates whether or not the various duration fields are valid. |
"TargetTemplateExists" |
ConditionTargetTemplateExists indicates that the Access Request is pointing to a valid Access Template. |
TemplateConditionTypes defines a set of known Status.Condition[].ConditionType fields that are used throughout the AccessTemplate reconcilers and written to the ITemplateResource resources.
| Value | Description |
|---|---|
"TargetRefExists" |
ConditionTargetRefExists indicates whether or not an AccessTemplate is pointing to a valid Controller. |
"TemplateDurationsValid" |
ConditionTemplateDurationsValid is used by both AccessTemplate and AccessRequest resources. It indicates whether or not the various duration fields are valid. |
Generated with gen-crd-api-reference-docs
.