Documentation ¶
Index ¶
- Constants
- Variables
- func CSIEnabled() bool
- func CreateCSISecrets(context *clusterd.Context, clusterName string, ownerRef *metav1.OwnerReference) error
- func CreateCsiConfigMap(namespace string, clientset kubernetes.Interface) (*v1.ConfigMap, error)
- func DeleteCsiConfigMap(namespace string, clientset kubernetes.Interface) error
- func FormatCsiClusterConfig(clusterKey string, mons map[string]*cephconfig.MonInfo) (string, error)
- func SaveClusterConfig(clientset kubernetes.Interface, clusterNamespace string, ...) error
- func StartCSIDrivers(namespace string, clientset kubernetes.Interface, ver *version.Info) error
- func StopCSIDrivers(namespace string, clientset kubernetes.Interface) error
- func UpdateCsiClusterConfig(curr, clusterKey string, mons map[string]*cephconfig.MonInfo) (string, error)
- func ValidateCSIParam() error
- type Param
Constants ¶
const ( KubeMinMajor = "1" KubeMinMinor = "13" // kubelet directory path DefaultKubeletDirPath = "/var/lib/kubelet" // template DefaultRBDPluginTemplatePath = "/etc/ceph-csi/rbd/csi-rbdplugin.yaml" DefaultRBDProvisionerSTSTemplatePath = "/etc/ceph-csi/rbd/csi-rbdplugin-provisioner-sts.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" DefaultCephFSProvisionerSTSTemplatePath = "/etc/ceph-csi/cephfs/csi-cephfsplugin-provisioner-sts.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 //driver names CephFSDriverName string RBDDriverName string // template paths RBDPluginTemplatePath string RBDProvisionerSTSTemplatePath string RBDProvisionerDepTemplatePath string CephFSPluginTemplatePath string CephFSProvisionerSTSTemplatePath 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:v1.2.2" DefaultRegistrarImage = "quay.io/k8scsi/csi-node-driver-registrar:v1.1.0" DefaultProvisionerImage = "quay.io/k8scsi/csi-provisioner:v1.4.0" DefaultAttacherImage = "quay.io/k8scsi/csi-attacher:v1.2.0" DefaultSnapshotterImage = "quay.io/k8scsi/csi-snapshotter:v1.2.2" )
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 ¶
func CreateCSISecrets(context *clusterd.Context, clusterName string, ownerRef *metav1.OwnerReference) error
CreateCSISecrets creates all the Kubernetes CSI Secrets
func CreateCsiConfigMap ¶
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 DeleteCsiConfigMap ¶
func DeleteCsiConfigMap(namespace string, clientset kubernetes.Interface) error
func FormatCsiClusterConfig ¶
func FormatCsiClusterConfig( clusterKey string, mons map[string]*cephconfig.MonInfo) (string, error)
FormatCsiClusterConfig returns a json-formatted string containing the cluster-to-mon mapping required to configure ceph csi.
func SaveClusterConfig ¶
func SaveClusterConfig( clientset kubernetes.Interface, clusterNamespace string, clusterInfo *cephconfig.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 epxected 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 StartCSIDrivers ¶
func StopCSIDrivers ¶
func StopCSIDrivers(namespace string, clientset kubernetes.Interface) error
func UpdateCsiClusterConfig ¶
func UpdateCsiClusterConfig( curr, clusterKey string, mons map[string]*cephconfig.MonInfo) (string, error)
UpdateCsiClusterConfig returns a json-formatted string containing the cluster-to-mon mapping required to configure ceph csi.
func ValidateCSIParam ¶
func ValidateCSIParam() error
Types ¶
type Param ¶
type Param struct { CSIPluginImage string RegistrarImage string ProvisionerImage string AttacherImage string SnapshotterImage string DriverNamePrefix string EnableSnapshotter string EnableCSIGRPCMetrics string KubeletDirPath string ForceCephFSKernelClient string CephFSPluginUpdateStrategy string RBDPluginUpdateStrategy string CephFSGRPCMetricsPort uint16 CephFSLivenessMetricsPort uint16 RBDGRPCMetricsPort uint16 RBDLivenessMetricsPort uint16 }