Documentation ¶
Index ¶
- Constants
- Variables
- type Cloud
- type EC2Metadata
- type EC2MetadataClient
- type FSx
- type FakeCloudProvider
- func (c *FakeCloudProvider) CreateFileSystem(ctx context.Context, volumeName string, fileSystemOptions *FileSystemOptions) (fs *FileSystem, err error)
- func (c *FakeCloudProvider) DeleteFileSystem(ctx context.Context, volumeID string) (err error)
- func (c *FakeCloudProvider) DescribeFileSystem(ctx context.Context, volumeID string) (fs *FileSystem, err error)
- func (c *FakeCloudProvider) GetMetadata() MetadataService
- func (c *FakeCloudProvider) ResizeFileSystem(ctx context.Context, volumeName string, newSizeGiB int32) (int32, error)
- func (c *FakeCloudProvider) WaitForFileSystemAvailable(ctx context.Context, fileSystemId string) error
- func (c *FakeCloudProvider) WaitForFileSystemResize(ctx context.Context, fileSystemId string, resizeGiB int32) error
- type FileSystem
- type FileSystemOptions
- type KubernetesAPIClient
- type Metadata
- type MetadataService
Constants ¶
View Source
const ( // DefaultVolumeSize represents the default size used // this is the minimum FSx for Lustre FS size DefaultVolumeSize = 1200 // PollCheckInterval specifies the interval to check if filesystem is ready; // needs to be shorter than the provisioner timeout PollCheckInterval = 30 * time.Second // PollCheckTimeout specifies the time limit for polling DescribeFileSystems // for a completed create/update operation. FSx for Lustre filesystem // creation time is around 5 minutes, and update time varies depending on // target file system values PollCheckTimeout = 10 * time.Minute )
View Source
const (
// VolumeNameTagKey is the key value that refers to the volume's name.
VolumeNameTagKey = "CSIVolumeName"
)
Tags
Variables ¶
View Source
var ( // ErrMultiDisks is an error that is returned when multiple // disks are found with the same volume name. ErrMultiFileSystems = errors.New("Multiple filesystems with same ID") // ErrFsExistsDiffSize is an error that is returned if a filesystem // exists with a given ID, but a different capacity is requested. ErrFsExistsDiffSize = errors.New("There is already a disk with same ID and different size") // ErrNotFound is returned when a resource is not found. ErrNotFound = errors.New("Resource was not found") )
View Source
var DefaultEC2MetadataClient = func() (EC2Metadata, error) { cfg, err := config.LoadDefaultConfig(context.Background()) if err != nil { return nil, err } svc := imds.NewFromConfig(cfg) return &imdsClient{svc}, nil }
View Source
var DefaultKubernetesAPIClient = func() (kubernetes.Interface, error) { config, err := rest.InClusterConfig() if err != nil { return nil, err } clientset, err := kubernetes.NewForConfig(config) if err != nil { return nil, err } return clientset, nil }
Functions ¶
This section is empty.
Types ¶
type Cloud ¶
type Cloud interface { CreateFileSystem(ctx context.Context, volumeName string, fileSystemOptions *FileSystemOptions) (fs *FileSystem, err error) ResizeFileSystem(ctx context.Context, fileSystemId string, newSizeGiB int32) (int32, error) DeleteFileSystem(ctx context.Context, fileSystemId string) (err error) DescribeFileSystem(ctx context.Context, fileSystemId string) (fs *FileSystem, err error) WaitForFileSystemAvailable(ctx context.Context, fileSystemId string) error WaitForFileSystemResize(ctx context.Context, fileSystemId string, resizeGiB int32) error }
type EC2Metadata ¶
type EC2Metadata interface { // ec2 instance metadata endpoints: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html GetMetadata(context.Context, *imds.GetMetadataInput, ...func(*imds.Options)) (*imds.GetMetadataOutput, error) GetInstanceIdentityDocument(context.Context, *imds.GetInstanceIdentityDocumentInput, ...func(*imds.Options)) (*imds.GetInstanceIdentityDocumentOutput, error) }
type EC2MetadataClient ¶ added in v0.10.0
type EC2MetadataClient func() (EC2Metadata, error)
type FSx ¶
type FSx interface { CreateFileSystem(context.Context, *fsx.CreateFileSystemInput, ...func(*fsx.Options)) (*fsx.CreateFileSystemOutput, error) UpdateFileSystem(context.Context, *fsx.UpdateFileSystemInput, ...func(*fsx.Options)) (*fsx.UpdateFileSystemOutput, error) DeleteFileSystem(context.Context, *fsx.DeleteFileSystemInput, ...func(*fsx.Options)) (*fsx.DeleteFileSystemOutput, error) DescribeFileSystems(context.Context, *fsx.DescribeFileSystemsInput, ...func(*fsx.Options)) (*fsx.DescribeFileSystemsOutput, error) }
FSx abstracts FSx client to facilitate its mocking.
type FakeCloudProvider ¶
type FakeCloudProvider struct {
// contains filtered or unexported fields
}
func NewFakeCloudProvider ¶
func NewFakeCloudProvider() *FakeCloudProvider
func (*FakeCloudProvider) CreateFileSystem ¶
func (c *FakeCloudProvider) CreateFileSystem(ctx context.Context, volumeName string, fileSystemOptions *FileSystemOptions) (fs *FileSystem, err error)
func (*FakeCloudProvider) DeleteFileSystem ¶
func (c *FakeCloudProvider) DeleteFileSystem(ctx context.Context, volumeID string) (err error)
func (*FakeCloudProvider) DescribeFileSystem ¶
func (c *FakeCloudProvider) DescribeFileSystem(ctx context.Context, volumeID string) (fs *FileSystem, err error)
func (*FakeCloudProvider) GetMetadata ¶
func (c *FakeCloudProvider) GetMetadata() MetadataService
func (*FakeCloudProvider) ResizeFileSystem ¶
func (*FakeCloudProvider) WaitForFileSystemAvailable ¶
func (c *FakeCloudProvider) WaitForFileSystemAvailable(ctx context.Context, fileSystemId string) error
func (*FakeCloudProvider) WaitForFileSystemResize ¶
type FileSystem ¶
type FileSystem struct { FileSystemId string CapacityGiB int32 DnsName string MountName string StorageType string DeploymentType string PerUnitStorageThroughput int32 }
FileSystem represents a FSx for Lustre filesystem
type FileSystemOptions ¶
type FileSystemOptions struct { CapacityGiB int32 SubnetId string SecurityGroupIds []string AutoImportPolicy string S3ImportPath string S3ExportPath string DeploymentType string KmsKeyId string PerUnitStorageThroughput int32 StorageType string DriveCacheType string DailyAutomaticBackupStartTime string AutomaticBackupRetentionDays int32 CopyTagsToBackups bool DataCompressionType string WeeklyMaintenanceStartTime string FileSystemTypeVersion string ExtraTags []string EfaEnabled bool MetadataConfigurationMode string MetadataIops int32 }
FileSystemOptions represents the options to create FSx for Lustre filesystem
type KubernetesAPIClient ¶ added in v0.10.0
type KubernetesAPIClient func() (kubernetes.Interface, error)
type Metadata ¶ added in v0.10.0
type Metadata struct { InstanceID string InstanceType string Region string AvailabilityZone string }
func EC2MetadataInstanceInfo ¶ added in v0.10.0
func EC2MetadataInstanceInfo(svc EC2Metadata, regionFromSession string) (*Metadata, error)
func KubernetesAPIInstanceInfo ¶ added in v0.10.0
func KubernetesAPIInstanceInfo(clientset kubernetes.Interface) (*Metadata, error)
func (*Metadata) GetAvailabilityZone ¶ added in v0.10.0
GetAvailabilityZone returns the Availability Zone which the instance is in.
func (*Metadata) GetInstanceID ¶ added in v0.10.0
GetInstanceID returns the instance identification.
func (*Metadata) GetInstanceType ¶ added in v0.10.0
GetInstanceType returns the instance type.
type MetadataService ¶
type MetadataService interface { GetInstanceID() string GetInstanceType() string GetRegion() string GetAvailabilityZone() string }
MetadataService represents AWS metadata service.
func NewMetadataService ¶
func NewMetadataService(ec2MetadataClient EC2MetadataClient, k8sAPIClient KubernetesAPIClient, region string) (MetadataService, error)
NewMetadataService returns a new MetadataServiceImplementation.
Click to show internal directories.
Click to hide internal directories.