csi

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2019 License: Apache-2.0 Imports: 22 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"

	// grpc metrics and liveness port for cephfs  and rbd
	DefaultCephFSGRPCMerticsPort     uint16 = 9091
	DefaultCephFSLivenessMerticsPort uint16 = 9081
	DefaultRBDGRPCMerticsPort        uint16 = 9090
	DefaultRBDLivenessMerticsPort    uint16 = 9080
)

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

func CreateCSISecrets(context *clusterd.Context, clusterName string, ownerRef *metav1.OwnerReference) error

CreateCSISecrets creates all the Kubernetes CSI Secrets

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
	CephFSGRPCMetricsPort     uint16
	CephFSLivenessMetricsPort uint16
	RBDGRPCMetricsPort        uint16
	RBDLivenessMetricsPort    uint16
}

Jump to

Keyboard shortcuts

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