profiles

package
v1.23.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: Apache-2.0 Imports: 59 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildProfileConfigParams

type BuildProfileConfigParams struct {
	TargetPath          string
	Clientset           clientset.Interface
	VolumeAttributeKeys map[string]struct{}
	NodeName            string
	PodNamespace        string
	PodName             string
	IsInitContainer     bool
}

BuildProfileConfigParams contains the parameters needed to build a profile configuration.

type ConfigFile added in v1.21.5

type ConfigFile struct {
	Global ConfigGlobal `gcfg:"global"`
}

type ConfigGlobal added in v1.21.5

type ConfigGlobal struct {
	TokenURL  string `gcfg:"token-url"`
	TokenBody string `gcfg:"token-body"`
}

type DatafluxConfig

type DatafluxConfig struct {
	Parallelism          int
	BatchSize            int
	SkipDirectoryObjects bool
}

DatafluxConfig holds the configuration for the Dataflux lister.

type EventInfo added in v1.21.20

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

EventInfo holds information relevant to a PV event.

type GCSFuseCSIRecommendationLog added in v1.21.0

type GCSFuseCSIRecommendationLog struct {
	Severity string `json:"severity"`
	Message  string `json:"message"`
	Target   struct {
		PVName   string `json:"pvName"`
		NodeName string `json:"nodeName"`
		PodName  string `json:"podName"`
	} `json:"target"`
	InputSignals struct {
		BucketTotalObjects                   int64  `json:"bucketTotalObjects"`
		BucketTotalDataSizeBytes             int64  `json:"bucketTotalDataSizeBytes"`
		BucketLocationType                   string `json:"bucketLocationType"`
		BucketHNSEnabled                     bool   `json:"bucketHNSEnabled"`
		RequiredFileCacheBytes               int64  `json:"requiredFileCacheBytes"`
		RequiredMetadataStatCacheBytes       int64  `json:"requiredMetadataStatCacheBytes"`
		NodeType                             string `json:"nodeType"`
		NodeAllocatableMemoryBytes           int64  `json:"nodeAllocatableMemoryBytes"`
		NodeAllocatableEphemeralStorageBytes int64  `json:"nodeAllocatableEphemeralStorageBytes"`
		NodeHasEphemeralStorageLSSD          bool   `json:"nodeHasEphemeralStorageLSSD"`
		SidecarLimitMemoryBytes              int64  `json:"sidecarLimitMemoryBytes"`
		SidecarLimitEphemeralStorageBytes    int64  `json:"sidecarLimitEphemeralStorageBytes"`
		FuseBudgetMemoryBytes                int64  `json:"fuseBudgetMemoryBytes"`
		FuseBudgetEphemeralStorageBytes      int64  `json:"fuseBudgetEphemeralStorageBytes"`
	} `json:"inputSignals"`
	Decision struct {
		MetadataStatCacheBytes int64  `json:"metadataStatCacheBytes"`
		FileCacheBytes         int64  `json:"fileCacheBytes"`
		FileCacheMedium        string `json:"fileCacheMedium"`
	} `json:"decision"`
}

Structured log format for GCSFuseCSIRecommendation

type ProfileConfig

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

ProfileConfig holds the consolidated configuration for a volume profile, derived from PersistentVolume annotations and StorageClass parameters.

func BuildProfileConfig

func BuildProfileConfig(params *BuildProfileConfigParams) (*ProfileConfig, error)

BuildProfileConfig constructs a ProfileConfig by fetching and validating information from the PV, Pod, SC, and Node relevant to the recommender. volumeAttributeKeys is used to filter parameters from the StorageClass that should be treated as volume attributes.

func (*ProfileConfig) MergeRecommendedMountOptionsOnMissingKeys added in v1.21.0

func (config *ProfileConfig) MergeRecommendedMountOptionsOnMissingKeys(userMountOptions []string) ([]string, error)

MergeRecommendedMountOptionsOnMissingKeys generates a slice of recommended mount options for GCS FUSE based on the provided ProfileConfig. It calculates optimal cache configurations and translates them into gcsfuse mount option strings. If the user provides any of the following mount options:

  • "metadata-cache:stat-cache-max-size-mb"
  • "file-cache:max-size-mb"

the cache recommendation be best effort, respecting the user's mount options in the case of duplication. If a custom file cache medium is specified, file cache recommendation will be skipped, since the medium size will be unknowable.

func (*ProfileConfig) MergeVolumeAttributesOnRecommendedMissingKeys added in v1.21.0

func (c *ProfileConfig) MergeVolumeAttributesOnRecommendedMissingKeys(input map[string]string) map[string]string

MergeVolumeAttributesOnRecommendedMissingKeys returns the a copy of the input map, merged with the profile's. recommended VolumeAttributes. This function respects the input's keys in the case of duplication.

type Scanner

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

Scanner is the main controller structure.

func NewScanner

func NewScanner(config *ScannerConfig) (*Scanner, error)

NewScanner creates a new Scanner instance.

func (*Scanner) Start

func (s *Scanner) Start(ctx context.Context, cancel context.CancelFunc)

Start begins the Scanner process in a new goroutine. It will use leader election if s.config.LeaderElection is true, otherwise it starts the scanner directly.

type ScannerConfig

type ScannerConfig struct {
	KubeAPIQPS                       float64       // QPS limit for Kubernetes API client.
	KubeAPIBurst                     int           // Burst limit for Kubernetes API client.
	ResyncPeriod                     time.Duration // Resync period for informers.
	KubeConfigPath                   string        // Optional: Path to kubeconfig file. If empty, InClusterConfig is used.
	CloudConfigPath                  string
	RateLimiter                      workqueue.TypedRateLimiter[string]
	DatafluxConfig                   *DatafluxConfig
	LeaderElection                   bool
	LeaderElectionNamespace          string
	LeaderElectionLeaseDuration      time.Duration
	LeaderElectionRenewDeadline      time.Duration
	LeaderElectionRetryPeriod        time.Duration
	LeaderElectionHealthCheckTimeout time.Duration
	ClusterLocation                  string
	ProjectNumber                    string
	HTTPEndpoint                     string
}

ScannerConfig holds the configuration for the Scanner.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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