Documentation ¶
Overview ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- Variables
- func CheckExpectValue(m map[string]string, key string, targetValue string) bool
- func CriticalFusePodEnabled() bool
- func GetDatasetNumLabelName() string
- func GetDefaultTieredStoreOrder(MediumType MediumType) (order int)
- func IsFluidNativeScheme(s string) bool
- func IsFluidWebScheme(s string) bool
- func PortCheckEnabled() bool
- type AdmissionHandler
- type CacheStateList
- type CacheStateName
- type CacheStoreType
- type Category
- type ConditionType
- type FluidApplication
- type FluidObject
- type FluidUFSScheme
- type FuseInjectionTemplate
- type FuseSidecarInjectOption
- type ImageInfo
- type InitPortCheck
- type InitUsers
- type LabelToModify
- type LabelsToModify
- type MediumType
- type OperationType
- type OwnerReference
- type Phase
- type ReadType
- type ResourceList
- type Resources
- type RuntimeIdentity
- type RuntimeRole
- type StorageType
- type UserInfo
- type VolumeType
Constants ¶
const ( AlluxioRuntime = "alluxio" AlluxioMountType = "fuse.alluxio-fuse" AlluxioChart = AlluxioRuntime DefaultInitImageEnv = "DEFAULT_INIT_IMAGE_ENV" AlluxioRuntimeImageEnv = "ALLUXIO_RUNTIME_IMAGE_ENV" AlluxioFuseImageEnv = "ALLUXIO_FUSE_IMAGE_ENV" DefaultAlluxioRuntimeImage = "registry.cn-huhehaote.aliyuncs.com/alluxio/alluxio:2.3.0-SNAPSHOT-2c41226" DefaultAlluxioFuseImage = "registry.cn-huhehaote.aliyuncs.com/alluxio/alluxio-fuse:2.3.0-SNAPSHOT-2c41226" )
Runtime for Alluxio
const ( ErrorCreateDataset = "ErrorCreateDataset" ErrorProcessDatasetReason = "ErrorProcessDataset" ErrorDeleteDataset = "ErrorDeleteDataset" ErrorProcessRuntimeReason = "ErrorProcessRuntime" ErrorHelmInstall = "ErrorHelmInstall" TargetDatasetNotFound = "TargetDatasetNotFound" TargetDatasetPathNotFound = "TargetDatasetPathNotFound" TargetDatasetNotReady = "TargetDatasetNotReady" TargetDatasetNamespaceNotSame = "TargetDatasetNamespaceNotSame" DataLoadCollision = "DataLoadCollision" RuntimeNotReady = "RuntimeNotReady" DataLoadJobStarted = "DataLoadJobStarted" DataLoadJobFailed = "DataLoadJobFailed" DataLoadJobComplete = "DataLoadJobComplete" DataBackupFailed = "DataBackupFailed" DataBackupComplete = "DataBackupComplete" RuntimeScaleInFailed = "RuntimeScaleInFailed" Succeed = "Succeed" FuseRecoverFailed = "FuseRecoverFailed" FuseRecoverSucceed = "FuseRecoverSucceed" RuntimeDeprecated = "RuntimeDeprecated" )
Reason for Fluid events
const ( EnvFuseDeviceResourceName string = "VFUSE_RESOURCE_NAME" DefaultFuseDeviceResourceName string = "fluid.io/fuse" )
const ( RootDirPath = "/" DefaultImagePullPolicy = "IfNotPresent" MyPodNamespace = "MY_POD_NAMESPACE" True = "true" False = "false" InjectServerless = "serverless" + inject InjectFuseSidecar = "fuse" + injectSidecar InjectUnprivilegedFuseSidecar = "unprivileged" + injectSidecar InjectCacheDir = "cachedir" + injectSidecar InjectWorkerSidecar = "worker" + injectSidecar InjectSidecarDone = "done" + injectSidecar App = "app" InjectAppPostStart = "app.poststart" + inject EnvServerlessPlatformKey = "KEY_SERVERLESS_PLATFORM" EnvServerlessPlatformVal = "VALUE_SERVERLESS_PLATFORM" EnvDisableApplicationController = "KEY_DISABLE_APP_CONTROLLER" NamespaceFluidSystem = "fluid-system" EnvImagePullSecretsKey = "IMAGE_PULL_SECRETS" )
const ( EnvTimeTrack = "TIME_TRACK" EnvTimeTrackDebug = "TIME_TRACK_DEBUG" EnvDisableInjection = "DISABLE_INJECTION" EnvRuntimeInfoCacheSize = "RUNTIMEINFO_CACHE_SIZE" EnvEnableRuntimeInfoCache = "ENABLE_RUNTIMEINFO_CACHE" EnvRuntimeInfoCacheTTL = "RUNTIMEINFO_CACHE_TTL" )
const ( GooseFSRuntime = "goosefs" GooseFSMountType = "fuse.goosefs-fuse" GooseFSNamespace = "goosefs-system" GooseFSChart = GooseFSRuntime GooseFSRuntimeImageEnv = "GOOSEFS_RUNTIME_IMAGE_ENV" GooseFSFuseImageEnv = "GOOSEFS_FUSE_IMAGE_ENV" DefaultGooseFSRuntimeImage = "ccr.ccs.tencentyun.com/qcloud/goosefs:v1.2.0" DefaultGooseFSFuseImage = "ccr.ccs.tencentyun.com/qcloud/goosefs-fuse:v1.2.0" )
Runtime for Alluxio
const ( JindoRuntime = "jindo" JindoChartName = "jindofs" JindoMountType = "fuse.jindofs-fuse" JINDO_SMARTDATA_IMAGE_ENV = "JINDO_SMARTDATA_IMAGE_ENV" JINDO_FUSE_IMAGE_ENV = "JINDO_FUSE_IMAGE_ENV" JINDO_DNS_SERVER = "JINDO_DNS_SERVER_ENV" JindoFuseMountVolumeName = "jindofs-fuse-mount" )
Runtime for JindoFS
const ( JuiceFSRuntime = "juicefs" JuiceFSMountType = "JuiceFS" JuiceFSNamespace = "juicefs-system" JuiceFSChart = JuiceFSRuntime JuiceFSFuseImageEnv = "JUICEFS_FUSE_IMAGE_ENV" DefaultJuiceFSFuseImage = "juicedata/juicefs-fuse:v1.0.0" DefaultJuiceFSRuntimeImage = "juicedata/juicefs-fuse:v1.0.0" JuiceFSCeMountPath = "/bin/mount.juicefs" JuiceFSMountPath = "/sbin/mount.juicefs" JuiceCeCliPath = "/usr/local/bin/juicefs" JuiceCliPath = "/usr/bin/juicefs" JuiceFSFuseContainer = "juicefs-fuse" JuiceFSWorkerContainer = "juicefs-worker" JuiceFSDefaultCacheDir = "/var/jfsCache" )
Runtime for Juice
const ( // LabelAnnotationPrefix is the prefix of every labels and annotations added by the controller. LabelAnnotationPrefix = "fluid.io/" // The format is fluid.io/s-{runtime_type}-{data_set_name}, s means storage LabelAnnotationStorageCapacityPrefix = LabelAnnotationPrefix + "s-" // LabelAnnotationFusePrefix is the prefix for the fuse annotation. The annotation follows // fluid.io/f-{runtime type}-{dataset name}, in which f means fuse LabelAnnotationFusePrefix = LabelAnnotationPrefix + "f-" // The dataset annotation LabelAnnotationDataset = LabelAnnotationPrefix + "dataset" // LabelAnnotationDatasetNum indicates the number of the dataset in specific node LabelAnnotationDatasetNum = LabelAnnotationPrefix + "dataset-num" // fluid adminssion webhook inject flag EnableFluidInjectionFlag = LabelAnnotationPrefix + "enable-injection" RuntimeControllerReplicas = "controller.runtime." + LabelAnnotationPrefix + "replicas" )
const ( FluidFuseBalloonKey = "fluid_fuse_balloon" FluidBalloonValue = "true" )
const ( VolumeAttrFluidPath = "fluid_path" VolumeAttrMountType = "mount_type" VolumeAttrNamespace = "runtime_namespace" VolumeAttrName = "runtime_name" CSIDriver = "fuse.csi.fluid.io" Fluid = "fluid" )
const ( WebhookName = "fluid-pod-admission-webhook" WebhookServiceName = "fluid-pod-admission-webhook" WebhookSchedulePodPath = "mutate-fluid-io-v1alpha1-schedulepod" CertSecretName = "fluid-webhook-certs" )
const (
DefaultInitImage = "registry.cn-hangzhou.aliyuncs.com/fluid/init-users:v0.3.0-1467caa"
)
const (
FluidExclusiveKey string = "fluid_exclusive"
)
const RecommendedKubeConfigPathEnv = "KUBECONFIG"
Variables ¶
var ( // alluxio ufs root path AlluxioMountPathFormat = RootDirPath + "%s" AlluxioLocalStorageRootPath = "/underFSStorage" AlluxioLocalStoragePathFormat = AlluxioLocalStorageRootPath + "/%s" )
var ( // goosefs ufs root path GooseFSMountPathFormat = RootDirPath + "%s" GooseFSLocalStorageRootPath = "/underFSStorage" GooseFSLocalStoragePathFormat = GooseFSLocalStorageRootPath + "/%s" )
var ( FluidStorageClass = Fluid FuseContainerName = "fluid-fuse" InitFuseContainerName = "init-fluid-fuse" FuseMountEnv = "FLUID_FUSE_MOUNTPOINT" )
var (
ExpectedFluidAnnotations = map[string]string{
"CreatedBy": "fluid",
}
)
var ( // fluid cache label for scheduling pod, format: 'fluid.io/dataset.{dataset name}.sched]' LabelAnnotationPodSchedRegex = regexp.MustCompile("^" + LabelAnnotationDataset + "\\.([A-Za-z0-9.-]*)\\.sched$") )
Functions ¶
func CheckExpectValue ¶ added in v0.6.0
Check if the key has the expected value
func CriticalFusePodEnabled ¶ added in v0.7.0
func CriticalFusePodEnabled() bool
func GetDatasetNumLabelName ¶ added in v0.6.0
func GetDatasetNumLabelName() string
func GetDefaultTieredStoreOrder ¶
func GetDefaultTieredStoreOrder(MediumType MediumType) (order int)
GetDefaultTieredStoreOrder get the TieredStoreOrder from the default Map because the crd has validated the value, It's not possible to meet unknown MediumType
func IsFluidNativeScheme ¶ added in v0.6.0
func IsFluidWebScheme ¶ added in v0.6.0
func PortCheckEnabled ¶ added in v0.7.0
func PortCheckEnabled() bool
Types ¶
type AdmissionHandler ¶ added in v0.6.0
AdmissionHandler wrappers admission.Handler, but adding client-go capablities
type CacheStateList ¶
type CacheStateList map[CacheStateName]string
ResourceList is a set of (resource name, quantity) pairs.
type CacheStateName ¶
type CacheStateName string
CacheStateName is the name identifying various cacheStateName in a CacheStateNameList.
const ( // Cached in bytes. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024) Cached CacheStateName = "cached" // Memory, in bytes. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024) // Cacheable CacheStateName = "cacheable" LowWaterMark CacheStateName = "lowWaterMark" // Memory, in bytes. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024) HighWaterMark CacheStateName = "highWaterMark" // NonCacheable size, in bytes (e,g. 5Gi = 5GiB = 5 * 1024 * 1024 * 1024) NonCacheable CacheStateName = "nonCacheable" // Percentage represents the cache percentage over the total data in the underlayer filesystem. // 1.5 = 1500m CachedPercentage CacheStateName = "cachedPercentage" CacheCapacity CacheStateName = "cacheCapacity" // CacheHitRatio defines total cache hit ratio(both local hit and remote hit), it is a metric to learn // how much profit a distributed cache brings. CacheHitRatio CacheStateName = "cacheHitRatio" // LocalHitRatio defines local hit ratio. It represents how many data is requested from local cache worker LocalHitRatio CacheStateName = "localHitRatio" // RemoteHitRatio defines remote hit ratio. It represents how many data is requested from remote cache worker(s). RemoteHitRatio CacheStateName = "remoteHitRatio" // CacheThroughputRatio defines total cache hit throughput ratio, both local hit and remote hit are included. CacheThroughputRatio CacheStateName = "cacheThroughputRatio" // LocalThroughputRatio defines local cache hit throughput ratio. LocalThroughputRatio CacheStateName = "localThroughputRatio" // RemoteThroughputRatio defines remote cache hit throughput ratio. RemoteThroughputRatio CacheStateName = "remoteThroughputRatio" )
CacheStateName names must be not more than 63 characters, consisting of upper- or lower-case alphanumeric characters, with the -, _, and . characters allowed anywhere, except the first or last character. The default convention, matching that for annotations, is to use lower-case names, with dashes, rather than camel case, separating compound words. Fully-qualified resource typenames are constructed from a DNS-style subdomain, followed by a slash `/` and a name.
type CacheStoreType ¶
type CacheStoreType string
const ( DiskCacheStore CacheStoreType = "Disk" MemoryCacheStore CacheStoreType = "Memory" )
type ConditionType ¶ added in v0.6.0
type ConditionType string
ConditionType is a valid value for Condition.Type
const ( // Complete means the task has completed its execution. Complete ConditionType = "Complete" // Failed means the task has failed its execution. Failed ConditionType = "Failed" )
These are valid conditions of a Task
type FluidApplication ¶ added in v0.7.0
type FluidApplication interface { GetPodSpecs() (specs []FluidObject, err error) SetPodSpecs(specs []FluidObject) (err error) // GetObject gets K8s object which can be consumed by K8s API GetObject() runtime.Object }
The Application which is using Fluid, and it has serveral PodSpecs.
type FluidObject ¶ added in v0.7.0
type FluidObject interface { GetRoot() runtime.Object GetVolumes() (volumes []corev1.Volume, err error) SetVolumes(volumes []corev1.Volume) (err error) GetInitContainers() (containers []corev1.Container, err error) GetContainers() (containers []corev1.Container, err error) SetContainers(containers []corev1.Container) (err error) SetInitContainers(containers []corev1.Container) (err error) GetVolumeMounts() (volumeMounts []corev1.VolumeMount, err error) SetMetaObject(metaObject metav1.ObjectMeta) (err error) GetMetaObject() (metaObject metav1.ObjectMeta, err error) }
FluidObject simulates the V1 Pod Spec, it has v1.volumes, v1.containers inside
type FluidUFSScheme ¶ added in v0.6.0
type FluidUFSScheme string
const ( // native PathScheme FluidUFSScheme = "local://" VolumeScheme FluidUFSScheme = "pvc://" // web HttpScheme FluidUFSScheme = "http://" HttpsScheme FluidUFSScheme = "https://" )
func (FluidUFSScheme) String ¶ added in v0.6.0
func (fns FluidUFSScheme) String() string
type FuseInjectionTemplate ¶ added in v0.7.0
type FuseInjectionTemplate struct { PVCName string SubPath string FuseContainer corev1.Container VolumeMountsToUpdate []corev1.VolumeMount VolumeMountsToAdd []corev1.VolumeMount VolumesToUpdate []corev1.Volume VolumesToAdd []corev1.Volume }
FuseInjectionTemplate for injecting fuse container into the pod
type FuseSidecarInjectOption ¶ added in v0.8.0
FuseSidecarInjectOption are options for webhook to inject fuse sidecar containers
func (FuseSidecarInjectOption) String ¶ added in v0.8.0
func (f FuseSidecarInjectOption) String() string
type ImageInfo ¶ added in v0.6.0
type ImageInfo struct { // Image of a Container Image string `json:"image" yaml:"image"` // ImageTag of a Container ImageTag string `json:"imageTag" yaml:"imageTag"` // ImagePullPolicy is one of the three policies: `Always`, `IfNotPresent`, `Never` ImagePullPolicy string `json:"imagePullPolicy" yaml:"imagePullPolicy"` // ImagePullSecrets ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets" yaml:"imagePullSecrets"` }
ImageInfo to run a Container
type InitPortCheck ¶ added in v0.7.0
type InitPortCheck struct { ImageInfo `yaml:",inline"` Enabled bool `yaml:"enabled,omitempty"` PortsToCheck string `yaml:"portsToCheck,omitempty"` }
InitPortCheck defines a init container reports port status usage
type InitUsers ¶ added in v0.6.0
type InitUsers struct { ImageInfo `yaml:",inline"` EnvUsers string `yaml:"envUsers"` Dir string `yaml:"dir"` Enabled bool `yaml:"enabled,omitempty"` EnvTieredPaths string `yaml:"envTieredPaths"` }
The InitContainer to init the users for other Containers
type LabelToModify ¶ added in v0.6.0
type LabelToModify struct {
// contains filtered or unexported fields
}
LabelToModify modifies the labelKey in operationType.
func (*LabelToModify) GetLabelKey ¶ added in v0.6.0
func (labelToModify *LabelToModify) GetLabelKey() string
func (*LabelToModify) GetLabelValue ¶ added in v0.6.0
func (labelToModify *LabelToModify) GetLabelValue() string
func (*LabelToModify) GetOperationType ¶ added in v0.6.0
func (labelToModify *LabelToModify) GetOperationType() OperationType
type LabelsToModify ¶ added in v0.6.0
type LabelsToModify struct {
// contains filtered or unexported fields
}
func (*LabelsToModify) Add ¶ added in v0.6.0
func (labels *LabelsToModify) Add(labelKey string, labelValue string)
func (*LabelsToModify) Delete ¶ added in v0.6.0
func (labels *LabelsToModify) Delete(labelKey string)
func (*LabelsToModify) GetLabels ¶ added in v0.6.0
func (labels *LabelsToModify) GetLabels() []LabelToModify
func (*LabelsToModify) Update ¶ added in v0.6.0
func (labels *LabelsToModify) Update(labelKey string, labelValue string)
type MediumType ¶
type MediumType string
const ( Memory MediumType = "MEM" SSD MediumType = "SSD" HDD MediumType = "HDD" )
type OperationType ¶ added in v0.6.0
type OperationType string
const ( // AddLabel means adding a new label on the specific node. AddLabel OperationType = "Add" // DeleteLabel means deleting the label of the specific node. DeleteLabel OperationType = "Delete" // UpdateLabel means updating the label value of the specific node. UpdateLabel OperationType = "UpdateValue" )
type OwnerReference ¶ added in v0.7.0
type OwnerReference struct { Enabled bool `json:"enabled" yaml:"enabled"` // API version of the referent. APIVersion string `json:"apiVersion" yaml:"apiVersion"` // Kind of the referent. Kind string `json:"kind" yaml:"kind"` // Name of the referent. Name string `json:"name" yaml:"name"` // UID of the referent. UID string `json:"uid" yaml:"uid"` // If true, this reference points to the managing controller. // +optional Controller bool `json:"controller" yaml:"controller"` // If true, AND if the owner has the "foregroundDeletion" finalizer, then // +optional BlockOwnerDeletion bool `json:"blockOwnerDeletion" yaml:"blockOwnerDeletion"` }
type ResourceList ¶
type ResourceList map[corev1.ResourceName]string
type Resources ¶
type Resources struct { Requests ResourceList `json:"requests,omitempty" yaml:"requests,omitempty"` Limits ResourceList `json:"limits,omitempty" yaml:"limits,omitempty"` }
type RuntimeIdentity ¶ added in v0.8.0
type RuntimeRole ¶
type RuntimeRole string
type StorageType ¶ added in v0.5.0
type StorageType string
const ( MemoryStorageType StorageType = "m-" DiskStorageType StorageType = "d-" TotalStorageType StorageType = "t-" )
type UserInfo ¶ added in v0.6.0
type UserInfo struct { User int `json:"user" yaml:"user"` Group int `json:"group" yaml:"group"` FSGroup int `json:"fsGroup" yaml:"fsGroup"` }
UserInfo to run a Container
type VolumeType ¶ added in v0.8.0
type VolumeType string
const ( VolumeTypeDefault VolumeType = "" VolumeTypeHostPath VolumeType = "hostPath" VolumeTypeEmptyDir VolumeType = "emptyDir" VolumeTypeVolumeTemplate VolumeType = "volumeTemplate" )