installer

package
v1.4.6 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2021 License: AGPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// quay.io/minio/csi-provisioner:v2.2.2-go1.17
	CSIImageCSIProvisioner = "csi-provisioner@sha256:d4f94539565cf62aea57062b6a42c5156337003133fd3f51b93df9a789e69840"

	// quay.io/minio/csi-node-driver-registrar:v2.2.0-go1.17
	CSIImageNodeDriverRegistrar = "csi-node-driver-registrar@sha256:843fb23b1a3fa1de986378b0b8c08c35f8e62499d386de8ec57801fd029afe6d"

	// quay.io/minio/livenessprobe:v2.2.0-go1.17
	CSIImageLivenessProbe = "livenessprobe@sha256:928a80be4d363e0e438ff28dcdb00d8d674d3059c6149a8cda64ce6016a9a3f8"
)

CSI provisioner images

View Source
const (
	CreatedByLabel      = "created-by"
	DirectCSIPluginName = "kubectl/direct-csi"

	AppNameLabel = "application-name"
	AppTypeLabel = "application-type"

	CSIDriver = "CSIDriver"
	DirectCSI = "direct.csi.min.io"
)

Misc

View Source
const (
	AdmissionWebhookSecretName = "validationwebhookcerts"

	ValidationWebhookConfigName = "drive.validation.controller"

	// Finalizers
	DirectCSIFinalizerDeleteProtection = "/delete-protection"

	ConversionWebhookSecretName = "conversionwebhookcerts"
)
View Source
const (
	DryRunFormatUnknown DryRunFormat = ""
	DryRunFormatYAML                 = "yaml"
	DryRunFormatJSON                 = "json"
)

Variables

View Source
var (
	ErrKubeVersionNotSupported = errors.New(
		utils.Red("Error") +
			"This version of kubernetes is not supported by direct-csi" +
			"Please upgrade your kubernetes installation and try again",
	)
	ErrEmptyCABundle = errors.New("CA bundle is empty")
)

Functions

func CreateCSIDriver

func CreateCSIDriver(ctx context.Context, identity string, dryRun bool) error

func CreateControllerSecret

func CreateControllerSecret(ctx context.Context, identity string, publicCertBytes, privateKeyBytes []byte, dryRun bool) error

func CreateControllerService

func CreateControllerService(ctx context.Context, generatedSelectorValue, identity string, dryRun bool) error

func CreateConversionDeployment

func CreateConversionDeployment(ctx context.Context, identity string, directCSIContainerImage string, dryRun bool, registry, org string) error

func CreateDaemonSet

func CreateDaemonSet(ctx context.Context,
	identity string,
	directCSIContainerImage string,
	dryRun bool,
	registry, org string,
	loopBackOnly bool,
	nodeSelector map[string]string,
	tolerations []corev1.Toleration,
	seccompProfileName, apparmorProfileName string) error

func CreateDeployment

func CreateDeployment(ctx context.Context, identity string, directCSIContainerImage string, dryRun bool, registry, org string) error

func CreateNamespace

func CreateNamespace(ctx context.Context, identity string, dryRun bool) error

func CreateOrUpdateConversionCASecret

func CreateOrUpdateConversionCASecret(ctx context.Context, identity string, caCertBytes []byte, dryRun bool) error

func CreateOrUpdateConversionDeployment

func CreateOrUpdateConversionDeployment(ctx context.Context, identity string, directCSIContainerImage string, dryRun bool, registry, org string) error

func CreateOrUpdateConversionSecret

func CreateOrUpdateConversionSecret(ctx context.Context, identity string, publicCertBytes, privateKeyBytes []byte, dryRun bool) error

func CreateOrUpdateConversionService

func CreateOrUpdateConversionService(ctx context.Context, generatedSelectorValue, identity string, dryRun bool) error

func CreatePodSecurityPolicy

func CreatePodSecurityPolicy(ctx context.Context, identity string, dryRun bool) error

func CreateRBACRoles

func CreateRBACRoles(ctx context.Context, identity string, dryRun bool) error

CreateRBACRoles creates SA, ClusterRole and CRBs

func CreateService

func CreateService(ctx context.Context, identity string, dryRun bool) error

func CreateStorageClass

func CreateStorageClass(ctx context.Context, identity string, dryRun bool) error

func DeleteCSIDriver

func DeleteCSIDriver(ctx context.Context, identity string) error

func DeleteControllerDeployment

func DeleteControllerDeployment(ctx context.Context, identity string) error

func DeleteControllerSecret

func DeleteControllerSecret(ctx context.Context, identity string) error

func DeleteConversionDeployment

func DeleteConversionDeployment(ctx context.Context, identity string) error

func DeleteConversionSecret

func DeleteConversionSecret(ctx context.Context, identity string) error

func DeleteConversionWebhookCertsSecret

func DeleteConversionWebhookCertsSecret(ctx context.Context, identity string) error

func DeleteDaemonSet

func DeleteDaemonSet(ctx context.Context, identity string) error

func DeleteDeployment

func DeleteDeployment(ctx context.Context, identity, name string) error

func DeleteDriveValidationRules

func DeleteDriveValidationRules(ctx context.Context, identity string) error

func DeleteNamespace

func DeleteNamespace(ctx context.Context, identity string) error

func DeleteService

func DeleteService(ctx context.Context, identity string) error

func DeleteStorageClass

func DeleteStorageClass(ctx context.Context, identity string) error

func ErrInstallationFailed

func ErrInstallationFailed(reason string, installer string) error

func GetConversionCABundle

func GetConversionCABundle(ctx context.Context, identity string, dryRun bool) ([]byte, error)

func GetConversionServiceName

func GetConversionServiceName() string

func NewRandomString

func NewRandomString(length int) string

func RegisterDriveValidationRules

func RegisterDriveValidationRules(ctx context.Context, identity string, dryRun bool) error

func RemoveRBACRoles

func RemoveRBACRoles(ctx context.Context, identity string) error

RemoveRBACRoles deletes SA, ClusterRole and CRBs

func StringWithCharset

func StringWithCharset(length int, charset string) string

func WaitForConversionDeployment

func WaitForConversionDeployment(ctx context.Context, identity string)

Types

type DryRunFormat

type DryRunFormat string

type InstallConfig

type InstallConfig struct {
	Identity string

	// DirectCSIContainerImage properties
	DirectCSIContainerImage    string
	DirectCSIContainerOrg      string
	DirectCSIContainerRegistry string

	// CSIImage properties
	CSIProvisionerImage      string
	NodeDriverRegistrarImage string
	LivenessProbeImage       string

	// Mode switches
	LoopBackMode bool

	// dry-run properties
	DryRun       bool
	DryRunFormat DryRunFormat
	// contains filtered or unexported fields
}

func NewInstallConfig

func NewInstallConfig(identity string) *InstallConfig

func (*InstallConfig) GetCSIProvisionerImage

func (i *InstallConfig) GetCSIProvisionerImage() string

func (*InstallConfig) GetDirectCSIContainerImage

func (i *InstallConfig) GetDirectCSIContainerImage() string

func (*InstallConfig) GetDirectCSIContainerOrg

func (i *InstallConfig) GetDirectCSIContainerOrg() string

func (*InstallConfig) GetDirectCSIContainerRegistry

func (i *InstallConfig) GetDirectCSIContainerRegistry() string

func (*InstallConfig) GetDryRunFormat

func (i *InstallConfig) GetDryRunFormat() DryRunFormat

func (*InstallConfig) GetIdentity

func (i *InstallConfig) GetIdentity() string

func (*InstallConfig) GetLivenessProbeImage

func (i *InstallConfig) GetLivenessProbeImage() string

func (*InstallConfig) GetNodeDriverRegistrarImage

func (i *InstallConfig) GetNodeDriverRegistrarImage() string

func (*InstallConfig) PostProc

func (i *InstallConfig) PostProc(obj interface{}) error

func (*InstallConfig) SetDirectCSIContainerImage

func (i *InstallConfig) SetDirectCSIContainerImage(directCSIContainerImage string)

func (*InstallConfig) SetDirectCSIContainerOrg

func (i *InstallConfig) SetDirectCSIContainerOrg(directCSIContainerOrg string)

func (*InstallConfig) SetDirectCSIContainerRegistry

func (i *InstallConfig) SetDirectCSIContainerRegistry(directCSIContainerRegistry string)

func (*InstallConfig) SetDryRun

func (i *InstallConfig) SetDryRun()

func (*InstallConfig) SetDryRunFormat

func (i *InstallConfig) SetDryRunFormat(format DryRunFormat)

func (*InstallConfig) SetIdentity

func (i *InstallConfig) SetIdentity(identity string)

func (*InstallConfig) SetLivenessProbeImage

func (i *InstallConfig) SetLivenessProbeImage(livenessProbeImage string)

func (*InstallConfig) SetNodeDriverRegistrarImage

func (i *InstallConfig) SetNodeDriverRegistrarImage(nodeDriverRegistrarImage string)

func (*InstallConfig) UnsetDryRun

func (i *InstallConfig) UnsetDryRun()

type Installer

type Installer interface {
	Install(context.Context) error
	Uninstall(context.Context) error
}

type NSInstaller

type NSInstaller struct {
	*InstallConfig
	// contains filtered or unexported fields
}

func NewNSInstaller

func NewNSInstaller(i *InstallConfig, name string) (*NSInstaller, error)

func (*NSInstaller) Install

func (n *NSInstaller) Install(ctx context.Context) error

func (*NSInstaller) Uninstall

func (n *NSInstaller) Uninstall(ctx context.Context) error

type SCInstaller

type SCInstaller struct {
	*InstallConfig
	// contains filtered or unexported fields
}

func NewSCInstaller

func NewSCInstaller(name string) *SCInstaller

func (*SCInstaller) Init

func (sc *SCInstaller) Init(i *InstallConfig) error

func (*SCInstaller) Install

func (sc *SCInstaller) Install(ctx context.Context) error

func (*SCInstaller) Uninstall

func (sc *SCInstaller) Uninstall(ctx context.Context) error

Jump to

Keyboard shortcuts

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