csi

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
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"
)

Variables

View Source
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"
)
View Source
var (
	// image names
	DefaultCSIPluginImage   = "quay.io/cephcsi/cephcsi:v1.2.1"
	DefaultRegistrarImage   = "quay.io/k8scsi/csi-node-driver-registrar:v1.1.0"
	DefaultProvisionerImage = "quay.io/k8scsi/csi-provisioner:v1.3.0"
	DefaultAttacherImage    = "quay.io/k8scsi/csi-attacher:v1.2.0"
	DefaultSnapshotterImage = "quay.io/k8scsi/csi-snapshotter:v1.2.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 CreateCsiConfigMap added in v1.1.0

func CreateCsiConfigMap(namespace string, clientset kubernetes.Interface) error

CreateCsiConfigMap creates an empty config map that will be later used to provide cluster configuration to ceph-csi.

func FormatCsiClusterConfig added in v1.1.0

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 added in v1.1.0

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 StartCSIDrivers(namespace string, clientset kubernetes.Interface, ver *version.Info) error

func UpdateCsiClusterConfig added in v1.1.0

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
	EnableCSIGRPCMetrics string
	KubeletDirPath       string
}

Jump to

Keyboard shortcuts

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