mounter

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FuseTypeLabelKey          = "csi.alibabacloud.com/fuse-type"
	FuseVolumeIdLabelKey      = "csi.alibabacloud.com/volume-id"
	FuseMountPathHashLabelKey = "csi.alibabacloud.com/mount-path-hash"
	FuseMountPathAnnoKey      = "csi.alibabacloud.com/mount-path"
	FuseSafeToEvictAnnoKey    = "cluster-autoscaler.kubernetes.io/safe-to-evict"
)
View Source
const (
	AuthTypeSTS  = "sts"
	AuthTypeRRSA = "rrsa"
	AuthTypeCSS  = "csi-secret-store"
)
View Source
const (
	OssfsCredentialSecretName = "csi-ossfs-credentials"
	OssfsDefMimeTypesFilePath = "/etc/mime.types"
	OssfsCsiMimeTypesFilePath = "/etc/csi-mime.types"

	CsiSecretStoreDriver   = "secrets-store.csi.k8s.io"
	SecretProviderClassKey = "secretProviderClass"
)
View Source
const TotalAnnotationSizeLimitB int = 128 * (1 << 10) // 128 kB

https://github.com/kubernetes/kubernetes/blob/b5ba7bc4f5f49760c821cae2f152a8000922e72e/staging/src/k8s.io/apimachinery/pkg/api/validation/objectmeta.go#L36 TotalAnnotationSizeLimitB only takes 128 kB here, and the rest is reserved for the default annotations.

Variables

This section is empty.

Functions

func CleanupOssfsCredentialSecret

func CleanupOssfsCredentialSecret(ctx context.Context, clientset kubernetes.Interface, node, volumeId string) error

func GetArn added in v1.4.0

func GetArn(provider, accountId, roleName string) (oidcProviderArn, roleArn string)

GetArn get rrsa config for fuse contianer's env setting

func GetOIDCProvider added in v1.4.0

func GetOIDCProvider(clusterId string) string

GetOIDCProvider get OIDC provider from env or ACK clusterId for RRSA

func NewConnectorMounter

func NewConnectorMounter(inner mountutils.Interface, mounterPath string) mountutils.Interface

func SetupOssfsCredentialSecret

func SetupOssfsCredentialSecret(ctx context.Context, clientset kubernetes.Interface, node, volumeId, bucket, akId, akSecret string) error

func ValidateAnnotations added in v1.4.0

func ValidateAnnotations(annotations map[string]string) error

Copy from https://github.com/kubernetes/kubernetes/blob/b5ba7bc4f5f49760c821cae2f152a8000922e72e/staging/src/k8s.io/apimachinery/pkg/api/validation/objectmeta.go#L43 ValidateAnnotations validates that a set of annotations are correctly defined.

func ValidateKey added in v1.4.0

func ValidateKey(k string) error

func ValidateLabelValue added in v1.4.0

func ValidateLabelValue(k, v string) error

func ValidateLabels added in v1.4.0

func ValidateLabels(labels map[string]string) error

Copy from https://github.com/kubernetes/kubernetes/blob/b5ba7bc4f5f49760c821cae2f152a8000922e72e/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/validation/validation.go#L105 ValidateLabels validates that a set of labels are correctly defined.

Types

type AuthConfig added in v1.4.0

type AuthConfig struct {
	AuthType string
	// for RRSA
	RrsaConfig *RrsaConfig
	// for csi-secret-store
	SecretProviderClassName string
}

type ConnectorMounter

type ConnectorMounter struct {
	mountutils.Interface
	// contains filtered or unexported fields
}

func (*ConnectorMounter) Mount

func (m *ConnectorMounter) Mount(source string, target string, fstype string, options []string) error

type ContainerizedFuseMounter

type ContainerizedFuseMounter struct {
	FuseMounterType
	mountutils.Interface
	// contains filtered or unexported fields
}

func (*ContainerizedFuseMounter) Mount

func (mounter *ContainerizedFuseMounter) Mount(source string, target string, fstype string, options []string) error

func (*ContainerizedFuseMounter) Unmount

func (mounter *ContainerizedFuseMounter) Unmount(target string) error

type ContainerizedFuseMounterFactory

type ContainerizedFuseMounterFactory struct {
	// contains filtered or unexported fields
}

func NewContainerizedFuseMounterFactory

func NewContainerizedFuseMounterFactory(
	fuseType FuseMounterType,
	client kubernetes.Interface,
	nodeName string,
) *ContainerizedFuseMounterFactory

func (*ContainerizedFuseMounterFactory) NewFuseMounter

func (fac *ContainerizedFuseMounterFactory) NewFuseMounter(
	ctx context.Context, volumeId string, authCfg *AuthConfig, atomic bool) *ContainerizedFuseMounter

NewFuseMounter creates a mounter for the volume id. When atomic is true, mount operations are responsible for cleaning up inflight fuse pods in case a timeout error occurs. This implies that mount operations will either succeed when the fuse pod is ready, or fail and ensure that no fuse pods are left behind.

type FuseContainerConfig

type FuseContainerConfig struct {
	Resources   corev1.ResourceRequirements
	Image       string
	Annotations map[string]string
	Labels      map[string]string
	Extra       map[string]string
}

type FuseMounterType

type FuseMounterType interface {
	// contains filtered or unexported methods
}

func NewFuseOssfs

func NewFuseOssfs(configmap *corev1.ConfigMap, m metadata.MetadataProvider) FuseMounterType

type RrsaConfig added in v1.4.0

type RrsaConfig struct {
	OidcProviderArn    string
	RoleArn            string
	ServiceAccountName string
}

Jump to

Keyboard shortcuts

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