v1beta1

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package v1beta1 contains API Schema definitions for the pmem-csi v1beta1 API group +groupName=pmem-csi.intel.com

Index

Constants

View Source
const (
	// EventReasonNew new driver deployment found
	EventReasonNew = "NewDeployment"
	// EventReasonRunning driver has been successfully deployed
	EventReasonRunning = "Running"
	// EventReasonFailed driver deployment failed, Event.Message holds detailed information
	EventReasonFailed = "Failed"
)
View Source
const (
	// DefaultLogLevel default logging level used for the driver
	DefaultLogLevel = uint16(3)
	// DefaultImagePullPolicy default image pull policy for all the images used by the deployment
	DefaultImagePullPolicy = corev1.PullIfNotPresent

	// DefaultDriverImage default PMEM-CSI driver docker image
	DefaultDriverImage = defaultDriverImageName + ":" + defaultDriverImageTag

	// DefaultProvisionerImage default external provisioner image to use
	DefaultProvisionerImage = "registry.k8s.io/sig-storage/csi-provisioner:v3.2.1"

	// DefaultRegistrarImage default node driver registrar image to use
	DefaultRegistrarImage = "registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.5.1"

	// DefaultControllerResourceRequestCPU default CPU resource request used for controller driver container
	DefaultControllerResourceRequestCPU = "12m"
	// DefaultControllerResourceRequestMemory default memory resource request used for controller driver container
	DefaultControllerResourceRequestMemory = "128Mi"

	// DefaultNodeResourceRequestCPU default CPU resource request used for node driver container
	DefaultNodeResourceRequestCPU = "100m"
	// DefaultNodeResourceRequestMemory default memory resource request used for node driver container
	DefaultNodeResourceRequestMemory = "250Mi"

	// DefaultNodeRegistrarRequestCPU default CPU resource request used for node registrar container
	DefaultNodeRegistrarRequestCPU = "12m"
	// DefaultNodeRegistrarRequestMemory default memory resource request used for node registrar container
	DefaultNodeRegistrarRequestMemory = "128Mi"

	// DefaultProvisionerRequestCPU default CPU resource request used for provisioner container
	DefaultProvisionerRequestCPU = "12m"
	// DefaultProvisionerRequestMemory default memory resource request used for node registrar container
	DefaultProvisionerRequestMemory = "128Mi"

	// DefaultDeviceMode default device manger used for deployment
	DefaultDeviceMode = DeviceModeLVM
	// DefaultPMEMPercentage PMEM space to reserve for the driver
	DefaultPMEMPercentage = 100
	// DefaultKubeletDir default kubelet's path
	DefaultKubeletDir = "/var/lib/kubelet"
)
View Source
const (
	// TLSSecretCA is the CA bundle.
	TLSSecretCA = "ca.crt"
	// TLSSecretKey is the secret key to be used by the server.
	TLSSecretKey = "tls.key"
	// TLSSecretCert is the public key to used by the server.
	TLSSecretCert = "tls.crt"
)

A TLS secret must contain three data items.

View Source
const (
	// ControllerTLSSecretOpenshift is a special string which
	// enables the usage of
	// https://docs.openshift.com/container-platform/4.6/security/certificates/service-serving-certificate.html
	// to create certificates.
	ControllerTLSSecretOpenshift = "-openshift-"
)

Variables

View Source
var (
	// SchemeGroupVersion is group version used to register these objects
	SchemeGroupVersion = schema.GroupVersion{Group: "pmem-csi.intel.com", Version: "v1beta1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}
)
View Source
var (
	// DefaultNodeSelector default node label used for node selection
	DefaultNodeSelector = map[string]string{"storage": "pmem"}
)

Functions

This section is empty.

Types

type DeploymentCondition

type DeploymentCondition struct {
	// Type of condition.
	Type DeploymentConditionType `json:"type"`
	// Status of the condition, one of True, False, Unknown.
	Status corev1.ConditionStatus `json:"status"`
	// Message human readable text that explain why this condition is in this state
	Reason string `json:"reason,omitempty"`
	// Last time the condition was probed.
	// +nullable
	LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty"`
}

+k8s:deepcopy-gen=true

func (*DeploymentCondition) DeepCopy

func (in *DeploymentCondition) DeepCopy() *DeploymentCondition

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeploymentCondition.

func (*DeploymentCondition) DeepCopyInto

func (in *DeploymentCondition) DeepCopyInto(out *DeploymentCondition)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DeploymentConditionType

type DeploymentConditionType string

DeploymentConditionType type for representing a deployment status condition

const (
	// DriverDeployed means that the all the sub-resources required for the deployment CR
	// got created
	DriverDeployed DeploymentConditionType = "DriverDeployed"
)

type DeploymentPhase

type DeploymentPhase string

DeploymentPhase represents the status phase of a driver deployment

const (
	// DeploymentPhaseNew indicates a new deployment
	DeploymentPhaseNew DeploymentPhase = ""
	// DeploymentPhaseRunning indicates that the deployment was successful
	DeploymentPhaseRunning DeploymentPhase = "Running"
	// DeploymentPhaseFailed indicates that the deployment was failed
	DeploymentPhaseFailed DeploymentPhase = "Failed"
)

type DeploymentSpec

type DeploymentSpec struct {

	// PMEM-CSI driver container image
	Image string `json:"image,omitempty"`
	// PullPolicy image pull policy one of Always, Never, IfNotPresent
	PullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`
	// ProvisionerImage CSI provisioner sidecar image
	ProvisionerImage string `json:"provisionerImage,omitempty"`
	// NodeRegistrarImage CSI node driver registrar sidecar image
	NodeRegistrarImage string `json:"nodeRegistrarImage,omitempty"`
	// ProvisionerResources Compute resources required by provisioner sidecar container
	ProvisionerResources *corev1.ResourceRequirements `json:"provisionerResources,omitempty"`
	// NodeRegistrarResources Compute resources required by node registrar sidecar container
	NodeRegistrarResources *corev1.ResourceRequirements `json:"nodeRegistrarResources,omitempty"`
	// NodeDriverResources Compute resources required by driver container running on worker nodes
	NodeDriverResources *corev1.ResourceRequirements `json:"nodeDriverResources,omitempty"`
	// ControllerDriverResources Compute resources required by central driver container
	ControllerDriverResources *corev1.ResourceRequirements `json:"controllerDriverResources,omitempty"`
	// ControllerTLSSecret used to be the name of a secret which contains ca.crt, tls.crt and tls.key data
	// for the scheduler extender and pod mutation webhook. It is now unused.
	//
	// DEPRECATED
	DeprecatedControllerTLSSecret string `json:"controllerTLSSecret,omitempty"`
	// ControllerReplicas determines how many copys of the controller Pod run concurrently.
	// Zero (= unset) selects the builtin default, which is currently 1.
	// +kubebuilder:validation:Minimum=0
	ControllerReplicas int `json:"controllReplicas,omitempty"`
	// MutatePod defines how a mutating pod webhook is configured if a controller
	// is started. The field is ignored if the controller is not enabled.
	// The default is "Try".
	//
	// DEPRECATED
	// +kubebuilder:validation:Enum=Always;Try;Never
	DeprecatedMutatePods MutatePods `json:"mutatePods,omitempty"`
	// SchedulerNodePort, if non-zero, ensures that the "scheduler" service
	// is created as a NodeService with that fixed port number. Otherwise
	// that service is created as a cluster service. The number must be
	// from the range reserved by Kubernetes for
	// node ports. This is useful if the kube-scheduler cannot reach the scheduler
	// extender via a cluster service.
	//
	// DEPRECATED
	DeprecatedSchedulerNodePort int32 `json:"schedulerNodePort,omitempty"`
	// DeviceMode to use to manage PMEM devices.
	// +kubebuilder:validation:Enum=lvm;direct
	DeviceMode DeviceMode `json:"deviceMode,omitempty"`
	// LogLevel number for the log verbosity
	LogLevel uint16 `json:"logLevel,omitempty"`
	// LogFormat
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Enum=text;json
	LogFormat LogFormat `json:"logFormat,omitempty"`
	// NodeSelector node labels to use for selection of driver node
	NodeSelector map[string]string `json:"nodeSelector,omitempty"`
	// PMEMPercentage represents the percentage of space to be used by the driver in each PMEM region
	// on every node. Unset (= zero) selects the default of 100%.
	// This is only valid for driver in LVM mode.
	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:validation:Maximum=100
	PMEMPercentage uint16 `json:"pmemPercentage,omitempty"`
	// Labels contains additional labels for all objects created by the operator.
	Labels map[string]string `json:"labels,omitempty"`
	// KubeletDir kubelet's root directory path
	KubeletDir string `json:"kubeletDir,omitempty"`
	// DaemonSets use the default RollingUpdate strategy with at most 1 node
	// not having a running driver pod. That limit can be increased with
	// this setting, either with a higher integer or a percentage.
	MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"`
}

+k8s:deepcopy-gen=true DeploymentSpec defines the desired state of Deployment

func (*DeploymentSpec) DeepCopy

func (in *DeploymentSpec) DeepCopy() *DeploymentSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeploymentSpec.

func (*DeploymentSpec) DeepCopyInto

func (in *DeploymentSpec) DeepCopyInto(out *DeploymentSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DeploymentStatus

type DeploymentStatus struct {

	// Phase indicates the state of the deployment
	Phase  DeploymentPhase `json:"phase,omitempty"`
	Reason string          `json:"reason,omitempty"`
	// Conditions
	Conditions []DeploymentCondition `json:"conditions,omitempty"`
	Components []DriverStatus        `json:"driverComponents,omitempty"`
	// LastUpdated time of the deployment status
	// +nullable
	LastUpdated metav1.Time `json:"lastUpdated,omitempty"`
}

DeploymentStatus defines the observed state of Deployment

func (*DeploymentStatus) DeepCopy

func (in *DeploymentStatus) DeepCopy() *DeploymentStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeploymentStatus.

func (*DeploymentStatus) DeepCopyInto

func (in *DeploymentStatus) DeepCopyInto(out *DeploymentStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DeviceMode

type DeviceMode string

DeviceMode type decleration for allowed driver device managers

const (
	// DeviceModeLVM represents 'lvm' device manager
	DeviceModeLVM DeviceMode = "lvm"
	// DeviceModeDirect represents 'direct' device manager
	DeviceModeDirect DeviceMode = "direct"
	// DeviceModeFake represents a device manager for testing:
	// volume creation and deletion is just recorded in memory,
	// without any actual backing store. Such fake volumes cannot
	// be used for pods.
	DeviceModeFake DeviceMode = "fake"
)

+kubebuilder:validation:Enum=lvm,direct

func (*DeviceMode) Set

func (mode *DeviceMode) Set(value string) error

Set sets the value

func (*DeviceMode) String

func (mode *DeviceMode) String() string

type DriverStatus

type DriverStatus struct {
	// DriverComponent represents type of the driver: controller or node
	DriverComponent string `json:"component"`
	// Status represents the state of the component; one of `Ready` or `NotReady`.
	// Component becomes `Ready` if all the instances(Pods) of the driver component
	// are in running state. Otherwise, `NotReady`.
	Status string `json:"status"`
	// Reason represents the human readable text that explains why the
	// driver is in this state.
	Reason string `json:"reason"`
	// LastUpdated time of the driver status
	// +nullable
	LastUpdated metav1.Time `json:"lastUpdated,omitempty"`
}

+k8s:deepcopy-gen=true

func (*DriverStatus) DeepCopy

func (in *DriverStatus) DeepCopy() *DriverStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DriverStatus.

func (*DriverStatus) DeepCopyInto

func (in *DriverStatus) DeepCopyInto(out *DriverStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DriverType

type DriverType int
const (
	ControllerDriver DriverType = iota
	NodeDriver
)

func (DriverType) String

func (t DriverType) String() string

type LogFormat

type LogFormat string
const (
	// LogFormatText selects logging via the traditional glog (aka klog) plain text format.
	LogFormatText LogFormat = "text"
	// LogFormatJSON selects logging via the zap JSON format.
	LogFormatJSON LogFormat = "json"
)

type MutatePods

type MutatePods string
const (
	// MutatePodsAlways enables the mutating pod webhook so that a failure is considered fatal.
	MutatePodsAlways MutatePods = "Always"

	// MutatePodsTry enables the mutating pod webhook so that it a pod can be created even
	// when the webhook fails.
	MutatePodsTry MutatePods = "Try"

	// MutatePodsNever disables the mutating pod webhook.
	MutatePodsNever MutatePods = "Never"
)

type PmemCSIDeployment

type PmemCSIDeployment struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   DeploymentSpec   `json:"spec,omitempty"`
	Status DeploymentStatus `json:"status,omitempty"`
}

PmemCSIDeployment is the Schema for the deployments API +kubebuilder:subresource:status +kubebuilder:resource:path=pmemcsideployments,scope=Cluster,shortName=pcd,singular=pmemcsideployment +kubebuilder:printcolumn:name="DeviceMode",type=string,JSONPath=`.spec.deviceMode` +kubebuilder:printcolumn:name="NodeSelector",type=string,JSONPath=`.spec.nodeSelector` +kubebuilder:printcolumn:name="Image",type=string,JSONPath=`.spec.image` +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.phase` +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` +kubebuilder:storageversion

func (*PmemCSIDeployment) CSIDriverName

func (d *PmemCSIDeployment) CSIDriverName() string

CSIDriverName returns the name of the CSIDriver object name for the deployment

func (*PmemCSIDeployment) ControllerDriverName

func (d *PmemCSIDeployment) ControllerDriverName() string

ControllerDriverName returns the name of the controller StatefulSet object name used by the deployment

func (*PmemCSIDeployment) DeepCopy

func (in *PmemCSIDeployment) DeepCopy() *PmemCSIDeployment

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PmemCSIDeployment.

func (*PmemCSIDeployment) DeepCopyInto

func (in *PmemCSIDeployment) DeepCopyInto(out *PmemCSIDeployment)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*PmemCSIDeployment) DeepCopyObject

func (in *PmemCSIDeployment) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*PmemCSIDeployment) EnsureDefaults

func (d *PmemCSIDeployment) EnsureDefaults(operatorImage string) error

EnsureDefaults make sure that the deployment object has all defaults set properly

func (*PmemCSIDeployment) GetControllerReplicas added in v1.0.0

func (d *PmemCSIDeployment) GetControllerReplicas() int

GetControllerReplicas returns a non-zero replica number for the controller.

func (*PmemCSIDeployment) GetHyphenedName

func (d *PmemCSIDeployment) GetHyphenedName() string

GetHyphenedName returns the name of the deployment with dots replaced by hyphens. Most objects created for the deployment will use hyphens in the name, sometimes with an additional suffix like -controller, but others must use the original name (like the CSIDriver object).

func (*PmemCSIDeployment) GetOwnerReference

func (d *PmemCSIDeployment) GetOwnerReference() metav1.OwnerReference

GetOwnerReference returns self owner reference could be used by other object to add this deployment to it's owner reference list.

func (*PmemCSIDeployment) MetricsServiceName

func (d *PmemCSIDeployment) MetricsServiceName() string

MetricsServiceName returns the name of the controller metrics Service object used by the deployment

func (*PmemCSIDeployment) NodeDriverName

func (d *PmemCSIDeployment) NodeDriverName() string

NodeDriverName returns the name of the driver DaemonSet object name used by the deployment

func (*PmemCSIDeployment) NodeOpenShiftRoleBindingName added in v1.0.0

func (d *PmemCSIDeployment) NodeOpenShiftRoleBindingName() string

ProvisionerRoleBindingName returns the name of the node driver's RoleBinding object name for OpenShift

func (*PmemCSIDeployment) NodeSetupClusterRoleBindingName added in v1.0.0

func (d *PmemCSIDeployment) NodeSetupClusterRoleBindingName() string

NodeSetupClusterRoleBindingName returns the name of the webhooks' ClusterRoleBinding object name used by the deployment

func (*PmemCSIDeployment) NodeSetupClusterRoleName added in v1.0.0

func (d *PmemCSIDeployment) NodeSetupClusterRoleName() string

NodeSetupClusterRoleName returns the name of the webhooks' ClusterRole object name used by the deployment

func (*PmemCSIDeployment) NodeSetupName added in v1.0.0

func (d *PmemCSIDeployment) NodeSetupName() string

NodeSetupName returns the name of the node setup DaemonSet object name used by the deployment

func (*PmemCSIDeployment) NodeSetupServiceAccountName added in v1.0.0

func (d *PmemCSIDeployment) NodeSetupServiceAccountName() string

NodeSetupServiceAccountName returns the name of the service account used by the StatefulSet with the webhooks.

func (*PmemCSIDeployment) ProvisionerClusterRoleBindingName

func (d *PmemCSIDeployment) ProvisionerClusterRoleBindingName() string

ProvisionerClusterRoleBindingName returns the name of the provisioner ClusterRoleBinding object name used by the deployment

func (*PmemCSIDeployment) ProvisionerClusterRoleName

func (d *PmemCSIDeployment) ProvisionerClusterRoleName() string

ProvisionerClusterRoleName returns the name of the provisioner's ClusterRole object name used by the deployment

func (*PmemCSIDeployment) ProvisionerRoleBindingName

func (d *PmemCSIDeployment) ProvisionerRoleBindingName() string

ProvisionerRoleBindingName returns the name of the provisioner's RoleBinding object name used by the deployment

func (*PmemCSIDeployment) ProvisionerRoleName

func (d *PmemCSIDeployment) ProvisionerRoleName() string

ProvisionerRoleName returns the name of the provisioner's RBAC Role object name used by the deployment

func (*PmemCSIDeployment) ProvisionerServiceAccountName

func (d *PmemCSIDeployment) ProvisionerServiceAccountName() string

NodeServiceAccountName returns the name of the service account used by the DaemonSet with the external-provisioner

func (*PmemCSIDeployment) SetCondition

func (d *PmemCSIDeployment) SetCondition(t DeploymentConditionType, state corev1.ConditionStatus, reason string)

func (*PmemCSIDeployment) SetDriverStatus

func (d *PmemCSIDeployment) SetDriverStatus(t DriverType, status, reason string)

func (*PmemCSIDeployment) WebhooksClusterRoleBindingName

func (d *PmemCSIDeployment) WebhooksClusterRoleBindingName() string

WebhooksClusterRoleBindingName returns the name of the webhooks' ClusterRoleBinding object name used by the deployment

func (*PmemCSIDeployment) WebhooksClusterRoleName

func (d *PmemCSIDeployment) WebhooksClusterRoleName() string

WebhooksClusterRoleName returns the name of the webhooks' ClusterRole object name used by the deployment

func (*PmemCSIDeployment) WebhooksRoleBindingName

func (d *PmemCSIDeployment) WebhooksRoleBindingName() string

WebhooksRoleBindingName returns the name of the webhooks' RoleBinding object name used by the deployment

func (*PmemCSIDeployment) WebhooksRoleName

func (d *PmemCSIDeployment) WebhooksRoleName() string

WebhooksRoleName returns the name of the webhooks' RBAC Role object name used by the deployment

func (*PmemCSIDeployment) WebhooksServiceAccountName

func (d *PmemCSIDeployment) WebhooksServiceAccountName() string

WebhooksServiceAccountName returns the name of the service account used by the StatefulSet with the webhooks.

func (*PmemCSIDeployment) WebhooksServiceName added in v1.0.0

func (d *PmemCSIDeployment) WebhooksServiceName() string

SchedulerServiceName returns the name of the controller's Service object for the webhooks.

type PmemCSIDeploymentList

type PmemCSIDeploymentList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []PmemCSIDeployment `json:"items"`
}

PmemCSIDeploymentList contains a list of PmemCSIDeployment objects

func (*PmemCSIDeploymentList) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PmemCSIDeploymentList.

func (*PmemCSIDeploymentList) DeepCopyInto

func (in *PmemCSIDeploymentList) DeepCopyInto(out *PmemCSIDeploymentList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*PmemCSIDeploymentList) DeepCopyObject

func (in *PmemCSIDeploymentList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL