types

package
v0.44.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	SnapPrefix = "snap"
	VolPrefix  = "vol"

	VolumeNameKey   = "volumeName"
	SnapshotNameKey = "snapshotName"
)
View Source
const (
	LonghornManagerDaemonSetName = "longhorn-manager"

	DriverDeployerName = "longhorn-driver-deployer"
	CSIAttacherName    = "csi-attacher"
	CSIProvisionerName = "csi-provisioner"
	CSIResizerName     = "csi-resizer"
	CSISnapshotterName = "csi-snapshotter"
	CSIPluginName      = "longhorn-csi-plugin"
)
View Source
const (
	VolumeStateCreating  = VolumeState("creating")
	VolumeStateAttached  = VolumeState("attached")
	VolumeStateDetached  = VolumeState("detached")
	VolumeStateAttaching = VolumeState("attaching")
	VolumeStateDetaching = VolumeState("detaching")
	VolumeStateDeleting  = VolumeState("deleting")
)
View Source
const (
	VolumeRobustnessHealthy  = VolumeRobustness("healthy")  // during attached
	VolumeRobustnessDegraded = VolumeRobustness("degraded") // during attached
	VolumeRobustnessFaulted  = VolumeRobustness("faulted")  // during detached
	VolumeRobustnessUnknown  = VolumeRobustness("unknown")
)
View Source
const (
	VolumeFrontendBlockDev = VolumeFrontend("blockdev")
	VolumeFrontendISCSI    = VolumeFrontend("iscsi")
	VolumeFrontendEmpty    = VolumeFrontend("")
)
View Source
const (
	VolumeDataSourceTypeBackup   = "backup" // Planing to move FromBackup field into DataSource field
	VolumeDataSourceTypeSnapshot = "snapshot"
	VolumeDataSourceTypeVolume   = "volume"
)
View Source
const (
	ReplicaAutoBalanceIgnored     = ReplicaAutoBalance("ignored")
	ReplicaAutoBalanceDisabled    = ReplicaAutoBalance("disabled")
	ReplicaAutoBalanceLeastEffort = ReplicaAutoBalance("least-effort")
	ReplicaAutoBalanceBestEffort  = ReplicaAutoBalance("best-effort")
)
View Source
const (
	DataLocalityDisabled   = DataLocality("disabled")
	DataLocalityBestEffort = DataLocality("best-effort")
)
View Source
const (
	AccessModeReadWriteOnce = AccessMode("rwo")
	AccessModeReadWriteMany = AccessMode("rwx")
)
View Source
const (
	VolumeConditionTypeScheduled        = "scheduled"
	VolumeConditionTypeRestore          = "restore"
	VolumeConditionTypeTooManySnapshots = "toomanysnapshots"
)
View Source
const (
	VolumeConditionReasonReplicaSchedulingFailure      = "ReplicaSchedulingFailure"
	VolumeConditionReasonLocalReplicaSchedulingFailure = "LocalReplicaSchedulingFailure"
	VolumeConditionReasonRestoreInProgress             = "RestoreInProgress"
	VolumeConditionReasonRestoreFailure                = "RestoreFailure"
	VolumeConditionReasonTooManySnapshots              = "TooManySnapshots"
)
View Source
const (
	RecurringJobTypeSnapshot = RecurringJobType("snapshot")
	RecurringJobTypeBackup   = RecurringJobType("backup")

	RecurringJobGroupDefault = "default"
)
View Source
const (
	VolumeCloneStateEmpty     = VolumeCloneState("")
	VolumeCloneStateInitiated = VolumeCloneState("initiated")
	VolumeCloneStateCompleted = VolumeCloneState("completed")
	VolumeCloneStateFailed    = VolumeCloneState("failed")
)
View Source
const (
	InstanceStateRunning  = InstanceState("running")
	InstanceStateStopped  = InstanceState("stopped")
	InstanceStateError    = InstanceState("error")
	InstanceStateStarting = InstanceState("starting")
	InstanceStateStopping = InstanceState("stopping")
	InstanceStateUnknown  = InstanceState("unknown")
)
View Source
const (
	EngineImageStateDeploying    = "deploying"
	EngineImageStateDeployed     = "deployed"
	EngineImageStateIncompatible = "incompatible"
	EngineImageStateError        = "error"
)
View Source
const (
	EngineImageConditionTypeReady = "ready"

	EngineImageConditionTypeReadyReasonDaemonSet = "daemonSet"
	EngineImageConditionTypeReadyReasonBinary    = "binary"
)
View Source
const (
	NodeConditionTypeReady            = "Ready"
	NodeConditionTypeMountPropagation = "MountPropagation"
	NodeConditionTypeSchedulable      = "Schedulable"
)
View Source
const (
	NodeConditionReasonManagerPodDown            = "ManagerPodDown"
	NodeConditionReasonManagerPodMissing         = "ManagerPodMissing"
	NodeConditionReasonKubernetesNodeGone        = "KubernetesNodeGone"
	NodeConditionReasonKubernetesNodeNotReady    = "KubernetesNodeNotReady"
	NodeConditionReasonKubernetesNodePressure    = "KubernetesNodePressure"
	NodeConditionReasonUnknownNodeConditionTrue  = "UnknownNodeConditionTrue"
	NodeConditionReasonNoMountPropagationSupport = "NoMountPropagationSupport"
	NodeConditionReasonKubernetesNodeCordoned    = "KubernetesNodeCordoned"
)
View Source
const (
	DiskConditionTypeSchedulable = "Schedulable"
	DiskConditionTypeReady       = "Ready"
)
View Source
const (
	DiskConditionReasonDiskPressure          = "DiskPressure"
	DiskConditionReasonDiskFilesystemChanged = "DiskFilesystemChanged"
	DiskConditionReasonNoDiskInfo            = "NoDiskInfo"
	DiskConditionReasonDiskNotReady          = "DiskNotReady"
)
View Source
const (
	ProcessStateComplete   = "complete"
	ProcessStateError      = "error"
	ProcessStateInProgress = "in_progress"
)

Should be the same values as in https://github.com/longhorn/longhorn-engine/blob/master/pkg/types/types.go

View Source
const (
	InstanceTypeEngine  = InstanceType("engine")
	InstanceTypeReplica = InstanceType("replica")
)
View Source
const (
	InstanceManagerStateError    = InstanceManagerState("error")
	InstanceManagerStateRunning  = InstanceManagerState("running")
	InstanceManagerStateStopped  = InstanceManagerState("stopped")
	InstanceManagerStateStarting = InstanceManagerState("starting")
	InstanceManagerStateUnknown  = InstanceManagerState("unknown")
)
View Source
const (
	InstanceManagerTypeEngine  = InstanceManagerType("engine")
	InstanceManagerTypeReplica = InstanceManagerType("replica")
)
View Source
const (
	ShareManagerStateUnknown  = ShareManagerState("unknown")
	ShareManagerStateStarting = ShareManagerState("starting")
	ShareManagerStateRunning  = ShareManagerState("running")
	ShareManagerStateStopping = ShareManagerState("stopping")
	ShareManagerStateStopped  = ShareManagerState("stopped")
	ShareManagerStateError    = ShareManagerState("error")
)
View Source
const (
	BackingImageStatePending          = BackingImageState("pending")
	BackingImageStateStarting         = BackingImageState("starting")
	BackingImageStateReadyForTransfer = BackingImageState("ready-for-transfer")
	BackingImageStateReady            = BackingImageState("ready")
	BackingImageStateInProgress       = BackingImageState("in-progress")
	BackingImageStateFailed           = BackingImageState("failed")
	BackingImageStateUnknown          = BackingImageState("unknown")
)
View Source
const (
	BackingImageManagerStateError    = BackingImageManagerState("error")
	BackingImageManagerStateRunning  = BackingImageManagerState("running")
	BackingImageManagerStateStopped  = BackingImageManagerState("stopped")
	BackingImageManagerStateStarting = BackingImageManagerState("starting")
	BackingImageManagerStateUnknown  = BackingImageManagerState("unknown")
)
View Source
const (
	BackingImageDataSourceTypeDownload         = BackingImageDataSourceType("download")
	BackingImageDataSourceTypeUpload           = BackingImageDataSourceType("upload")
	BackingImageDataSourceTypeExportFromVolume = BackingImageDataSourceType("export-from-volume")
)
View Source
const (
	DataSourceTypeDownloadParameterURL                = "url"
	DataSourceTypeExportFromVolumeParameterVolumeName = "volume-name"
	DataSourceTypeExportFromVolumeParameterExportType = "export-type"

	DataSourceTypeExportFromVolumeParameterVolumeSize    = "volume-size"
	DataSourceTypeExportFromVolumeParameterSnapshotName  = "snapshot-name"
	DataSourceTypeExportFromVolumeParameterSenderAddress = "sender-address"

	DataSourceTypeExportFromVolumeParameterExportTypeRAW   = "raw"
	DataSourceTypeExportFromVolumeParameterExportTypeQCOW2 = "qcow2"
)
View Source
const (
	BackupTargetConditionTypeUnavailable = "Unavailable"

	BackupTargetConditionReasonUnavailable = "Unavailable"
)
View Source
const (
	BackupStateInProgress = BackupState("InProgress")
	BackupStateCompleted  = BackupState("Completed")
	BackupStateError      = BackupState("Error")
	BackupStateUnknown    = BackupState("Unknown")
)
View Source
const (
	SettingTypeString     = SettingType("string")
	SettingTypeInt        = SettingType("int")
	SettingTypeBool       = SettingType("bool")
	SettingTypeDeprecated = SettingType("deprecated")
)
View Source
const (
	SettingNameBackupTarget                                 = SettingName("backup-target")
	SettingNameBackupTargetCredentialSecret                 = SettingName("backup-target-credential-secret")
	SettingNameAllowRecurringJobWhileVolumeDetached         = SettingName("allow-recurring-job-while-volume-detached")
	SettingNameCreateDefaultDiskLabeledNodes                = SettingName("create-default-disk-labeled-nodes")
	SettingNameDefaultDataPath                              = SettingName("default-data-path")
	SettingNameDefaultEngineImage                           = SettingName("default-engine-image")
	SettingNameDefaultInstanceManagerImage                  = SettingName("default-instance-manager-image")
	SettingNameDefaultShareManagerImage                     = SettingName("default-share-manager-image")
	SettingNameDefaultBackingImageManagerImage              = SettingName("default-backing-image-manager-image")
	SettingNameReplicaSoftAntiAffinity                      = SettingName("replica-soft-anti-affinity")
	SettingNameReplicaAutoBalance                           = SettingName("replica-auto-balance")
	SettingNameStorageOverProvisioningPercentage            = SettingName("storage-over-provisioning-percentage")
	SettingNameStorageMinimalAvailablePercentage            = SettingName("storage-minimal-available-percentage")
	SettingNameUpgradeChecker                               = SettingName("upgrade-checker")
	SettingNameLatestLonghornVersion                        = SettingName("latest-longhorn-version")
	SettingNameStableLonghornVersions                       = SettingName("stable-longhorn-versions")
	SettingNameDefaultReplicaCount                          = SettingName("default-replica-count")
	SettingNameDefaultDataLocality                          = SettingName("default-data-locality")
	SettingNameGuaranteedEngineCPU                          = SettingName("guaranteed-engine-cpu")
	SettingNameDefaultLonghornStaticStorageClass            = SettingName("default-longhorn-static-storage-class")
	SettingNameBackupstorePollInterval                      = SettingName("backupstore-poll-interval")
	SettingNameTaintToleration                              = SettingName("taint-toleration")
	SettingNameSystemManagedComponentsNodeSelector          = SettingName("system-managed-components-node-selector")
	SettingNameCRDAPIVersion                                = SettingName("crd-api-version")
	SettingNameAutoSalvage                                  = SettingName("auto-salvage")
	SettingNameAutoDeletePodWhenVolumeDetachedUnexpectedly  = SettingName("auto-delete-pod-when-volume-detached-unexpectedly")
	SettingNameRegistrySecret                               = SettingName("registry-secret")
	SettingNameDisableSchedulingOnCordonedNode              = SettingName("disable-scheduling-on-cordoned-node")
	SettingNameReplicaZoneSoftAntiAffinity                  = SettingName("replica-zone-soft-anti-affinity")
	SettingNameVolumeAttachmentRecoveryPolicy               = SettingName("volume-attachment-recovery-policy")
	SettingNameNodeDownPodDeletionPolicy                    = SettingName("node-down-pod-deletion-policy")
	SettingNameAllowNodeDrainWithLastHealthyReplica         = SettingName("allow-node-drain-with-last-healthy-replica")
	SettingNameMkfsExt4Parameters                           = SettingName("mkfs-ext4-parameters")
	SettingNamePriorityClass                                = SettingName("priority-class")
	SettingNameDisableRevisionCounter                       = SettingName("disable-revision-counter")
	SettingNameDisableReplicaRebuild                        = SettingName("disable-replica-rebuild")
	SettingNameReplicaReplenishmentWaitInterval             = SettingName("replica-replenishment-wait-interval")
	SettingNameConcurrentReplicaRebuildPerNodeLimit         = SettingName("concurrent-replica-rebuild-per-node-limit")
	SettingNameSystemManagedPodsImagePullPolicy             = SettingName("system-managed-pods-image-pull-policy")
	SettingNameAllowVolumeCreationWithDegradedAvailability  = SettingName("allow-volume-creation-with-degraded-availability")
	SettingNameAutoCleanupSystemGeneratedSnapshot           = SettingName("auto-cleanup-system-generated-snapshot")
	SettingNameConcurrentAutomaticEngineUpgradePerNodeLimit = SettingName("concurrent-automatic-engine-upgrade-per-node-limit")
	SettingNameBackingImageCleanupWaitInterval              = SettingName("backing-image-cleanup-wait-interval")
	SettingNameBackingImageRecoveryWaitInterval             = SettingName("backing-image-recovery-wait-interval")
	SettingNameGuaranteedEngineManagerCPU                   = SettingName("guaranteed-engine-manager-cpu")
	SettingNameGuaranteedReplicaManagerCPU                  = SettingName("guaranteed-replica-manager-cpu")
)
View Source
const (
	SettingCategoryGeneral    = SettingCategory("general")
	SettingCategoryBackup     = SettingCategory("backup")
	SettingCategoryScheduling = SettingCategory("scheduling")
	SettingCategoryDangerZone = SettingCategory("danger Zone")
)
View Source
const (
	VolumeAttachmentRecoveryPolicyNever     = VolumeAttachmentRecoveryPolicy("never") // Kubernetes default behavior
	VolumeAttachmentRecoveryPolicyWait      = VolumeAttachmentRecoveryPolicy("wait")  // Longhorn default behavior
	VolumeAttachmentRecoveryPolicyImmediate = VolumeAttachmentRecoveryPolicy("immediate")
)
View Source
const (
	NodeDownPodDeletionPolicyDoNothing                             = NodeDownPodDeletionPolicy("do-nothing") // Kubernetes default behavior
	NodeDownPodDeletionPolicyDeleteStatefulSetPod                  = NodeDownPodDeletionPolicy("delete-statefulset-pod")
	NodeDownPodDeletionPolicyDeleteDeploymentPod                   = NodeDownPodDeletionPolicy("delete-deployment-pod")
	NodeDownPodDeletionPolicyDeleteBothStatefulsetAndDeploymentPod = NodeDownPodDeletionPolicy("delete-both-statefulset-and-deployment-pod")
)
View Source
const (
	SystemManagedPodsImagePullPolicyNever        = SystemManagedPodsImagePullPolicy("never")
	SystemManagedPodsImagePullPolicyIfNotPresent = SystemManagedPodsImagePullPolicy("if-not-present")
	SystemManagedPodsImagePullPolicyAlways       = SystemManagedPodsImagePullPolicy("always")
)
View Source
const (
	LonghornKindNode                = "Node"
	LonghornKindVolume              = "Volume"
	LonghornKindEngineImage         = "EngineImage"
	LonghornKindInstanceManager     = "InstanceManager"
	LonghornKindShareManager        = "ShareManager"
	LonghornKindBackingImage        = "BackingImage"
	LonghornKindBackingImageManager = "BackingImageManager"
	LonghornKindRecurringJob        = "RecurringJob"

	LonghornKindBackingImageDataSource = "BackingImageDataSource"

	CRDAPIVersionV1alpha1 = "longhorn.rancher.io/v1alpha1"
	CRDAPIVersionV1beta1  = "longhorn.io/v1beta1"
	CurrentCRDAPIVersion  = CRDAPIVersionV1beta1
)
View Source
const (
	DefaultAPIPort = 9500

	EngineBinaryDirectoryInContainer = "/engine-binaries/"
	EngineBinaryDirectoryOnHost      = "/var/lib/longhorn/engine-binaries/"
	ReplicaHostPrefix                = "/host"
	EngineBinaryName                 = "longhorn"

	BackingImageManagerDirectory = "/backing-images/"
	BackingImageFileName         = "backing"

	DefaultBackupTargetName = "default"

	LonghornNodeKey     = "longhornnode"
	LonghornDiskUUIDKey = "longhorndiskuuid"

	NodeCreateDefaultDiskLabelKey             = "node.longhorn.io/create-default-disk"
	NodeCreateDefaultDiskLabelValueTrue       = "true"
	NodeCreateDefaultDiskLabelValueConfig     = "config"
	KubeNodeDefaultDiskConfigAnnotationKey    = "node.longhorn.io/default-disks-config"
	KubeNodeDefaultNodeTagConfigAnnotationKey = "node.longhorn.io/default-node-tags"

	LastAppliedTolerationAnnotationKeySuffix = "last-applied-tolerations"

	KubernetesStatusLabel = "KubernetesStatus"
	KubernetesReplicaSet  = "ReplicaSet"
	KubernetesStatefulSet = "StatefulSet"
	RecurringJobLabel     = "RecurringJob"

	LonghornLabelKeyPrefix = "longhorn.io"

	LonghornLabelRecurringJobKeyPrefixFmt = "recurring-%s.longhorn.io"

	LonghornLabelEngineImage              = "engine-image"
	LonghornLabelInstanceManager          = "instance-manager"
	LonghornLabelNode                     = "node"
	LonghornLabelDiskUUID                 = "disk-uuid"
	LonghornLabelInstanceManagerType      = "instance-manager-type"
	LonghornLabelInstanceManagerImage     = "instance-manager-image"
	LonghornLabelVolume                   = "longhornvolume"
	LonghornLabelShareManager             = "share-manager"
	LonghornLabelShareManagerImage        = "share-manager-image"
	LonghornLabelBackingImage             = "backing-image"
	LonghornLabelBackingImageManager      = "backing-image-manager"
	LonghornLabelManagedBy                = "managed-by"
	LonghornLabelSnapshotForCloningVolume = "for-cloning-volume"
	LonghornLabelBackingImageDataSource   = "backing-image-data-source"
	LonghornLabelBackupVolume             = "backup-volume"
	LonghornLabelRecurringJob             = "job"
	LonghornLabelRecurringJobGroup        = "job-group"

	LonghornLabelValueEnabled = "enabled"

	LonghornLabelExportFromVolume                 = "export-from-volume"
	LonghornLabelSnapshotForExportingBackingImage = "for-exporting-backing-image"

	KubernetesFailureDomainRegionLabelKey = "failure-domain.beta.kubernetes.io/region"
	KubernetesFailureDomainZoneLabelKey   = "failure-domain.beta.kubernetes.io/zone"
	KubernetesTopologyRegionLabelKey      = "topology.kubernetes.io/region"
	KubernetesTopologyZoneLabelKey        = "topology.kubernetes.io/zone"

	LonghornDriverName = "driver.longhorn.io"

	DefaultDiskPrefix = "default-disk-"

	DeprecatedProvisionerName        = "rancher.io/longhorn"
	DepracatedDriverName             = "io.rancher.longhorn"
	DefaultStorageClassConfigMapName = "longhorn-storageclass"
	DefaultStorageClassName          = "longhorn"
	ControlPlaneName                 = "longhorn-manager"

	DefaultRecurringJobConcurrency = 10
)
View Source
const (
	ReplicaModeRW  = ReplicaMode("RW")
	ReplicaModeWO  = ReplicaMode("WO")
	ReplicaModeERR = ReplicaMode("ERR")

	EnvNodeName       = "NODE_NAME"
	EnvPodNamespace   = "POD_NAMESPACE"
	EnvPodIP          = "POD_IP"
	EnvServiceAccount = "SERVICE_ACCOUNT"

	BackupStoreTypeS3 = "s3"

	AWSIAMRoleAnnotation = "iam.amazonaws.com/role"
	AWSIAMRoleArn        = "AWS_IAM_ROLE_ARN"
	AWSAccessKey         = "AWS_ACCESS_KEY_ID"
	AWSSecretKey         = "AWS_SECRET_ACCESS_KEY"
	AWSEndPoint          = "AWS_ENDPOINTS"
	AWSCert              = "AWS_CERT"

	HTTPSProxy = "HTTPS_PROXY"
	HTTPProxy  = "HTTP_PROXY"
	NOProxy    = "NO_PROXY"

	VirtualHostedStyle = "VIRTUAL_HOSTED_STYLE"

	OptionFromBackup          = "fromBackup"
	OptionNumberOfReplicas    = "numberOfReplicas"
	OptionStaleReplicaTimeout = "staleReplicaTimeout"
	OptionBaseImage           = "baseImage"
	OptionFrontend            = "frontend"
	OptionDiskSelector        = "diskSelector"
	OptionNodeSelector        = "nodeSelector"

	// DefaultStaleReplicaTimeout in minutes. 48h by default
	DefaultStaleReplicaTimeout = "2880"

	ImageChecksumNameLength = 8
)
View Source
const (
	BackingImageDataSourcePodNamePrefix = "backing-image-ds-"
)
View Source
const (
	EnvDefaultSettingPath = "DEFAULT_SETTING_PATH"
)
View Source
const (
	InvalidEngineVersion = -1
)
View Source
const (
	KubernetesMinVersion = "v1.18.0"
)

Variables

View Source
var (
	SettingDefinitions = map[SettingName]SettingDefinition{
		SettingNameBackupTarget:                                 SettingDefinitionBackupTarget,
		SettingNameBackupTargetCredentialSecret:                 SettingDefinitionBackupTargetCredentialSecret,
		SettingNameAllowRecurringJobWhileVolumeDetached:         SettingDefinitionAllowRecurringJobWhileVolumeDetached,
		SettingNameCreateDefaultDiskLabeledNodes:                SettingDefinitionCreateDefaultDiskLabeledNodes,
		SettingNameDefaultDataPath:                              SettingDefinitionDefaultDataPath,
		SettingNameDefaultEngineImage:                           SettingDefinitionDefaultEngineImage,
		SettingNameDefaultInstanceManagerImage:                  SettingDefinitionDefaultInstanceManagerImage,
		SettingNameDefaultShareManagerImage:                     SettingDefinitionDefaultShareManagerImage,
		SettingNameDefaultBackingImageManagerImage:              SettingDefinitionDefaultBackingImageManagerImage,
		SettingNameReplicaSoftAntiAffinity:                      SettingDefinitionReplicaSoftAntiAffinity,
		SettingNameReplicaAutoBalance:                           SettingDefinitionReplicaAutoBalance,
		SettingNameStorageOverProvisioningPercentage:            SettingDefinitionStorageOverProvisioningPercentage,
		SettingNameStorageMinimalAvailablePercentage:            SettingDefinitionStorageMinimalAvailablePercentage,
		SettingNameUpgradeChecker:                               SettingDefinitionUpgradeChecker,
		SettingNameLatestLonghornVersion:                        SettingDefinitionLatestLonghornVersion,
		SettingNameStableLonghornVersions:                       SettingDefinitionStableLonghornVersions,
		SettingNameDefaultReplicaCount:                          SettingDefinitionDefaultReplicaCount,
		SettingNameDefaultDataLocality:                          SettingDefinitionDefaultDataLocality,
		SettingNameGuaranteedEngineCPU:                          SettingDefinitionGuaranteedEngineCPU,
		SettingNameDefaultLonghornStaticStorageClass:            SettingDefinitionDefaultLonghornStaticStorageClass,
		SettingNameBackupstorePollInterval:                      SettingDefinitionBackupstorePollInterval,
		SettingNameTaintToleration:                              SettingDefinitionTaintToleration,
		SettingNameSystemManagedComponentsNodeSelector:          SettingDefinitionSystemManagedComponentsNodeSelector,
		SettingNameCRDAPIVersion:                                SettingDefinitionCRDAPIVersion,
		SettingNameAutoSalvage:                                  SettingDefinitionAutoSalvage,
		SettingNameAutoDeletePodWhenVolumeDetachedUnexpectedly:  SettingDefinitionAutoDeletePodWhenVolumeDetachedUnexpectedly,
		SettingNameRegistrySecret:                               SettingDefinitionRegistrySecret,
		SettingNameDisableSchedulingOnCordonedNode:              SettingDefinitionDisableSchedulingOnCordonedNode,
		SettingNameReplicaZoneSoftAntiAffinity:                  SettingDefinitionReplicaZoneSoftAntiAffinity,
		SettingNameVolumeAttachmentRecoveryPolicy:               SettingDefinitionVolumeAttachmentRecoveryPolicy,
		SettingNameNodeDownPodDeletionPolicy:                    SettingDefinitionNodeDownPodDeletionPolicy,
		SettingNameAllowNodeDrainWithLastHealthyReplica:         SettingDefinitionAllowNodeDrainWithLastHealthyReplica,
		SettingNameMkfsExt4Parameters:                           SettingDefinitionMkfsExt4Parameters,
		SettingNamePriorityClass:                                SettingDefinitionPriorityClass,
		SettingNameDisableRevisionCounter:                       SettingDefinitionDisableRevisionCounter,
		SettingNameDisableReplicaRebuild:                        SettingDefinitionDisableReplicaRebuild,
		SettingNameReplicaReplenishmentWaitInterval:             SettingDefinitionReplicaReplenishmentWaitInterval,
		SettingNameConcurrentReplicaRebuildPerNodeLimit:         SettingDefinitionConcurrentReplicaRebuildPerNodeLimit,
		SettingNameSystemManagedPodsImagePullPolicy:             SettingDefinitionSystemManagedPodsImagePullPolicy,
		SettingNameAllowVolumeCreationWithDegradedAvailability:  SettingDefinitionAllowVolumeCreationWithDegradedAvailability,
		SettingNameAutoCleanupSystemGeneratedSnapshot:           SettingDefinitionAutoCleanupSystemGeneratedSnapshot,
		SettingNameConcurrentAutomaticEngineUpgradePerNodeLimit: SettingDefinitionConcurrentAutomaticEngineUpgradePerNodeLimit,
		SettingNameBackingImageCleanupWaitInterval:              SettingDefinitionBackingImageCleanupWaitInterval,
		SettingNameBackingImageRecoveryWaitInterval:             SettingDefinitionBackingImageRecoveryWaitInterval,
		SettingNameGuaranteedEngineManagerCPU:                   SettingDefinitionGuaranteedEngineManagerCPU,
		SettingNameGuaranteedReplicaManagerCPU:                  SettingDefinitionGuaranteedReplicaManagerCPU,
	}

	SettingDefinitionBackupTarget = SettingDefinition{
		DisplayName: "Backup Target",
		Description: "The endpoint used to access the backupstore. NFS and S3 are supported.",
		Category:    SettingCategoryBackup,
		Type:        SettingTypeString,
		Required:    false,
		ReadOnly:    false,
	}

	SettingDefinitionBackupTargetCredentialSecret = SettingDefinition{
		DisplayName: "Backup Target Credential Secret",
		Description: "The name of the Kubernetes secret associated with the backup target.",
		Category:    SettingCategoryBackup,
		Type:        SettingTypeString,
		Required:    false,
		ReadOnly:    false,
	}

	SettingDefinitionAllowRecurringJobWhileVolumeDetached = SettingDefinition{
		DisplayName: "Allow Recurring Job While Volume Is Detached",
		Description: "If this setting is enabled, Longhorn will automatically attaches the volume and takes snapshot/backup when it is the time to do recurring snapshot/backup. \n\n" +
			"Note that the volume is not ready for workload during the period when the volume was automatically attached. " +
			"Workload will have to wait until the recurring job finishes.",
		Category: SettingCategoryBackup,
		Type:     SettingTypeBool,
		Required: true,
		ReadOnly: false,
		Default:  "false",
	}

	SettingDefinitionBackupstorePollInterval = SettingDefinition{
		DisplayName: "Backupstore Poll Interval",
		Description: "In seconds. The backupstore poll interval determines how often Longhorn checks the backupstore for new backups. Set to 0 to disable the polling.",
		Category:    SettingCategoryBackup,
		Type:        SettingTypeInt,
		Required:    true,
		ReadOnly:    false,
		Default:     "300",
	}

	SettingDefinitionCreateDefaultDiskLabeledNodes = SettingDefinition{
		DisplayName: "Create Default Disk on Labeled Nodes",
		Description: "Create default Disk automatically only on Nodes with the label " +
			"\"node.longhorn.io/create-default-disk=true\" if no other disks exist. If disabled, the default disk will " +
			"be created on all new nodes when each node is first added.",
		Category: SettingCategoryGeneral,
		Type:     SettingTypeBool,
		Required: true,
		ReadOnly: false,
		Default:  "false",
	}

	SettingDefinitionDefaultDataPath = SettingDefinition{
		DisplayName: "Default Data Path",
		Description: "Default path to use for storing data on a host",
		Category:    SettingCategoryGeneral,
		Type:        SettingTypeString,
		Required:    true,
		ReadOnly:    false,
		Default:     "/var/lib/longhorn/",
	}

	SettingDefinitionDefaultEngineImage = SettingDefinition{
		DisplayName: "Default Engine Image",
		Description: "The default engine image used by the manager. Can be changed on the manager starting command line only",
		Category:    SettingCategoryGeneral,
		Type:        SettingTypeString,
		Required:    true,
		ReadOnly:    true,
	}

	SettingDefinitionDefaultInstanceManagerImage = SettingDefinition{
		DisplayName: "Default Instance Manager Image",
		Description: "The default instance manager image used by the manager. Can be changed on the manager starting command line only",
		Category:    SettingCategoryGeneral,
		Type:        SettingTypeString,
		Required:    true,
		ReadOnly:    true,
	}

	SettingDefinitionDefaultShareManagerImage = SettingDefinition{
		DisplayName: "Default Share Manager Image",
		Description: "The default share manager image used by the manager. Can be changed on the manager starting command line only",
		Category:    SettingCategoryGeneral,
		Type:        SettingTypeString,
		Required:    true,
		ReadOnly:    true,
	}

	SettingDefinitionDefaultBackingImageManagerImage = SettingDefinition{
		DisplayName: "Default Backing Image Manager Image",
		Description: "The default backing image manager image used by the manager. Can be changed on the manager starting command line only",
		Category:    SettingCategoryGeneral,
		Type:        SettingTypeString,
		Required:    true,
		ReadOnly:    true,
	}

	SettingDefinitionReplicaSoftAntiAffinity = SettingDefinition{
		DisplayName: "Replica Node Level Soft Anti-Affinity",
		Description: "Allow scheduling on nodes with existing healthy replicas of the same volume",
		Category:    SettingCategoryScheduling,
		Type:        SettingTypeBool,
		Required:    true,
		ReadOnly:    false,
		Default:     "false",
	}

	SettingDefinitionReplicaAutoBalance = SettingDefinition{
		DisplayName: "Replica Auto Balance",
		Description: "Enable this setting automatically rebalances replicas when discovered an available node.\n\n" +
			"The available global options are: \n\n" +
			"- **disabled**. This is the default option. No replica auto-balance will be done.\n" +
			"- **least-effort**. This option instructs Longhorn to balance replicas for minimal redundancy.\n" +
			"- **best-effort**. This option instructs Longhorn to balance replicas for even redundancy.\n\n" +
			"Longhorn also support individual volume setting. The setting can be specified on Volume page, this overrules the global setting.\n\n" +
			"The available volume setting options are: \n\n" +
			"- **ignored**. This is the default option that instructs Longhorn to inherit from the global setting.\n" +
			"- **disabled**. This option instructs Longhorn no replica auto-balance should be done.\n" +
			"- **least-effort**. This option instructs Longhorn to balance replicas for minimal redundancy.\n" +
			"- **best-effort**. This option instructs Longhorn to balance replicas for even redundancy.\n",
		Category: SettingCategoryScheduling,
		Type:     SettingTypeString,
		Required: true,
		ReadOnly: false,
		Default:  string(ReplicaAutoBalanceDisabled),
		Choices: []string{
			string(ReplicaAutoBalanceDisabled),
			string(ReplicaAutoBalanceLeastEffort),
			string(ReplicaAutoBalanceBestEffort),
		},
	}

	SettingDefinitionStorageOverProvisioningPercentage = SettingDefinition{
		DisplayName: "Storage Over Provisioning Percentage",
		Description: "The over-provisioning percentage defines how much storage can be allocated relative to the hard drive's capacity",
		Category:    SettingCategoryScheduling,
		Type:        SettingTypeInt,
		Required:    true,
		ReadOnly:    false,
		Default:     "200",
	}

	SettingDefinitionStorageMinimalAvailablePercentage = SettingDefinition{
		DisplayName: "Storage Minimal Available Percentage",
		Description: "If the minimum available disk capacity exceeds the actual percentage of available disk capacity, the disk becomes unschedulable until more space is freed up.",
		Category:    SettingCategoryScheduling,
		Type:        SettingTypeInt,
		Required:    true,
		ReadOnly:    false,
		Default:     "25",
	}

	SettingDefinitionUpgradeChecker = SettingDefinition{
		DisplayName: "Enable Upgrade Checker",
		Description: "Upgrade Checker will check for new Longhorn version periodically. When there is a new version available, a notification will appear in the UI",
		Category:    SettingCategoryGeneral,
		Type:        SettingTypeBool,
		Required:    true,
		ReadOnly:    false,
		Default:     "true",
	}

	SettingDefinitionLatestLonghornVersion = SettingDefinition{
		DisplayName: "Latest Longhorn Version",
		Description: "The latest version of Longhorn available. Updated by Upgrade Checker automatically",
		Category:    SettingCategoryGeneral,
		Type:        SettingTypeString,
		Required:    false,
		ReadOnly:    true,
	}

	SettingDefinitionStableLonghornVersions = SettingDefinition{
		DisplayName: "Stable Longhorn Versions",
		Description: "The latest stable version of every minor release line. Updated by Upgrade Checker automatically",
		Category:    SettingCategoryGeneral,
		Type:        SettingTypeString,
		Required:    false,
		ReadOnly:    true,
	}

	SettingDefinitionDefaultReplicaCount = SettingDefinition{
		DisplayName: "Default Replica Count",
		Description: "The default number of replicas when a volume is created from the Longhorn UI. For Kubernetes configuration, update the `numberOfReplicas` in the StorageClass",
		Category:    SettingCategoryGeneral,
		Type:        SettingTypeInt,
		Required:    true,
		ReadOnly:    false,
		Default:     "3",
	}

	SettingDefinitionDefaultDataLocality = SettingDefinition{
		DisplayName: "Default Data Locality",
		Description: "We say a Longhorn volume has data locality if there is a local replica of the volume on the same node as the pod which is using the volume.\n\n" +
			"This setting specifies the default data locality when a volume is created from the Longhorn UI. For Kubernetes configuration, update the `dataLocality` in the StorageClass\n\n" +
			"The available modes are: \n\n" +
			"- **disabled**. This is the default option. There may or may not be a replica on the same node as the attached volume (workload)\n" +
			"- **best-effort**. This option instructs Longhorn to try to keep a replica on the same node as the attached volume (workload). Longhorn will not stop the volume, even if it cannot keep a replica local to the attached volume (workload) due to environment limitation, e.g. not enough disk space, incompatible disk tags, etc.\n",
		Category: SettingCategoryGeneral,
		Type:     SettingTypeString,
		Required: true,
		ReadOnly: false,
		Default:  string(DataLocalityDisabled),
		Choices: []string{
			string(DataLocalityDisabled),
			string(DataLocalityBestEffort),
		},
	}

	SettingDefinitionGuaranteedEngineCPU = SettingDefinition{
		DisplayName: "Guaranteed Engine CPU (Deprecated)",
		Description: "This setting is replaced by 2 new settings \"Guaranteed Engine Manager CPU\" and \"Guaranteed Replica Manager CPU\" since Longhorn version v1.1.1. \n" +
			"This setting was used to control the CPU requests of all Longhorn Instance Manager pods. \n",
		Category: SettingCategoryDangerZone,
		Type:     SettingTypeDeprecated,
		Required: false,
		ReadOnly: true,
		Default:  "",
	}

	SettingDefinitionDefaultLonghornStaticStorageClass = SettingDefinition{
		DisplayName: "Default Longhorn Static StorageClass Name",
		Description: "The 'storageClassName' is given to PVs and PVCs that are created for an existing Longhorn volume. The StorageClass name can also be used as a label, so it is possible to use a Longhorn StorageClass to bind a workload to an existing PV without creating a Kubernetes StorageClass object.",
		Category:    SettingCategoryGeneral,
		Type:        SettingTypeString,
		Required:    true,
		ReadOnly:    false,
		Default:     "longhorn-static",
	}

	SettingDefinitionTaintToleration = SettingDefinition{
		DisplayName: "Kubernetes Taint Toleration",
		Description: "If you want to dedicate nodes to just store Longhorn replicas and reject other general workloads, you can set tolerations for **all** Longhorn components and add taints to the nodes dedicated for storage. " +
			"Longhorn system contains user deployed components (e.g, Longhorn manager, Longhorn driver, Longhorn UI) and system managed components (e.g, instance manager, engine image, CSI driver, etc.) " +
			"This setting only sets taint tolerations for system managed components. " +
			"Depending on how you deployed Longhorn, you need to set taint tolerations for user deployed components in Helm chart or deployment YAML file. " +
			"All Longhorn volumes should be detached before modifying toleration settings. " +
			"We recommend setting tolerations during Longhorn deployment because the Longhorn system cannot be operated during the update. " +
			"Multiple tolerations can be set here, and these tolerations are separated by semicolon. For example: \n\n" +
			"* `key1=value1:NoSchedule; key2:NoExecute` \n\n" +
			"* `:` this toleration tolerates everything because an empty key with operator `Exists` matches all keys, values and effects \n\n" +
			"* `key1=value1:`  this toleration has empty effect. It matches all effects with key `key1` \n\n" +
			"Because `kubernetes.io` is used as the key of all Kubernetes default tolerations, it should not be used in the toleration settings.\n\n " +
			"WARNING: DO NOT CHANGE THIS SETTING WITH ATTACHED VOLUMES! ",
		Category: SettingCategoryDangerZone,
		Type:     SettingTypeString,
		Required: false,
		ReadOnly: false,
	}

	SettingDefinitionSystemManagedComponentsNodeSelector = SettingDefinition{
		DisplayName: "System Managed Components Node Selector",
		Description: "If you want to restrict Longhorn components to only run on particular set of nodes, you can set node selector for **all** Longhorn components. " +
			"Longhorn system contains user deployed components (e.g, Longhorn manager, Longhorn driver, Longhorn UI) and system managed components (e.g, instance manager, engine image, CSI driver, etc.) " +
			"You must follow the below order when set the node selector:\n\n" +
			"1. Set node selector for user deployed components in Helm chart or deployment YAML file depending on how you deployed Longhorn.\n\n" +
			"2. Set node selector for system managed components in here.\n\n" +
			"All Longhorn volumes should be detached before modifying node selector settings. " +
			"We recommend setting node selector during Longhorn deployment because the Longhorn system cannot be operated during the update. " +
			"Multiple label key-value pairs are separated by semicolon. For example: \n\n" +
			"* `label-key1=label-value1; label-key2=label-value2` \n\n" +
			"WARNING: DO NOT CHANGE THIS SETTING WITH ATTACHED VOLUMES! \n\n" +
			"Please see the documentation at https://longhorn.io for more detailed instructions about changing node selector",
		Category: SettingCategoryDangerZone,
		Type:     SettingTypeString,
		Required: false,
		ReadOnly: false,
	}

	SettingDefinitionCRDAPIVersion = SettingDefinition{
		DisplayName: "Custom Resource API Version",
		Description: "The current customer resource's API version, e.g. longhorn.io/v1beta1. Set by manager automatically",
		Category:    SettingCategoryGeneral,
		Type:        SettingTypeString,
		Required:    true,
		ReadOnly:    true,
	}

	SettingDefinitionAutoSalvage = SettingDefinition{
		DisplayName: "Automatic salvage",
		Description: "If enabled, volumes will be automatically salvaged when all the replicas become faulty e.g. due to network disconnection. Longhorn will try to figure out which replica(s) are usable, then use them for the volume.",
		Category:    SettingCategoryGeneral,
		Type:        SettingTypeBool,
		Required:    true,
		ReadOnly:    false,
		Default:     "true",
	}

	SettingDefinitionAutoDeletePodWhenVolumeDetachedUnexpectedly = SettingDefinition{
		DisplayName: "Automatically Delete Workload Pod when The Volume Is Detached Unexpectedly",
		Description: "If enabled, Longhorn will automatically delete the workload pod that is managed by a controller (e.g. deployment, statefulset, daemonset, etc...) when Longhorn volume is detached unexpectedly (e.g. during Kubernetes upgrade, Docker reboot, or network disconnect). " +
			"By deleting the pod, its controller restarts the pod and Kubernetes handles volume reattachment and remount. \n\n" +
			"If disabled, Longhorn will not delete the workload pod that is managed by a controller. You will have to manually restart the pod to reattach and remount the volume. \n\n" +
			"**Note:** This setting doesn't apply to the workload pods that don't have a controller. Longhorn never deletes them.",
		Category: SettingCategoryGeneral,
		Type:     SettingTypeBool,
		Required: true,
		ReadOnly: false,
		Default:  "true",
	}

	SettingDefinitionRegistrySecret = SettingDefinition{
		DisplayName: "Registry secret",
		Description: "The Kubernetes Secret name",
		Category:    SettingCategoryGeneral,
		Type:        SettingTypeString,
		Required:    false,
		ReadOnly:    false,
		Default:     "",
	}
	SettingDefinitionDisableSchedulingOnCordonedNode = SettingDefinition{
		DisplayName: "Disable Scheduling On Cordoned Node",
		Description: `Disable Longhorn manager to schedule replica on Kubernetes cordoned node`,
		Category:    SettingCategoryScheduling,
		Type:        SettingTypeBool,
		Required:    true,
		ReadOnly:    false,
		Default:     "true",
	}
	SettingDefinitionReplicaZoneSoftAntiAffinity = SettingDefinition{
		DisplayName: "Replica Zone Level Soft Anti-Affinity",
		Description: "Allow scheduling new Replicas of Volume to the Nodes in the same Zone as existing healthy Replicas. Nodes don't belong to any Zone will be treated as in the same Zone. Notice that Longhorn relies on label `topology.kubernetes.io/zone=<Zone name of the node>` in the Kubernetes node object to identify the zone.",
		Category:    SettingCategoryScheduling,
		Type:        SettingTypeBool,
		Required:    true,
		ReadOnly:    false,
		Default:     "true",
	}
	SettingDefinitionVolumeAttachmentRecoveryPolicy = SettingDefinition{
		DisplayName: "Volume Attachment Recovery Policy",
		Description: "Defines the Longhorn action when a Volume is stuck with a Deployment Pod on a failed node.\n" +
			"- **wait** leads to the deletion of the volume attachment as soon as the pods deletion time has passed.\n" +
			"- **never** is the default Kubernetes behavior of never deleting volume attachments on terminating pods.\n" +
			"- **immediate** leads to the deletion of the volume attachment as soon as all workload pods are pending.\n",
		Category: SettingCategoryGeneral,
		Type:     SettingTypeDeprecated,
		Required: true,
		ReadOnly: false,
		Default:  string(VolumeAttachmentRecoveryPolicyWait),
		Choices: []string{
			string(VolumeAttachmentRecoveryPolicyNever),
			string(VolumeAttachmentRecoveryPolicyWait),
			string(VolumeAttachmentRecoveryPolicyImmediate),
		},
	}
	SettingDefinitionNodeDownPodDeletionPolicy = SettingDefinition{
		DisplayName: "Pod Deletion Policy When Node is Down",
		Description: "Defines the Longhorn action when a Volume is stuck with a StatefulSet/Deployment Pod on a node that is down.\n" +
			"- **do-nothing** is the default Kubernetes behavior of never force deleting StatefulSet/Deployment terminating pods. Since the pod on the node that is down isn't removed, Longhorn volumes are stuck on nodes that are down.\n" +
			"- **delete-statefulset-pod** Longhorn will force delete StatefulSet terminating pods on nodes that are down to release Longhorn volumes so that Kubernetes can spin up replacement pods.\n" +
			"- **delete-deployment-pod** Longhorn will force delete Deployment terminating pods on nodes that are down to release Longhorn volumes so that Kubernetes can spin up replacement pods.\n" +
			"- **delete-both-statefulset-and-deployment-pod** Longhorn will force delete StatefulSet/Deployment terminating pods on nodes that are down to release Longhorn volumes so that Kubernetes can spin up replacement pods.\n",
		Category: SettingCategoryGeneral,
		Type:     SettingTypeString,
		Required: true,
		ReadOnly: false,
		Default:  string(NodeDownPodDeletionPolicyDoNothing),
		Choices: []string{
			string(NodeDownPodDeletionPolicyDoNothing),
			string(NodeDownPodDeletionPolicyDeleteStatefulSetPod),
			string(NodeDownPodDeletionPolicyDeleteDeploymentPod),
			string(NodeDownPodDeletionPolicyDeleteBothStatefulsetAndDeploymentPod),
		},
	}

	SettingDefinitionAllowNodeDrainWithLastHealthyReplica = SettingDefinition{
		DisplayName: "Allow Node Drain with the Last Healthy Replica",
		Description: "By default, Longhorn will block `kubectl drain` action on a node if the node contains the last healthy replica of a volume.\n\n" +
			"If this setting is enabled, Longhorn will **not** block `kubectl drain` action on a node even if the node contains the last healthy replica of a volume.",
		Category: SettingCategoryGeneral,
		Type:     SettingTypeBool,
		Required: true,
		ReadOnly: false,
		Default:  "false",
	}

	SettingDefinitionMkfsExt4Parameters = SettingDefinition{
		DisplayName: "Custom mkfs.ext4 parameters",
		Description: "Allows setting additional filesystem creation parameters for ext4. For older host kernels it might be necessary to disable the optional ext4 metadata_csum feature by specifying `-O ^64bit,^metadata_csum`",
		Category:    SettingCategoryGeneral,
		Type:        SettingTypeString,
		Required:    false,
		ReadOnly:    false,
	}
	SettingDefinitionPriorityClass = SettingDefinition{
		DisplayName: "Priority Class",
		Description: "The name of the Priority Class to set on the Longhorn components. This can help prevent Longhorn components from being evicted under Node Pressure. \n" +
			"Longhorn system contains user deployed components (e.g, Longhorn manager, Longhorn driver, Longhorn UI) and system managed components (e.g, instance manager, engine image, CSI driver, etc.) " +
			"Note that this setting only sets Priority Class for system managed components. " +
			"Depending on how you deployed Longhorn, you need to set Priority Class for user deployed components in Helm chart or deployment YAML file. \n" +
			"WARNING: DO NOT CHANGE THIS SETTING WITH ATTACHED VOLUMES.",
		Category: SettingCategoryDangerZone,
		Required: false,
		ReadOnly: false,
	}
	SettingDefinitionDisableRevisionCounter = SettingDefinition{
		DisplayName: "Disable Revision Counter",
		Description: "This setting is only for volumes created by UI. By default, this is false meaning there will be a revision counter file to track every write to the volume. During salvage recovering Longhorn will pick the repica with largest revision counter as candidate to recover the whole volume. If revision counter is disabled, Longhorn will not track every write to the volume. During the salvage recovering, Longhorn will use the 'volume-head-xxx.img' file last modification time and file size to pick the replica candidate to recover the whole volume.",
		Category:    SettingCategoryGeneral,
		Type:        SettingTypeBool,
		Required:    true,
		ReadOnly:    false,
		Default:     "false",
	}
	SettingDefinitionDisableReplicaRebuild = SettingDefinition{
		DisplayName: "Disable Replica Rebuild",
		Description: "This setting disable replica rebuild cross the whole cluster, eviction and data locality feature won't work if this setting is true. But doesn't have any impact to any current replica rebuild and restore disaster recovery volume.",
		Category:    SettingCategoryDangerZone,
		Type:        SettingTypeDeprecated,
		Required:    true,
		ReadOnly:    false,
		Default:     "false",
	}

	SettingDefinitionReplicaReplenishmentWaitInterval = SettingDefinition{
		DisplayName: "Replica Replenishment Wait Interval",
		Description: "In seconds. The interval determines how long Longhorn will wait at least in order to reuse the existing data on a failed replica rather than directly creating a new replica for a degraded volume.\n" +
			"Warning: This option works only when there is a failed replica in the volume. And this option may block the rebuilding for a while in the case.",
		Category: SettingCategoryGeneral,
		Type:     SettingTypeInt,
		Required: true,
		ReadOnly: false,
		Default:  "600",
	}

	SettingDefinitionConcurrentReplicaRebuildPerNodeLimit = SettingDefinition{
		DisplayName: "Concurrent Replica Rebuild Per Node Limit",
		Description: "This setting controls how many replicas on a node can be rebuilt simultaneously. \n\n" +
			"Typically, Longhorn can block the replica starting once the current rebuilding count on a node exceeds the limit. But when the value is 0, it means disabling the replica rebuilding. \n\n" +
			"WARNING: \n\n" +
			"  - The old setting \"Disable Replica Rebuild\" is replaced by this setting. \n\n" +
			"  - Different from relying on replica starting delay to limit the concurrent rebuilding, if the rebuilding is disabled, replica object replenishment will be directly skipped. \n\n" +
			"  - When the value is 0, the eviction and data locality feature won't work. But this shouldn't have any impact to any current replica rebuild and backup restore.",
		Category: SettingCategoryDangerZone,
		Type:     SettingTypeInt,
		Required: true,
		ReadOnly: false,
		Default:  "5",
	}

	SettingDefinitionSystemManagedPodsImagePullPolicy = SettingDefinition{
		DisplayName: "System Managed Pod Image Pull Policy",
		Description: "This setting defines the Image Pull Policy of Longhorn system managed pods, e.g. instance manager, engine image, CSI driver, etc. " +
			"The new Image Pull Policy will only apply after the system managed pods restart.",
		Category: SettingCategoryGeneral,
		Type:     SettingTypeString,
		Required: true,
		ReadOnly: false,
		Default:  string(SystemManagedPodsImagePullPolicyIfNotPresent),
		Choices: []string{
			string(SystemManagedPodsImagePullPolicyIfNotPresent),
			string(SystemManagedPodsImagePullPolicyNever),
			string(SystemManagedPodsImagePullPolicyAlways),
		},
	}

	SettingDefinitionAllowVolumeCreationWithDegradedAvailability = SettingDefinition{
		DisplayName: "Allow Volume Creation with Degraded Availability",
		Description: "This setting allows user to create and attach a volume that doesn't have all the replicas scheduled at the time of creation.",
		Category:    SettingCategoryScheduling,
		Type:        SettingTypeBool,
		Required:    true,
		ReadOnly:    false,
		Default:     "true",
	}

	SettingDefinitionAutoCleanupSystemGeneratedSnapshot = SettingDefinition{
		DisplayName: "Automatically Cleanup System Generated Snapshot",
		Description: "This setting enables Longhorn to automatically cleanup the system generated snapshot after replica rebuild is done.",
		Category:    SettingCategoryGeneral,
		Type:        SettingTypeBool,
		Required:    true,
		ReadOnly:    false,
		Default:     "true",
	}

	SettingDefinitionConcurrentAutomaticEngineUpgradePerNodeLimit = SettingDefinition{
		DisplayName: "Concurrent Automatic Engine Upgrade Per Node Limit",
		Description: "This setting controls how Longhorn automatically upgrades volumes' engines after upgrading Longhorn manager. " +
			"The value of this setting specifies the maximum number of engines per node that are allowed to upgrade to the default engine image at the same time. " +
			"If the value is 0, Longhorn will not automatically upgrade volumes' engines to default version.",
		Category: SettingCategoryGeneral,
		Type:     SettingTypeInt,
		Required: true,
		ReadOnly: false,
		Default:  "0",
	}

	SettingDefinitionBackingImageCleanupWaitInterval = SettingDefinition{
		DisplayName: "Backing Image Cleanup Wait Interval",
		Description: "In minutes. The interval determines how long Longhorn will wait before cleaning up the backing image file when there is no replica in the disk using it.",
		Category:    SettingCategoryGeneral,
		Type:        SettingTypeInt,
		Required:    true,
		ReadOnly:    false,
		Default:     "60",
	}

	SettingDefinitionBackingImageRecoveryWaitInterval = SettingDefinition{
		DisplayName: "Backing Image Recovery Wait Interval",
		Description: "In seconds. The interval determines how long Longhorn will wait before re-downloading the backing image file when all disk files of this backing image become failed or unknown. \n\n" +
			"WARNING: \n\n" +
			"  - This recovery only works for the backing image of which the creation type is \"download\". \n\n" +
			"  - File state \"unknown\" means the related manager pods on the pod is not running or the node itself is down/disconnected.",
		Category: SettingCategoryGeneral,
		Type:     SettingTypeInt,
		Required: true,
		ReadOnly: false,
		Default:  "300",
	}

	SettingDefinitionGuaranteedEngineManagerCPU = SettingDefinition{
		DisplayName: "Guaranteed Engine Manager CPU",
		Description: "This integer value indicates how many percentage of the total allocatable CPU on each node will be reserved for each engine manager Pod. For example, 10 means 10% of the total CPU on a node will be allocated to each engine manager pod on this node. This will help maintain engine stability during high node workload. \n\n" +
			"In order to prevent unexpected volume engine crash as well as guarantee a relative acceptable IO performance, you can use the following formula to calculate a value for this setting: \n\n" +
			"Guaranteed Engine Manager CPU = The estimated max Longhorn volume engine count on a node * 0.1 / The total allocatable CPUs on the node * 100. \n\n" +
			"The result of above calculation doesn't mean that's the maximum CPU resources the Longhorn workloads require. To fully exploit the Longhorn volume I/O performance, you can allocate/guarantee more CPU resources via this setting. \n\n" +
			"If it's hard to estimate the usage now, you can leave it with the default value, which is 12%. Then you can tune it when there is no running workload using Longhorn volumes. \n\n" +
			"WARNING: \n\n" +
			"  - Value 0 means unsetting CPU requests for engine manager pods. \n\n" +
			"  - Considering the possible new instance manager pods in the further system upgrade, this integer value is range from 0 to 40. And the sum with setting 'Guaranteed Engine Manager CPU' should not be greater than 40. \n\n" +
			"  - One more set of instance manager pods may need to be deployed when the Longhorn system is upgraded. If current available CPUs of the nodes are not enough for the new instance manager pods, you need to detach the volumes using the oldest instance manager pods so that Longhorn can clean up the old pods automatically and release the CPU resources. And the new pods with the latest instance manager image will be launched then. \n\n" +
			"  - This global setting will be ignored for a node if the field \"EngineManagerCPURequest\" on the node is set. \n\n" +
			"  - After this setting is changed, all engine manager pods using this global setting on all the nodes will be automatically restarted. In other words, DO NOT CHANGE THIS SETTING WITH ATTACHED VOLUMES. \n\n",
		Category: SettingCategoryDangerZone,
		Type:     SettingTypeString,
		Required: true,
		ReadOnly: false,
		Default:  "12",
	}

	SettingDefinitionGuaranteedReplicaManagerCPU = SettingDefinition{
		DisplayName: "Guaranteed Replica Manager CPU",
		Description: "This integer value indicates how many percentage of the total allocatable CPU on each node will be reserved for each replica manager Pod. 10 means 10% of the total CPU on a node will be allocated to each replica manager pod on this node. This will help maintain replica stability during high node workload. \n\n" +
			"In order to prevent unexpected volume replica crash as well as guarantee a relative acceptable IO performance, you can use the following formula to calculate a value for this setting: \n\n" +
			"Guaranteed Replica Manager CPU = The estimated max Longhorn volume replica count on a node * 0.1 / The total allocatable CPUs on the node * 100. \n\n" +
			"The result of above calculation doesn't mean that's the maximum CPU resources the Longhorn workloads require. To fully exploit the Longhorn volume I/O performance, you can allocate/guarantee more CPU resources via this setting. \n\n" +
			"If it's hard to estimate the usage now, you can leave it with the default value, which is 12%. Then you can tune it when there is no running workload using Longhorn volumes. \n\n" +
			"WARNING: \n\n" +
			"  - Value 0 means unsetting CPU requests for replica manager pods. \n\n" +
			"  - Considering the possible new instance manager pods in the further system upgrade, this integer value is range from 0 to 40. And the sum with setting 'Guaranteed Replica Manager CPU' should not be greater than 40. \n\n" +
			"  - One more set of instance manager pods may need to be deployed when the Longhorn system is upgraded. If current available CPUs of the nodes are not enough for the new instance manager pods, you need to detach the volumes using the oldest instance manager pods so that Longhorn can clean up the old pods automatically and release the CPU resources. And the new pods with the latest instance manager image will be launched then. \n\n" +
			"  - This global setting will be ignored for a node if the field \"ReplicaManagerCPURequest\" on the node is set. \n\n" +
			"  - After this setting is changed, all replica manager pods using this global setting on all the nodes will be automatically restarted. In other words, DO NOT CHANGE THIS SETTING WITH ATTACHED VOLUMES. \n\n",
		Category: SettingCategoryDangerZone,
		Type:     SettingTypeString,
		Required: true,
		ReadOnly: false,
		Default:  "12",
	}
)
View Source
var (
	LonghornSystemKey = "longhorn"
)
View Source
var (
	SettingNameList = []SettingName{
		SettingNameBackupTarget,
		SettingNameBackupTargetCredentialSecret,
		SettingNameAllowRecurringJobWhileVolumeDetached,
		SettingNameCreateDefaultDiskLabeledNodes,
		SettingNameDefaultDataPath,
		SettingNameDefaultEngineImage,
		SettingNameDefaultInstanceManagerImage,
		SettingNameDefaultShareManagerImage,
		SettingNameDefaultBackingImageManagerImage,
		SettingNameReplicaSoftAntiAffinity,
		SettingNameReplicaAutoBalance,
		SettingNameStorageOverProvisioningPercentage,
		SettingNameStorageMinimalAvailablePercentage,
		SettingNameUpgradeChecker,
		SettingNameLatestLonghornVersion,
		SettingNameStableLonghornVersions,
		SettingNameDefaultReplicaCount,
		SettingNameDefaultDataLocality,
		SettingNameGuaranteedEngineCPU,
		SettingNameDefaultLonghornStaticStorageClass,
		SettingNameBackupstorePollInterval,
		SettingNameTaintToleration,
		SettingNameSystemManagedComponentsNodeSelector,
		SettingNameCRDAPIVersion,
		SettingNameAutoSalvage,
		SettingNameAutoDeletePodWhenVolumeDetachedUnexpectedly,
		SettingNameRegistrySecret,
		SettingNameDisableSchedulingOnCordonedNode,
		SettingNameReplicaZoneSoftAntiAffinity,
		SettingNameVolumeAttachmentRecoveryPolicy,
		SettingNameNodeDownPodDeletionPolicy,
		SettingNameAllowNodeDrainWithLastHealthyReplica,
		SettingNameMkfsExt4Parameters,
		SettingNamePriorityClass,
		SettingNameDisableRevisionCounter,
		SettingNameDisableReplicaRebuild,
		SettingNameReplicaReplenishmentWaitInterval,
		SettingNameConcurrentReplicaRebuildPerNodeLimit,
		SettingNameSystemManagedPodsImagePullPolicy,
		SettingNameAllowVolumeCreationWithDegradedAvailability,
		SettingNameAutoCleanupSystemGeneratedSnapshot,
		SettingNameConcurrentAutomaticEngineUpgradePerNodeLimit,
		SettingNameBackingImageCleanupWaitInterval,
		SettingNameBackingImageRecoveryWaitInterval,
		SettingNameGuaranteedEngineManagerCPU,
		SettingNameGuaranteedReplicaManagerCPU,
	}
)

Functions

func CreateDefaultDisk

func CreateDefaultDisk(dataPath string) (map[string]DiskSpec, error)

func CreateDisksFromAnnotation

func CreateDisksFromAnnotation(annotation string) (map[string]DiskSpec, error)

func EngineBinaryExistOnHostForImage

func EngineBinaryExistOnHostForImage(image string) bool

func ErrorAlreadyExists

func ErrorAlreadyExists(err error) bool

func ErrorIsNotFound

func ErrorIsNotFound(err error) bool

func GenerateEngineNameForVolume

func GenerateEngineNameForVolume(vName string) string

func GenerateReplicaNameForVolume

func GenerateReplicaNameForVolume(vName string) string

func GetAPIServerAddressFromIP

func GetAPIServerAddressFromIP(ip string) string

func GetBackingImageDataSourceLabels

func GetBackingImageDataSourceLabels(name, nodeID, diskUUID string) map[string]string

func GetBackingImageDataSourcePodName

func GetBackingImageDataSourcePodName(bidsName string) string

func GetBackingImageDirectoryName

func GetBackingImageDirectoryName(backingImageName, backingImageUUID string) string

func GetBackingImageDirectoryOnHost

func GetBackingImageDirectoryOnHost(diskPath, backingImageName, backingImageUUID string) string

func GetBackingImageLabels

func GetBackingImageLabels() map[string]string

func GetBackingImageManagerDirectoryOnHost

func GetBackingImageManagerDirectoryOnHost(diskPath string) string

func GetBackingImageManagerLabels

func GetBackingImageManagerLabels(nodeID, diskUUID string) map[string]string

func GetBackingImageManagerName

func GetBackingImageManagerName(image, diskUUID string) string

func GetBackingImagePathForReplicaManagerContainer

func GetBackingImagePathForReplicaManagerContainer(diskPath, backingImageName, backingImageUUID string) string

func GetBackupVolumeLabels

func GetBackupVolumeLabels(volumeName string) map[string]string

func GetBaseLabelsForSystemManagedComponent

func GetBaseLabelsForSystemManagedComponent() map[string]string

func GetCronJobLabels

func GetCronJobLabels(job *RecurringJobSpec) map[string]string

func GetCronJobNameForRecurringJob

func GetCronJobNameForRecurringJob(name string) string

func GetCronJobNameForVolumeAndJob

func GetCronJobNameForVolumeAndJob(vName, job string) string

func GetCustomizedDefaultSettings

func GetCustomizedDefaultSettings() (map[string]string, error)

func GetDaemonSetNameFromEngineImageName

func GetDaemonSetNameFromEngineImageName(engineImageName string) string

func GetDefaultManagerURL

func GetDefaultManagerURL() string

func GetEIDaemonSetLabelSelector

func GetEIDaemonSetLabelSelector(engineImageName string) map[string]string

GetEIDaemonSetLabelSelector returns labels for engine image daemonset's Spec.Selector.MatchLabels

func GetEngineBinaryDirectoryForEngineManagerContainer

func GetEngineBinaryDirectoryForEngineManagerContainer(image string) string

func GetEngineBinaryDirectoryForReplicaManagerContainer

func GetEngineBinaryDirectoryForReplicaManagerContainer(image string) string

func GetEngineBinaryDirectoryOnHostForImage

func GetEngineBinaryDirectoryOnHostForImage(image string) string

func GetEngineImageChecksumName

func GetEngineImageChecksumName(image string) string

func GetEngineImageComponentLabel

func GetEngineImageComponentLabel() map[string]string

func GetEngineImageLabels

func GetEngineImageLabels(engineImageName string) map[string]string

func GetEngineImageNameFromDaemonSetName

func GetEngineImageNameFromDaemonSetName(dsName string) string

func GetImageCanonicalName

func GetImageCanonicalName(image string) string

func GetInstanceManagerComponentLabel

func GetInstanceManagerComponentLabel() map[string]string

func GetInstanceManagerImageChecksumName

func GetInstanceManagerImageChecksumName(image string) string

func GetInstanceManagerLabels

func GetInstanceManagerLabels(node, instanceManagerImage string, managerType InstanceManagerType) map[string]string

func GetInstanceManagerName

func GetInstanceManagerName(imType InstanceManagerType) (string, error)

func GetInstanceManagerPrefix

func GetInstanceManagerPrefix(imType InstanceManagerType) string

func GetLonghornLabelComponentKey

func GetLonghornLabelComponentKey() string

func GetLonghornLabelKey

func GetLonghornLabelKey(name string) string

func GetNodeTagsFromAnnotation

func GetNodeTagsFromAnnotation(annotation string) ([]string, error)

func GetRecurringJobLabelKey

func GetRecurringJobLabelKey(labelType, recurringJobName string) string

func GetRecurringJobLabelValueMap

func GetRecurringJobLabelValueMap(labelType, recurringJobName string) map[string]string

func GetRegionAndZone

func GetRegionAndZone(labels map[string]string) (string, string)

func GetReplicaDataPath

func GetReplicaDataPath(diskPath, dataDirectoryName string) string

func GetReplicaMountedDataPath

func GetReplicaMountedDataPath(dataPath string) string

func GetShareManagerComponentLabel

func GetShareManagerComponentLabel() map[string]string

func GetShareManagerImageChecksumName

func GetShareManagerImageChecksumName(image string) string

func GetShareManagerInstanceLabel

func GetShareManagerInstanceLabel(name string) map[string]string

func GetShareManagerLabels

func GetShareManagerLabels(name, image string) map[string]string

func GetShareManagerNameFromShareManagerPodName

func GetShareManagerNameFromShareManagerPodName(podName string) string

func GetShareManagerPodNameFromShareManagerName

func GetShareManagerPodNameFromShareManagerName(smName string) string

func GetVolumeLabels

func GetVolumeLabels(volumeName string) map[string]string

func IsValidVolumeDataSource

func IsValidVolumeDataSource(vds VolumeDataSource) bool

func LabelsToString

func LabelsToString(labels map[string]string) string

func OverwriteBuiltInSettingsWithCustomizedValues

func OverwriteBuiltInSettingsWithCustomizedValues() error

func SetCondition

func SetCondition(originConditions map[string]Condition, conditionType string, conditionValue ConditionStatus, reason, message string) map[string]Condition

func SetConditionAndRecord

func SetConditionAndRecord(conditions map[string]Condition, conditionType string, conditionValue ConditionStatus,
	reason, message string, eventRecorder record.EventRecorder, obj runtime.Object, eventtype string) map[string]Condition

func UnmarshalNodeSelector

func UnmarshalNodeSelector(nodeSelectorSetting string) (map[string]string, error)

func UnmarshalToNodeTags

func UnmarshalToNodeTags(s string) ([]string, error)

UnmarshalToNodeTags input format should be: `["worker1","enabled"]`

func UnmarshalTolerations

func UnmarshalTolerations(tolerationSetting string) ([]v1.Toleration, error)

func ValidateAccessMode

func ValidateAccessMode(mode AccessMode) error

func ValidateAndUnmarshalToleration

func ValidateAndUnmarshalToleration(s string) (*v1.Toleration, error)

func ValidateCPUReservationValues

func ValidateCPUReservationValues(engineManagerCPUStr, replicaManagerCPUStr string) error

func ValidateDataLocality

func ValidateDataLocality(mode DataLocality) error

func ValidateEngineImageChecksumName

func ValidateEngineImageChecksumName(name string) bool

func ValidateInitSetting

func ValidateInitSetting(name, value string) (err error)

func ValidateReplicaAutoBalance

func ValidateReplicaAutoBalance(option ReplicaAutoBalance) error

func ValidateReplicaCount

func ValidateReplicaCount(count int) error

Types

type AccessMode

type AccessMode string

type BackingImageDataSourceSpec

type BackingImageDataSourceSpec struct {
	NodeID          string                     `json:"nodeID"`
	DiskUUID        string                     `json:"diskUUID"`
	DiskPath        string                     `json:"diskPath"`
	Checksum        string                     `json:"checksum"`
	SourceType      BackingImageDataSourceType `json:"sourceType"`
	Parameters      map[string]string          `json:"parameters"`
	FileTransferred bool                       `json:"fileTransferred"`
}

func (*BackingImageDataSourceSpec) DeepCopyInto

type BackingImageDataSourceStatus

type BackingImageDataSourceStatus struct {
	OwnerID           string            `json:"ownerID"`
	RunningParameters map[string]string `json:"runningParameters"`
	CurrentState      BackingImageState `json:"currentState"`
	Size              int64             `json:"size"`
	Progress          int               `json:"progress"`
	Checksum          string            `json:"checksum"`
	Message           string            `json:"message"`
}

func (*BackingImageDataSourceStatus) DeepCopyInto

type BackingImageDataSourceType

type BackingImageDataSourceType string

type BackingImageDiskFileStatus

type BackingImageDiskFileStatus struct {
	State                   BackingImageState `json:"state"`
	Progress                int               `json:"progress"`
	Message                 string            `json:"message"`
	LastStateTransitionTime string            `json:"lastStateTransitionTime"`
}

type BackingImageDownloadState

type BackingImageDownloadState string

BackingImageDownloadState is replaced by BackingImageState.

type BackingImageFileInfo

type BackingImageFileInfo struct {
	Name                 string            `json:"name"`
	UUID                 string            `json:"uuid"`
	Size                 int64             `json:"size"`
	State                BackingImageState `json:"state"`
	CurrentChecksum      string            `json:"currentChecksum"`
	Message              string            `json:"message"`
	SendingReference     int               `json:"sendingReference"`
	SenderManagerAddress string            `json:"senderManagerAddress"`
	Progress             int               `json:"progress"`

	// Deprecated: This field is useless now. The manager of backing image files doesn't care if a file is downloaded and how.
	URL string `json:"url"`
	// Deprecated: This field is useless.
	Directory string `json:"directory"`
	// Deprecated: This field is renamed to `Progress`.
	DownloadProgress int `json:"downloadProgress"`
}

type BackingImageManagerSpec

type BackingImageManagerSpec struct {
	Image         string            `json:"image"`
	NodeID        string            `json:"nodeID"`
	DiskUUID      string            `json:"diskUUID"`
	DiskPath      string            `json:"diskPath"`
	BackingImages map[string]string `json:"backingImages"`
}

func (*BackingImageManagerSpec) DeepCopyInto

func (bim *BackingImageManagerSpec) DeepCopyInto(to *BackingImageManagerSpec)

type BackingImageManagerState

type BackingImageManagerState string

type BackingImageManagerStatus

type BackingImageManagerStatus struct {
	OwnerID             string                          `json:"ownerID"`
	CurrentState        BackingImageManagerState        `json:"currentState"`
	BackingImageFileMap map[string]BackingImageFileInfo `json:"backingImageFileMap"`
	IP                  string                          `json:"ip"`
	APIMinVersion       int                             `json:"apiMinVersion"`
	APIVersion          int                             `json:"apiVersion"`
}

func (*BackingImageManagerStatus) DeepCopyInto

type BackingImageSpec

type BackingImageSpec struct {
	Disks            map[string]struct{}        `json:"disks"`
	Checksum         string                     `json:"checksum"`
	SourceType       BackingImageDataSourceType `json:"sourceType"`
	SourceParameters map[string]string          `json:"sourceParameters"`

	// Deprecated: This kind of info will be included in the related BackingImageDataSource.
	ImageURL string `json:"imageURL"`
}

func (*BackingImageSpec) DeepCopyInto

func (bi *BackingImageSpec) DeepCopyInto(to *BackingImageSpec)

type BackingImageState

type BackingImageState string

type BackingImageStatus

type BackingImageStatus struct {
	OwnerID           string                                 `json:"ownerID"`
	UUID              string                                 `json:"uuid"`
	Size              int64                                  `json:"size"`
	Checksum          string                                 `json:"checksum"`
	DiskFileStatusMap map[string]*BackingImageDiskFileStatus `json:"diskFileStatusMap"`
	DiskLastRefAtMap  map[string]string                      `json:"diskLastRefAtMap"`

	// Deprecated: Replaced by field `State` in `DiskFileStatusMap`.
	DiskDownloadStateMap map[string]BackingImageDownloadState `json:"diskDownloadStateMap"`
	// Deprecated: Replaced by field `Progress` in `DiskFileStatusMap`.
	DiskDownloadProgressMap map[string]int `json:"diskDownloadProgressMap"`
}

func (*BackingImageStatus) DeepCopyInto

func (bi *BackingImageStatus) DeepCopyInto(to *BackingImageStatus)

type BackupState

type BackupState string

type BackupStatus

type BackupStatus struct {
	Progress       int    `json:"progress"`
	BackupURL      string `json:"backupURL,omitempty"`
	Error          string `json:"error,omitempty"`
	SnapshotName   string `json:"snapshotName"`
	State          string `json:"state"`
	ReplicaAddress string `json:"replicaAddress"`
}

type BackupTargetSpec

type BackupTargetSpec struct {
	BackupTargetURL  string          `json:"backupTargetURL"`
	CredentialSecret string          `json:"credentialSecret"`
	PollInterval     metav1.Duration `json:"pollInterval"`
	SyncRequestedAt  time.Time       `json:"syncRequestedAt"`
}

func (*BackupTargetSpec) DeepCopyInto

func (in *BackupTargetSpec) DeepCopyInto(out *BackupTargetSpec)

type BackupTargetStatus

type BackupTargetStatus struct {
	OwnerID      string               `json:"ownerID"`
	Available    bool                 `json:"available"`
	Conditions   map[string]Condition `json:"conditions"`
	LastSyncedAt time.Time            `json:"lastSyncedAt"`
}

func (*BackupTargetStatus) DeepCopyInto

func (in *BackupTargetStatus) DeepCopyInto(out *BackupTargetStatus)

type BackupVolumeSpec

type BackupVolumeSpec struct {
	SyncRequestedAt time.Time `json:"syncRequestedAt"`
}

func (*BackupVolumeSpec) DeepCopyInto

func (in *BackupVolumeSpec) DeepCopyInto(out *BackupVolumeSpec)

type BackupVolumeStatus

type BackupVolumeStatus struct {
	OwnerID              string            `json:"ownerID"`
	LastModificationTime time.Time         `json:"lastModificationTime"`
	Size                 string            `json:"size"`
	Labels               map[string]string `json:"labels"`
	CreatedAt            string            `json:"createdAt"`
	LastBackupName       string            `json:"lastBackupName"`
	LastBackupAt         string            `json:"lastBackupAt"`
	DataStored           string            `json:"dataStored"`
	Messages             map[string]string `json:"messages"`
	BackingImageName     string            `json:"backingImageName"`
	BackingImageChecksum string            `json:"backingImageChecksum"`
	LastSyncedAt         time.Time         `json:"lastSyncedAt"`
}

func (*BackupVolumeStatus) DeepCopyInto

func (in *BackupVolumeStatus) DeepCopyInto(out *BackupVolumeStatus)

type Condition

type Condition struct {
	Type               string          `json:"type"`
	Status             ConditionStatus `json:"status"`
	LastProbeTime      string          `json:"lastProbeTime"`
	LastTransitionTime string          `json:"lastTransitionTime"`
	Reason             string          `json:"reason"`
	Message            string          `json:"message"`
}

func GetCondition

func GetCondition(conditions map[string]Condition, conditionType string) Condition

GetCondition returns a copy of conditions[conditionType], and automatically fill the unknown condition

type ConditionStatus

type ConditionStatus string
const (
	ConditionStatusTrue    ConditionStatus = "True"
	ConditionStatusFalse   ConditionStatus = "False"
	ConditionStatusUnknown ConditionStatus = "Unknown"
)

type DataLocality

type DataLocality string

type DiskSpec

type DiskSpec struct {
	Path              string   `json:"path"`
	AllowScheduling   bool     `json:"allowScheduling"`
	EvictionRequested bool     `json:"evictionRequested"`
	StorageReserved   int64    `json:"storageReserved"`
	Tags              []string `json:"tags"`
}

type DiskSpecWithName

type DiskSpecWithName struct {
	DiskSpec
	Name string `json:"name"`
}

func UnmarshalToDisks

func UnmarshalToDisks(s string) (ret []DiskSpecWithName, err error)

type DiskStatus

type DiskStatus struct {
	Conditions       map[string]Condition `json:"conditions"`
	StorageAvailable int64                `json:"storageAvailable"`
	StorageScheduled int64                `json:"storageScheduled"`
	StorageMaximum   int64                `json:"storageMaximum"`
	ScheduledReplica map[string]int64     `json:"scheduledReplica"`
	DiskUUID         string               `json:"diskUUID"`
}

func (*DiskStatus) DeepCopyInto

func (n *DiskStatus) DeepCopyInto(to *DiskStatus)

type EngineImageSpec

type EngineImageSpec struct {
	Image string `json:"image"`
}

type EngineImageState

type EngineImageState string

type EngineImageStatus

type EngineImageStatus struct {
	OwnerID           string               `json:"ownerID"`
	State             EngineImageState     `json:"state"`
	RefCount          int                  `json:"refCount"`
	NoRefSince        string               `json:"noRefSince"`
	Conditions        map[string]Condition `json:"conditions"`
	NodeDeploymentMap map[string]bool      `json:"nodeDeploymentMap"`

	EngineVersionDetails
}

func (*EngineImageStatus) DeepCopyInto

func (ei *EngineImageStatus) DeepCopyInto(to *EngineImageStatus)

type EngineSpec

type EngineSpec struct {
	InstanceSpec
	Frontend                  VolumeFrontend    `json:"frontend"`
	ReplicaAddressMap         map[string]string `json:"replicaAddressMap"`
	UpgradedReplicaAddressMap map[string]string `json:"upgradedReplicaAddressMap"`
	BackupVolume              string            `json:"backupVolume"`
	RequestedBackupRestore    string            `json:"requestedBackupRestore"`
	RequestedDataSource       VolumeDataSource  `json:"requestedDataSource"`
	DisableFrontend           bool              `json:"disableFrontend"`
	RevisionCounterDisabled   bool              `json:"revisionCounterDisabled"`
}

func (*EngineSpec) DeepCopyInto

func (e *EngineSpec) DeepCopyInto(to *EngineSpec)

type EngineStatus

type EngineStatus struct {
	InstanceStatus
	CurrentSize              int64                           `json:"currentSize,string"`
	CurrentReplicaAddressMap map[string]string               `json:"currentReplicaAddressMap"`
	ReplicaModeMap           map[string]ReplicaMode          `json:"replicaModeMap"`
	Endpoint                 string                          `json:"endpoint"`
	LastRestoredBackup       string                          `json:"lastRestoredBackup"`
	BackupStatus             map[string]*BackupStatus        `json:"backupStatus"`
	RestoreStatus            map[string]*RestoreStatus       `json:"restoreStatus"`
	PurgeStatus              map[string]*PurgeStatus         `json:"purgeStatus"`
	RebuildStatus            map[string]*RebuildStatus       `json:"rebuildStatus"`
	CloneStatus              map[string]*SnapshotCloneStatus `json:"cloneStatus"`
	Snapshots                map[string]*Snapshot            `json:"snapshots"`
	SnapshotsError           string                          `json:"snapshotsError"`
	IsExpanding              bool                            `json:"isExpanding"`
	LastExpansionError       string                          `json:"lastExpansionError"`
	LastExpansionFailedAt    string                          `json:"lastExpansionFailedAt"`
}

func (*EngineStatus) DeepCopyInto

func (e *EngineStatus) DeepCopyInto(to *EngineStatus)

type EngineVersionDetails

type EngineVersionDetails struct {
	Version   string `json:"version"`
	GitCommit string `json:"gitCommit"`
	BuildDate string `json:"buildDate"`

	CLIAPIVersion           int `json:"cliAPIVersion"`
	CLIAPIMinVersion        int `json:"cliAPIMinVersion"`
	ControllerAPIVersion    int `json:"controllerAPIVersion"`
	ControllerAPIMinVersion int `json:"controllerAPIMinVersion"`
	DataFormatVersion       int `json:"dataFormatVersion"`
	DataFormatMinVersion    int `json:"dataFormatMinVersion"`
}

type InstanceManagerSpec

type InstanceManagerSpec struct {
	Image  string              `json:"image"`
	NodeID string              `json:"nodeID"`
	Type   InstanceManagerType `json:"type"`

	// TODO: deprecate this field
	EngineImage string `json:"engineImage"`
}

type InstanceManagerState

type InstanceManagerState string

type InstanceManagerStatus

type InstanceManagerStatus struct {
	OwnerID       string                     `json:"ownerID"`
	CurrentState  InstanceManagerState       `json:"currentState"`
	Instances     map[string]InstanceProcess `json:"instances"`
	IP            string                     `json:"ip"`
	APIMinVersion int                        `json:"apiMinVersion"`
	APIVersion    int                        `json:"apiVersion"`
}

func (*InstanceManagerStatus) DeepCopyInto

func (n *InstanceManagerStatus) DeepCopyInto(to *InstanceManagerStatus)

type InstanceManagerType

type InstanceManagerType string

type InstanceProcess

type InstanceProcess struct {
	Spec   InstanceProcessSpec   `json:"spec"`
	Status InstanceProcessStatus `json:"status"`
}

type InstanceProcessSpec

type InstanceProcessSpec struct {
	Name string `json:"name"`
}

type InstanceProcessStatus

type InstanceProcessStatus struct {
	Endpoint        string        `json:"endpoint"`
	ErrorMsg        string        `json:"errorMsg"`
	Listen          string        `json:"listen"`
	PortEnd         int32         `json:"portEnd"`
	PortStart       int32         `json:"portStart"`
	State           InstanceState `json:"state"`
	Type            InstanceType  `json:"type"`
	ResourceVersion int64         `json:"resourceVersion"`
}

type InstanceSpec

type InstanceSpec struct {
	VolumeName       string        `json:"volumeName"`
	VolumeSize       int64         `json:"volumeSize,string"`
	NodeID           string        `json:"nodeID"`
	EngineImage      string        `json:"engineImage"`
	DesireState      InstanceState `json:"desireState"`
	LogRequested     bool          `json:"logRequested"`
	SalvageRequested bool          `json:"salvageRequested"`
}

type InstanceState

type InstanceState string

type InstanceStatus

type InstanceStatus struct {
	OwnerID             string        `json:"ownerID"`
	InstanceManagerName string        `json:"instanceManagerName"`
	CurrentState        InstanceState `json:"currentState"`
	CurrentImage        string        `json:"currentImage"`
	IP                  string        `json:"ip"`
	Port                int           `json:"port"`
	Started             bool          `json:"started"`
	LogFetched          bool          `json:"logFetched"`
	SalvageExecuted     bool          `json:"salvageExecuted"`
}

type InstanceType

type InstanceType string

type KubernetesStatus

type KubernetesStatus struct {
	PVName   string `json:"pvName"`
	PVStatus string `json:"pvStatus"`

	// determine if PVC/Namespace is history or not
	Namespace    string `json:"namespace"`
	PVCName      string `json:"pvcName"`
	LastPVCRefAt string `json:"lastPVCRefAt"`

	// determine if Pod/Workload is history or not
	WorkloadsStatus []WorkloadStatus `json:"workloadsStatus"`
	LastPodRefAt    string           `json:"lastPodRefAt"`
}

type NodeDownPodDeletionPolicy

type NodeDownPodDeletionPolicy string

type NodeSpec

type NodeSpec struct {
	Name                     string              `json:"name"`
	Disks                    map[string]DiskSpec `json:"disks"`
	AllowScheduling          bool                `json:"allowScheduling"`
	EvictionRequested        bool                `json:"evictionRequested"`
	Tags                     []string            `json:"tags"`
	EngineManagerCPURequest  int                 `json:"engineManagerCPURequest"`
	ReplicaManagerCPURequest int                 `json:"replicaManagerCPURequest"`
}

func (*NodeSpec) DeepCopyInto

func (n *NodeSpec) DeepCopyInto(to *NodeSpec)

type NodeStatus

type NodeStatus struct {
	Conditions map[string]Condition   `json:"conditions"`
	DiskStatus map[string]*DiskStatus `json:"diskStatus"`
	Region     string                 `json:"region"`
	Zone       string                 `json:"zone"`
}

func (*NodeStatus) DeepCopyInto

func (n *NodeStatus) DeepCopyInto(to *NodeStatus)

type NotFoundError

type NotFoundError struct {
	Name string
}

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

type PurgeStatus

type PurgeStatus struct {
	Error     string `json:"error"`
	IsPurging bool   `json:"isPurging"`
	Progress  int    `json:"progress"`
	State     string `json:"state"`
}

type RebuildStatus

type RebuildStatus struct {
	Error              string `json:"error"`
	IsRebuilding       bool   `json:"isRebuilding"`
	Progress           int    `json:"progress"`
	State              string `json:"state"`
	FromReplicaAddress string `json:"fromReplicaAddress"`
}

type RecurringJob

type RecurringJob struct {
	Name        string            `json:"name"`
	Groups      []string          `json:"groups,omitempty"`
	Task        RecurringJobType  `json:"task"`
	Cron        string            `json:"cron"`
	Retain      int               `json:"retain"`
	Concurrency int               `json:"concurrency"`
	Labels      map[string]string `json:"labels,omitempty"`
}

RecurringJob is a deprecated struct. TODO: Should be removed when recurringJobs gets removed from the volume spec.

type RecurringJobSpec

type RecurringJobSpec struct {
	Name        string            `json:"name"`
	Groups      []string          `json:"groups,omitempty"`
	Task        RecurringJobType  `json:"task"`
	Cron        string            `json:"cron"`
	Retain      int               `json:"retain"`
	Concurrency int               `json:"concurrency"`
	Labels      map[string]string `json:"labels,omitempty"`
}

func (*RecurringJobSpec) DeepCopyInto

func (in *RecurringJobSpec) DeepCopyInto(out *RecurringJobSpec)

type RecurringJobStatus

type RecurringJobStatus struct {
	OwnerID string `json:"ownerID"`
}

type RecurringJobType

type RecurringJobType string

type ReplicaAutoBalance

type ReplicaAutoBalance string

type ReplicaMode

type ReplicaMode string

type ReplicaSpec

type ReplicaSpec struct {
	InstanceSpec
	EngineName              string `json:"engineName"`
	HealthyAt               string `json:"healthyAt"`
	FailedAt                string `json:"failedAt"`
	DiskID                  string `json:"diskID"`
	DiskPath                string `json:"diskPath"`
	DataDirectoryName       string `json:"dataDirectoryName"`
	BackingImage            string `json:"backingImage"`
	Active                  bool   `json:"active"`
	HardNodeAffinity        string `json:"hardNodeAffinity"`
	RevisionCounterDisabled bool   `json:"revisionCounterDisabled"`
	RebuildRetryCount       int    `json:"rebuildRetryCount"`

	// Deprecated
	DataPath string `json:"dataPath"`
	// Deprecated. Rename to BackingImage
	BaseImage string `json:"baseImage"`
}

type ReplicaStatus

type ReplicaStatus struct {
	InstanceStatus
	EvictionRequested bool `json:"evictionRequested"`
}

type RestoreStatus

type RestoreStatus struct {
	IsRestoring            bool   `json:"isRestoring"`
	LastRestored           string `json:"lastRestored"`
	CurrentRestoringBackup string `json:"currentRestoringBackup"`
	Progress               int    `json:"progress,omitempty"`
	Error                  string `json:"error,omitempty"`
	Filename               string `json:"filename,omitempty"`
	State                  string `json:"state"`
	BackupURL              string `json:"backupURL"`
}

type Setting

type Setting struct {
	Value string `json:"value"`
}

type SettingCategory

type SettingCategory string

type SettingDefinition

type SettingDefinition struct {
	DisplayName string          `json:"displayName"`
	Description string          `json:"description"`
	Category    SettingCategory `json:"category"`
	Type        SettingType     `json:"type"`
	Required    bool            `json:"required"`
	ReadOnly    bool            `json:"readOnly"`
	Default     string          `json:"default"`
	Choices     []string        `json:"options,omitempty"` // +optional
}

type SettingName

type SettingName string

type SettingType

type SettingType string

type ShareManagerSpec

type ShareManagerSpec struct {
	Image string `json:"image"`
}

type ShareManagerState

type ShareManagerState string

type ShareManagerStatus

type ShareManagerStatus struct {
	OwnerID  string            `json:"ownerID"`
	State    ShareManagerState `json:"state"`
	Endpoint string            `json:"endpoint"`
}

type Snapshot

type Snapshot struct {
	Name        string            `json:"name"`
	Parent      string            `json:"parent"`
	Children    map[string]bool   `json:"children"`
	Removed     bool              `json:"removed"`
	UserCreated bool              `json:"usercreated"`
	Created     string            `json:"created"`
	Size        string            `json:"size"`
	Labels      map[string]string `json:"labels"`
}

type SnapshotBackupSpec

type SnapshotBackupSpec struct {
	SyncRequestedAt time.Time         `json:"syncRequestedAt"`
	SnapshotName    string            `json:"snapshotName"`
	Labels          map[string]string `json:"labels"`
}

func (*SnapshotBackupSpec) DeepCopyInto

func (in *SnapshotBackupSpec) DeepCopyInto(out *SnapshotBackupSpec)

type SnapshotBackupStatus

type SnapshotBackupStatus struct {
	OwnerID                string            `json:"ownerID"`
	State                  BackupState       `json:"state"`
	URL                    string            `json:"url"`
	SnapshotName           string            `json:"snapshotName"`
	SnapshotCreatedAt      string            `json:"snapshotCreatedAt"`
	BackupCreatedAt        string            `json:"backupCreatedAt"`
	Size                   string            `json:"size"`
	Labels                 map[string]string `json:"labels"`
	Messages               map[string]string `json:"messages"`
	VolumeName             string            `json:"volumeName"`
	VolumeSize             string            `json:"volumeSize"`
	VolumeCreated          string            `json:"volumeCreated"`
	VolumeBackingImageName string            `json:"volumeBackingImageName"`
	LastSyncedAt           time.Time         `json:"lastSyncedAt"`
}

func (*SnapshotBackupStatus) DeepCopyInto

func (in *SnapshotBackupStatus) DeepCopyInto(out *SnapshotBackupStatus)

type SnapshotCloneStatus

type SnapshotCloneStatus struct {
	IsCloning          bool   `json:"isCloning"`
	Error              string `json:"error"`
	Progress           int    `json:"progress"`
	State              string `json:"state"`
	FromReplicaAddress string `json:"fromReplicaAddress"`
	SnapshotName       string `json:"snapshotName"`
}

type SystemManagedPodsImagePullPolicy

type SystemManagedPodsImagePullPolicy string

type VolumeAttachmentRecoveryPolicy

type VolumeAttachmentRecoveryPolicy string

type VolumeCloneState

type VolumeCloneState string

type VolumeCloneStatus

type VolumeCloneStatus struct {
	SourceVolume string           `json:"sourceVolume"`
	Snapshot     string           `json:"snapshot"`
	State        VolumeCloneState `json:"state"`
}

type VolumeDataSource

type VolumeDataSource string

func NewVolumeDataSource

func NewVolumeDataSource(volumeDataSourceType string, parameters map[string]string) (dataSource VolumeDataSource, err error)

func NewVolumeDataSourceTypeSnapshot

func NewVolumeDataSourceTypeSnapshot(volumeName, snapshotName string) VolumeDataSource

func NewVolumeDataSourceTypeVolume

func NewVolumeDataSourceTypeVolume(volumeName string) VolumeDataSource

func (VolumeDataSource) GetSnapshotName

func (vds VolumeDataSource) GetSnapshotName() string

func (VolumeDataSource) GetType

func (vds VolumeDataSource) GetType() string

func (VolumeDataSource) GetVolumeName

func (vds VolumeDataSource) GetVolumeName() string

func (VolumeDataSource) IsDataFromVolume

func (vds VolumeDataSource) IsDataFromVolume() bool

func (VolumeDataSource) ToString

func (vds VolumeDataSource) ToString() string

type VolumeFrontend

type VolumeFrontend string

type VolumeRecurringJob

type VolumeRecurringJob struct {
	Name    string `json:"name"`
	IsGroup bool   `json:"isGroup"`
}

type VolumeRobustness

type VolumeRobustness string

type VolumeSpec

type VolumeSpec struct {
	Size                    int64            `json:"size,string"`
	Frontend                VolumeFrontend   `json:"frontend"`
	FromBackup              string           `json:"fromBackup"`
	DataSource              VolumeDataSource `json:"dataSource"`
	DataLocality            DataLocality     `json:"dataLocality"`
	StaleReplicaTimeout     int              `json:"staleReplicaTimeout"`
	NodeID                  string           `json:"nodeID"`
	MigrationNodeID         string           `json:"migrationNodeID"`
	EngineImage             string           `json:"engineImage"`
	BackingImage            string           `json:"backingImage"`
	Standby                 bool             `json:"Standby"`
	DiskSelector            []string         `json:"diskSelector"`
	NodeSelector            []string         `json:"nodeSelector"`
	DisableFrontend         bool             `json:"disableFrontend"`
	RevisionCounterDisabled bool             `json:"revisionCounterDisabled"`
	LastAttachedBy          string           `json:"lastAttachedBy"`
	AccessMode              AccessMode       `json:"accessMode"`
	Migratable              bool             `json:"migratable"`

	Encrypted bool `json:"encrypted"`

	NumberOfReplicas   int                `json:"numberOfReplicas"`
	ReplicaAutoBalance ReplicaAutoBalance `json:"replicaAutoBalance"`

	// Deprecated. Rename to BackingImage
	BaseImage string `json:"baseImage"`

	// Deprecated. Replaced by a separate resource named "RecurringJob"
	RecurringJobs []RecurringJob `json:"recurringJobs,omitempty"`
}

func (*VolumeSpec) DeepCopyInto

func (v *VolumeSpec) DeepCopyInto(to *VolumeSpec)

type VolumeState

type VolumeState string

type VolumeStatus

type VolumeStatus struct {
	OwnerID            string               `json:"ownerID"`
	State              VolumeState          `json:"state"`
	Robustness         VolumeRobustness     `json:"robustness"`
	CurrentNodeID      string               `json:"currentNodeID"`
	CurrentImage       string               `json:"currentImage"`
	KubernetesStatus   KubernetesStatus     `json:"kubernetesStatus"`
	Conditions         map[string]Condition `json:"conditions"`
	LastBackup         string               `json:"lastBackup"`
	LastBackupAt       string               `json:"lastBackupAt"`
	PendingNodeID      string               `json:"pendingNodeID"`
	FrontendDisabled   bool                 `json:"frontendDisabled"`
	RestoreRequired    bool                 `json:"restoreRequired"`
	RestoreInitiated   bool                 `json:"restoreInitiated"`
	CloneStatus        VolumeCloneStatus    `json:"cloneStatus"`
	RemountRequestedAt string               `json:"remountRequestedAt"`
	ExpansionRequired  bool                 `json:"expansionRequired"`
	IsStandby          bool                 `json:"isStandby"`
	ActualSize         int64                `json:"actualSize"`
	LastDegradedAt     string               `json:"lastDegradedAt"`
	ShareEndpoint      string               `json:"shareEndpoint"`
	ShareState         ShareManagerState    `json:"shareState"`
}

func (*VolumeStatus) DeepCopyInto

func (v *VolumeStatus) DeepCopyInto(to *VolumeStatus)

type WorkloadStatus

type WorkloadStatus struct {
	PodName      string `json:"podName"`
	PodStatus    string `json:"podStatus"`
	WorkloadName string `json:"workloadName"`
	WorkloadType string `json:"workloadType"`
}

Jump to

Keyboard shortcuts

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