Documentation ¶
Index ¶
- Constants
- func CSIExternalAttacherV2Supported(version string) bool
- func CSIExternalResizerSupported(version string) bool
- func CSIV1Supported(version string) bool
- func GetFirstAddress(addresses []corev1.NodeAddress) string
- func GetNodeIPs(nodes []corev1.Node) []string
- func GetNodeInternalIP(addresses []corev1.NodeAddress) string
- func HasCSIDriverKind(dc kdiscovery.DiscoveryInterface) (bool, error)
- func NodeList() *corev1.NodeList
- func NodeV2Image(image string) bool
- type Deployment
Constants ¶
const ( // SchedulerExtenderName is the name of StorageOS scheduler. SchedulerExtenderName = "storageos-scheduler" // IntreeProvisionerName is the name of the k8s native provisioner. IntreeProvisionerName = "kubernetes.io/storageos" // CSIProvisionerName is the name of the CSI provisioner. CSIProvisionerName = "storageos" // StorageOSProvisionerName is the new CSI provisioner name. StorageOSProvisionerName = "csi.storageos.com" )
const ( DaemonsetSA = "storageos-daemonset-sa" StatefulsetSA = "storageos-statefulset-sa" CSIHelperSA = "storageos-csi-helper-sa" SchedulerSA = "storageos-scheduler-sa" CSIProvisionerClusterRoleName = "storageos:csi-provisioner" CSIProvisionerClusterBindingName = "storageos:csi-provisioner" CSIAttacherClusterRoleName = "storageos:csi-attacher" CSIAttacherClusterBindingName = "storageos:csi-attacher" CSIResizerClusterRoleName = "storageos:csi-resizer" CSIResizerClusterBindingName = "storageos:csi-resizer" CSIDriverRegistrarClusterRoleName = "storageos:driver-registrar" CSIDriverRegistrarClusterBindingName = "storageos:driver-registrar" CSIK8SDriverRegistrarClusterBindingName = "storageos:k8s-driver-registrar" // OpenShift Security Context Constraints role and role binding names. OpenShiftSCCClusterRoleName = "storageos:openshift-scc" OpenShiftSCCClusterBindingName = "storageos:openshift-scc" KeyManagementRoleName = "storageos:key-management" KeyManagementBindingName = "storageos:key-management" FencingClusterRoleName = "storageos:pod-fencer" FencingClusterBindingName = "storageos:pod-fencer" NFSClusterRoleName = "storageos:nfs-provisioner" NFSClusterBindingName = "storageos:nfs-provisioner" SchedulerClusterRoleName = "storageos:scheduler-extender" SchedulerClusterBindingName = "storageos:scheduler-extender" InitClusterRoleName = "storageos:init" InitClusterBindingName = "storageos:init" )
Exported role, binding and service account resource names.
const (
// K8SDistroOpenShift is k8s distribution name for OpenShift.
K8SDistroOpenShift = "openshift"
)
const TLSEtcdSecretName = "storageos-tls-etcd"
TLSEtcdSecretName is the name of secret resource that contains etcd TLS secrets.
Variables ¶
This section is empty.
Functions ¶
func CSIExternalAttacherV2Supported ¶
CSIExternalAttacherV2Supported returns true for k8s 1.14+.
func CSIExternalResizerSupported ¶
CSIExternalResizerSupported returns true for k8s 1.16+.
func CSIV1Supported ¶ added in v0.0.6
CSIV1Supported returns true for k8s versions that support CSI v1.
func GetFirstAddress ¶
func GetFirstAddress(addresses []corev1.NodeAddress) string
GetFirstAddress returns the first address from a slice of addresses.
func GetNodeIPs ¶
GetNodeIPs returns a slice of IPs, given a slice of nodes.
func GetNodeInternalIP ¶
func GetNodeInternalIP(addresses []corev1.NodeAddress) string
GetNodeInternalIP the InternaIP from a slice of addresses, if it exists.
func HasCSIDriverKind ¶
func HasCSIDriverKind(dc kdiscovery.DiscoveryInterface) (bool, error)
HasCSIDriverKind checks if CSIDriver built-in resource is supported in the k8s cluster.
func NodeV2Image ¶
NodeV2Image returns true if the image tag starts with "2." "v2", or "c2".
Types ¶
type Deployment ¶
type Deployment struct {
// contains filtered or unexported fields
}
Deployment stores all the resource configuration and performs resource creation and update.
func NewDeployment ¶
func NewDeployment( client client.Client, discoveryClient discovery.DiscoveryInterface, stos *storageosv1.StorageOSCluster, labels map[string]string, recorder record.EventRecorder, scheme *runtime.Scheme, version string, update bool) *Deployment
NewDeployment creates a new Deployment given a k8c client, storageos manifest and an event broadcast recorder.
func (*Deployment) Delete ¶ added in v0.0.9
func (s *Deployment) Delete() error
Delete deletes all the storageos resources. This explicit delete is implemented instead of depending on the garbage collector because sometimes the garbage collector deletes the resources with owner reference as a CRD without the parent being deleted. This happens especially when a cluster reboots. Althrough the operator re-creates the resources, we want to avoid this behavior by implementing an explcit delete.
func (*Deployment) Deploy ¶
func (s *Deployment) Deploy() error
Deploy deploys storageos by creating all the resources needed to run storageos.