juicefs

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2024 License: Apache-2.0 Imports: 49 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BlockCacheBytesOfEnterprise     = "blockcache.bytes"
	BlockCacheHitsOfEnterprise      = "blockcache.hits"
	BlockCacheMissOfEnterprise      = "blockcache.miss"
	BlockCacheHitBytesOfEnterprise  = "blockcache.hitBytes"
	BlockCacheMissBytesOfEnterprise = "blockcache.missBytes"

	BlockCacheBytesOfCommunity     = "juicefs_blockcache_bytes"
	BlockCacheHitsOfCommunity      = "juicefs_blockcache_hits"
	BlockCacheMissOfCommunity      = "juicefs_blockcache_miss"
	BlockCacheHitBytesOfCommunity  = "juicefs_blockcache_hit_bytes"
	BlockCacheMissBytesOfCommunity = "juicefs_blockcache_miss_bytes"

	EnterpriseEdition  = "enterprise"
	CommunityEdition   = "community"
	DefaultMetricsPort = 9567

	MetadataSyncNotDoneMsg               = "[Calculating]"
	CheckMetadataSyncDoneTimeoutMillisec = 500

	DefaultCacheDir = "/var/jfsCache"

	JuiceStorage   = "storage"
	JuiceBucket    = "bucket"
	JuiceBucket2   = "bucket2"
	JuiceMetaUrl   = "metaurl"
	JuiceAccessKey = "access-key"
	JuiceSecretKey = "secret-key"
	JuiceToken     = "token"

	MountPath                 = "mountpath"
	Edition                   = "edition"
	MetaurlSecret             = "metaurlSecret"
	MetaurlSecretKey          = "metaurlSecretKey"
	TokenSecret               = "tokenSecret"
	TokenSecretKey            = "tokenSecretKey"
	AccessKeySecret           = "accesskeySecret"
	AccessKeySecretKey        = "accesskeySecretKey"
	SecretKeySecret           = "secretkeySecret"
	SecretKeySecretKey        = "secretkeySecretKey"
	AccessKey2                = "access-key2"
	SecretKey2                = "secret-key2"
	FormatCmd                 = "formatCmd"
	Name                      = "name"
	DefaultDataLoadTimeout    = "30m"
	DefaultDataMigrateTimeout = "30m"

	NativeVolumeMigratePath = "/mnt/fluid-native/"
)

Variables

This section is empty.

Functions

func GetCacheInfoFromConfigmap added in v0.8.0

func GetCacheInfoFromConfigmap(client client.Client, name string, namespace string) (cacheinfo map[string]string, err error)

GetCacheInfoFromConfigmap get cache info from configmap

func GetFSInfoFromConfigMap added in v0.9.0

func GetFSInfoFromConfigMap(client client.Client, name string, namespace string) (info map[string]string, err error)

func GetMetricsPort added in v0.9.0

func GetMetricsPort(options map[string]string) (int, error)

func GetReservedPorts added in v0.9.0

func GetReservedPorts(client client.Client) (ports []int, err error)

GetReservedPorts defines restoration logic for JuiceFSRuntime

func ParseImageTag added in v0.9.0

func ParseImageTag(imageTag string) (*ClientVersion, *ClientVersion, error)

func ParseSubPathFromMountPoint

func ParseSubPathFromMountPoint(mountPoint string) (string, error)

func Precheck added in v0.8.0

func Precheck(client client.Client, key types.NamespacedName) (found bool, err error)

Types

type ClientVersion added in v0.9.0

type ClientVersion struct {
	Major, Minor, Patch int
	Tag                 string
}

func (*ClientVersion) LessThan added in v0.9.0

func (v *ClientVersion) LessThan(other *ClientVersion) bool

type Configs added in v0.8.0

type Configs struct {
	Name               string             `json:"name"`
	AccessKeySecret    string             `json:"accesskeySecret,omitempty"`
	AccessKeySecretKey string             `json:"accesskeySecretKey,omitempty"`
	SecretKeySecret    string             `json:"secretkeySecret,omitempty"`
	SecretKeySecretKey string             `json:"secretkeySecretKey,omitempty"`
	Bucket             string             `json:"bucket,omitempty"`
	MetaUrlSecret      string             `json:"metaurlSecret,omitempty"`
	MetaUrlSecretKey   string             `json:"metaurlSecretKey,omitempty"`
	TokenSecret        string             `json:"tokenSecret,omitempty"`
	TokenSecretKey     string             `json:"tokenSecretKey,omitempty"`
	Storage            string             `json:"storage,omitempty"`
	FormatCmd          string             `json:"formatCmd,omitempty"`
	QuotaCmd           string             `json:"quotaCmd,omitempty"`
	EncryptEnvOptions  []EncryptEnvOption `json:"encryptEnvOptions,omitempty"`
}

Configs struct describes the config of JuiceFS about the storage, including name, accessKey, bucket, meta url, etc.

type EncryptEnvOption added in v1.0.0

type EncryptEnvOption struct {
	Name             string `json:"name"`    //  name
	EnvName          string `json:"envName"` //  envName
	SecretKeyRefName string `json:"secretKeyRefName"`
	SecretKeyRefKey  string `json:"secretKeyRefKey"`
}

type Fuse

type Fuse struct {
	Privileged      bool                 `json:"privileged"`
	Enabled         bool                 `json:"enabled,omitempty"`
	Image           string               `json:"image,omitempty"`
	NodeSelector    map[string]string    `json:"nodeSelector,omitempty"`
	Envs            []corev1.EnvVar      `json:"envs,omitempty"`
	ImageTag        string               `json:"imageTag,omitempty"`
	ImagePullPolicy string               `json:"imagePullPolicy,omitempty"`
	Resources       common.Resources     `json:"resources,omitempty"`
	CriticalPod     bool                 `json:"criticalPod,omitempty"`
	VolumeMounts    []corev1.VolumeMount `json:"volumeMounts,omitempty"`
	Volumes         []corev1.Volume      `json:"volumes,omitempty"`
	HostNetwork     bool                 `json:"hostNetwork,omitempty"`
	HostPID         bool                 `json:"hostPID,omitempty"`
	MetricsPort     *int                 `json:"metricsPort,omitempty"`

	SubPath       string            `json:"subPath,omitempty"`
	MountPath     string            `json:"mountPath,omitempty"`
	HostMountPath string            `json:"hostMountPath,omitempty"`
	Command       string            `json:"command,omitempty"`
	StatCmd       string            `json:"statCmd,omitempty"`
	Labels        map[string]string `json:"labels,omitempty"`
	Annotations   map[string]string `json:"annotations,omitempty"`
}

Fuse struct holds the configuration of JuiceFS FUSE (File System in User Space).

type JuiceFS

type JuiceFS struct {
	FullnameOverride string `json:"fullnameOverride"`
	Edition          string `json:"edition,omitempty"`
	Source           string `json:"source,omitempty"`

	common.ImageInfo `json:",inline"`
	common.UserInfo  `json:",inline"`

	NodeSelector map[string]string   `json:"nodeSelector,omitempty"`
	Tolerations  []corev1.Toleration `json:"tolerations,omitempty"`
	Configs      Configs             `json:"configs,omitempty"`
	Fuse         Fuse                `json:"fuse,omitempty"`
	Worker       Worker              `json:"worker,omitempty"`

	CacheDirs       map[string]cache       `json:"cacheDirs,omitempty"`
	PlacementMode   string                 `json:"placement,omitempty"`
	Owner           *common.OwnerReference `json:"owner,omitempty"`
	RuntimeIdentity common.RuntimeIdentity `json:"runtimeIdentity,omitempty"`
}

JuiceFS The value json file

type JuiceFSEngine

type JuiceFSEngine struct {
	Log logr.Logger
	client.Client
	Recorder record.EventRecorder

	MetadataSyncDoneCh chan base.MetadataSyncResult

	UnitTest bool

	*ctrl.Helper
	// contains filtered or unexported fields
}

func (*JuiceFSEngine) BindToDataset

func (j *JuiceFSEngine) BindToDataset() (err error)

func (*JuiceFSEngine) CheckAndUpdateRuntimeStatus

func (j *JuiceFSEngine) CheckAndUpdateRuntimeStatus() (ready bool, err error)

CheckAndUpdateRuntimeStatus checks the related runtime status and updates it.

func (JuiceFSEngine) CheckMasterReady

func (j JuiceFSEngine) CheckMasterReady() (ready bool, err error)

func (*JuiceFSEngine) CheckRuntimeHealthy

func (j *JuiceFSEngine) CheckRuntimeHealthy() (err error)

func (*JuiceFSEngine) CheckRuntimeReady

func (j *JuiceFSEngine) CheckRuntimeReady() (ready bool)

func (JuiceFSEngine) CheckWorkersReady

func (j JuiceFSEngine) CheckWorkersReady() (ready bool, err error)

func (*JuiceFSEngine) CreateVolume

func (j *JuiceFSEngine) CreateVolume() (err error)

func (JuiceFSEngine) DeleteVolume

func (j JuiceFSEngine) DeleteVolume() (err error)

func (JuiceFSEngine) FreeStorageBytes

func (j JuiceFSEngine) FreeStorageBytes() (int64, error)

func (*JuiceFSEngine) GetDataOperationValueFile added in v0.9.0

func (j *JuiceFSEngine) GetDataOperationValueFile(ctx cruntime.ReconcileRequestContext, operation dataoperation.OperationInterface) (valueFileName string, err error)

func (*JuiceFSEngine) GetEdition added in v0.8.0

func (j *JuiceFSEngine) GetEdition() (edition string)

func (*JuiceFSEngine) GetPodMetrics

func (j *JuiceFSEngine) GetPodMetrics(podName, containerName string) (metrics string, err error)

GetPodMetrics get juicefs pod metrics

func (*JuiceFSEngine) GetRunningPodsOfDaemonset

func (j *JuiceFSEngine) GetRunningPodsOfDaemonset(dsName string, namespace string) (pods []corev1.Pod, err error)

func (*JuiceFSEngine) GetRunningPodsOfStatefulSet

func (j *JuiceFSEngine) GetRunningPodsOfStatefulSet(stsName string, namespace string) (pods []corev1.Pod, err error)

func (*JuiceFSEngine) GetValuesConfigMap added in v0.8.0

func (j *JuiceFSEngine) GetValuesConfigMap() (cm *corev1.ConfigMap, err error)

func (*JuiceFSEngine) HasDeprecatedCommonLabelName

func (j *JuiceFSEngine) HasDeprecatedCommonLabelName() (deprecated bool, err error)

func (JuiceFSEngine) PrepareUFS

func (j JuiceFSEngine) PrepareUFS() (err error)

func (JuiceFSEngine) SetupMaster

func (j JuiceFSEngine) SetupMaster() (err error)

func (JuiceFSEngine) SetupWorkers

func (j JuiceFSEngine) SetupWorkers() (err error)

func (JuiceFSEngine) ShouldCheckUFS

func (j JuiceFSEngine) ShouldCheckUFS() (should bool, err error)

func (JuiceFSEngine) ShouldSetupMaster

func (j JuiceFSEngine) ShouldSetupMaster() (should bool, err error)

func (JuiceFSEngine) ShouldSetupWorkers

func (j JuiceFSEngine) ShouldSetupWorkers() (should bool, err error)

func (JuiceFSEngine) ShouldUpdateUFS

func (j JuiceFSEngine) ShouldUpdateUFS() (ufsToUpdate *utils.UFSToUpdate)

ShouldUpdateUFS JuiceFSEngine hasn't support UpdateOnUFSChange

func (*JuiceFSEngine) Shutdown

func (j *JuiceFSEngine) Shutdown() (err error)

func (*JuiceFSEngine) SyncMetadata

func (j *JuiceFSEngine) SyncMetadata() (err error)

SyncMetadata syncs metadata if necessary

func (*JuiceFSEngine) SyncReplicas

func (j *JuiceFSEngine) SyncReplicas(ctx cruntime.ReconcileRequestContext) (err error)

SyncReplicas syncs the replicas

func (*JuiceFSEngine) SyncRuntime added in v0.8.0

func (j *JuiceFSEngine) SyncRuntime(ctx cruntime.ReconcileRequestContext) (changed bool, err error)

SyncRuntime syncs the runtime spec

func (*JuiceFSEngine) SyncScheduleInfoToCacheNodes

func (j *JuiceFSEngine) SyncScheduleInfoToCacheNodes() (err error)

func (JuiceFSEngine) TotalFileNums

func (j JuiceFSEngine) TotalFileNums() (int64, error)

func (JuiceFSEngine) TotalStorageBytes

func (j JuiceFSEngine) TotalStorageBytes() (int64, error)

func (*JuiceFSEngine) UpdateCacheOfDataset

func (j *JuiceFSEngine) UpdateCacheOfDataset() (err error)

func (*JuiceFSEngine) UpdateDatasetStatus

func (j *JuiceFSEngine) UpdateDatasetStatus(phase datav1alpha1.DatasetPhase) (err error)

UpdateDatasetStatus updates the status of the dataset

func (JuiceFSEngine) UpdateOnUFSChange

func (j JuiceFSEngine) UpdateOnUFSChange(ufsToUpdate *utils.UFSToUpdate) (ready bool, err error)

func (JuiceFSEngine) UsedStorageBytes

func (j JuiceFSEngine) UsedStorageBytes() (int64, error)

func (*JuiceFSEngine) Validate added in v1.0.2

func (j *JuiceFSEngine) Validate(ctx cruntime.ReconcileRequestContext) (err error)

type Worker

type Worker struct {
	Privileged      bool                 `json:"privileged"`
	Image           string               `json:"image,omitempty"`
	NodeSelector    map[string]string    `json:"nodeSelector,omitempty"`
	ImageTag        string               `json:"imageTag,omitempty"`
	ImagePullPolicy string               `json:"imagePullPolicy,omitempty"`
	Resources       common.Resources     `json:"resources,omitempty"`
	Envs            []corev1.EnvVar      `json:"envs,omitempty"`
	VolumeMounts    []corev1.VolumeMount `json:"volumeMounts,omitempty"`
	Volumes         []corev1.Volume      `json:"volumes,omitempty"`
	HostNetwork     bool                 `json:"hostNetwork,omitempty"`
	MetricsPort     *int                 `json:"metricsPort,omitempty"`

	MountPath   string            `json:"mountPath,omitempty"`
	StatCmd     string            `json:"statCmd,omitempty"`
	Command     string            `json:"command,omitempty"`
	Labels      map[string]string `json:"labels,omitempty"`
	Annotations map[string]string `json:"annotations,omitempty"`
}

Worker struct describes the configuration of JuiceFS worker node, including image, resources, environmental variables, volume mounts, etc.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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