Documentation ¶
Index ¶
- Constants
- Variables
- func CSIEnabled() bool
- func CreateCSISecrets(context *clusterd.Context, clusterInfo *client.ClusterInfo) error
- func CreateCsiConfigMap(namespace string, clientset kubernetes.Interface, ownerInfo *k8sutil.OwnerInfo) error
- func FormatCsiClusterConfig(clusterKey string, mons map[string]*cephclient.MonInfo) (string, error)
- func GetPodAntiAffinity(key, value string) corev1.PodAntiAffinity
- func SaveClusterConfig(clientset kubernetes.Interface, clusterNamespace string, ...) error
- func SetParams(clientset kubernetes.Interface) error
- func UpdateCsiClusterConfig(curr, clusterKey string, mons map[string]*cephclient.MonInfo) (string, error)
- func ValidateAndConfigureDrivers(context *clusterd.Context, namespace, rookImage, securityAccount string, ...)
- func ValidateCSIParam() error
- type CephCSIVersion
- type Param
Constants ¶
const ( CsiRBDNodeSecret = "rook-csi-rbd-node" CsiRBDProvisionerSecret = "rook-csi-rbd-provisioner" )
#nosec because of the word `Secret`
const ( CsiCephFSNodeSecret = "rook-csi-cephfs-node" CsiCephFSProvisionerSecret = "rook-csi-cephfs-provisioner" )
#nosec because of the word `Secret`
const ( KubeMinMajor = "1" ProvDeploymentSuppVersion = "14" // kubelet directory path DefaultKubeletDirPath = "/var/lib/kubelet" // template DefaultRBDPluginTemplatePath = "/etc/ceph-csi/rbd/csi-rbdplugin.yaml" DefaultRBDProvisionerDepTemplatePath = "/etc/ceph-csi/rbd/csi-rbdplugin-provisioner-dep.yaml" DefaultRBDPluginServiceTemplatePath = "/etc/ceph-csi/rbd/csi-rbdplugin-svc.yaml" DefaultCephFSPluginTemplatePath = "/etc/ceph-csi/cephfs/csi-cephfsplugin.yaml" DefaultCephFSProvisionerDepTemplatePath = "/etc/ceph-csi/cephfs/csi-cephfsplugin-provisioner-dep.yaml" DefaultCephFSPluginServiceTemplatePath = "/etc/ceph-csi/cephfs/csi-cephfsplugin-svc.yaml" // grpc metrics and liveness port for cephfs and rbd DefaultCephFSGRPCMerticsPort uint16 = 9091 DefaultCephFSLivenessMerticsPort uint16 = 9081 DefaultRBDGRPCMerticsPort uint16 = 9090 DefaultRBDLivenessMerticsPort uint16 = 9080 )
Variables ¶
var ( CSIParam Param EnableRBD = false EnableCephFS = false EnableCSIGRPCMetrics = false AllowUnsupported = false //driver names CephFSDriverName string RBDDriverName string // template paths RBDPluginTemplatePath string RBDProvisionerDepTemplatePath string CephFSPluginTemplatePath string CephFSProvisionerDepTemplatePath string // configuration map for csi ConfigName = "rook-ceph-csi-config" ConfigKey = "csi-cluster-config-json" )
var ( // image names DefaultCSIPluginImage = "quay.io/cephcsi/cephcsi:v3.3.1" DefaultRegistrarImage = "k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.0.1" DefaultProvisionerImage = "k8s.gcr.io/sig-storage/csi-provisioner:v2.0.4" DefaultAttacherImage = "k8s.gcr.io/sig-storage/csi-attacher:v3.0.2" DefaultSnapshotterImage = "k8s.gcr.io/sig-storage/csi-snapshotter:v4.0.0" DefaultResizerImage = "k8s.gcr.io/sig-storage/csi-resizer:v1.0.1" DefaultVolumeReplicationImage = "quay.io/csiaddons/volumereplication-operator:v0.1.0" )
Specify default images as var instead of const so that they can be overridden with the Go linker's -X flag. This allows users to easily build images with a different opinionated set of images without having to specify them manually in charts/manifests which can make upgrades more manually challenging.
Functions ¶
func CSIEnabled ¶
func CSIEnabled() bool
func CreateCSISecrets ¶ added in v1.1.3
func CreateCSISecrets(context *clusterd.Context, clusterInfo *client.ClusterInfo) error
CreateCSISecrets creates all the Kubernetes CSI Secrets
func CreateCsiConfigMap ¶ added in v1.1.0
func CreateCsiConfigMap(namespace string, clientset kubernetes.Interface, ownerInfo *k8sutil.OwnerInfo) error
CreateCsiConfigMap creates an empty config map that will be later used to provide cluster configuration to ceph-csi. If a config map already exists, it will return it.
func FormatCsiClusterConfig ¶ added in v1.1.0
func FormatCsiClusterConfig( clusterKey string, mons map[string]*cephclient.MonInfo) (string, error)
FormatCsiClusterConfig returns a json-formatted string containing the cluster-to-mon mapping required to configure ceph csi.
func GetPodAntiAffinity ¶ added in v1.4.0
func GetPodAntiAffinity(key, value string) corev1.PodAntiAffinity
Get PodAntiAffinity from a key and value pair
func SaveClusterConfig ¶ added in v1.1.0
func SaveClusterConfig( clientset kubernetes.Interface, clusterNamespace string, clusterInfo *cephclient.ClusterInfo, l sync.Locker) error
SaveClusterConfig updates the config map used to provide ceph-csi with basic cluster configuration. The clusterNamespace and clusterInfo are used to determine what "cluster" in the config map will be updated and and the clusterNamespace value is expected to match the clusterID value that is provided to ceph-csi uses in the storage class. The locker l is typically a mutex and is used to prevent the config map from being updated for multiple clusters simultaneously.
func SetParams ¶ added in v1.3.5
func SetParams(clientset kubernetes.Interface) error
func UpdateCsiClusterConfig ¶ added in v1.1.0
func UpdateCsiClusterConfig( curr, clusterKey string, mons map[string]*cephclient.MonInfo) (string, error)
UpdateCsiClusterConfig returns a json-formatted string containing the cluster-to-mon mapping required to configure ceph csi.
func ValidateAndConfigureDrivers ¶ added in v1.4.0
func ValidateCSIParam ¶
func ValidateCSIParam() error
Types ¶
type CephCSIVersion ¶ added in v1.3.0
CephCSIVersion represents the Ceph CSI version format
func (*CephCSIVersion) String ¶ added in v1.3.0
func (v *CephCSIVersion) String() string
func (*CephCSIVersion) Supported ¶ added in v1.3.0
func (v *CephCSIVersion) Supported() bool
Supported checks if the detected version is part of the known supported CSI versions
func (*CephCSIVersion) SupportsOMAPController ¶ added in v1.5.4
func (v *CephCSIVersion) SupportsOMAPController() bool
SupportsOMAPController checks if the detected version supports OMAP generator
type Param ¶
type Param struct { CSIPluginImage string RegistrarImage string ProvisionerImage string AttacherImage string SnapshotterImage string ResizerImage string DriverNamePrefix string EnableCSIGRPCMetrics string KubeletDirPath string ForceCephFSKernelClient string CephFSPluginUpdateStrategy string RBDPluginUpdateStrategy string PluginPriorityClassName string ProvisionerPriorityClassName string VolumeReplicationImage string EnableCSIHostNetwork bool EnableOMAPGenerator bool EnableRBDSnapshotter bool EnableCephFSSnapshotter bool EnableVolumeReplicationSideCar bool LogLevel uint8 CephFSGRPCMetricsPort uint16 CephFSLivenessMetricsPort uint16 RBDGRPCMetricsPort uint16 RBDLivenessMetricsPort uint16 ProvisionerReplicas uint8 CSICephFSPodLabels map[string]string CSIRBDPodLabels map[string]string }