Documentation
¶
Overview ¶
Package vclusterconfig contains configuration types for vCluster Platform features. These types are used for parsing vCluster YAML configuration and are imported by vcluster.
Index ¶
- Constants
- func ConvertExternalPlatformValues(values map[string]any, mutators ...LegacyPlatformMutator) (map[string]any, error)
- func ConvertPlatformConfig(legacyConfig *LegacyPlatformConfig) (string, error)
- func ConvertSleepMode(legacySleepMode *LegacySleepMode) (string, error)
- func ConvertSleepModeValues(values map[string]any) (map[string]any, error)
- func SupportsSnapshotRequests(release storagev1.VirtualClusterHelmRelease) bool
- func ValidateArgoCD(fldPath *field.Path, integration *ArgoCDIntegration, deploy *ArgoCDDeploy) field.ErrorList
- func ValidateDeletion(fldPath *field.Path, deletion *Deletion) field.ErrorList
- func ValidateLegacyPlatformConfig(fldPath *field.Path, legacyPlatformConfig LegacyPlatformConfig) field.ErrorList
- func ValidateLegacySleepMode(fldPath *field.Path, sleepMode *LegacySleepMode) field.ErrorList
- func ValidateObservability(fldPath *field.Path, integration *ObservabilityIntegration) field.ErrorList
- func ValidatePlatformConfig(fldPath *field.Path, platformConfig PlatformConfig) field.ErrorList
- func ValidateSleep(fldPath *field.Path, sleep *Sleep) field.ErrorList
- func ValidateSnapshots(fldPath *field.Path, snapshots *Snapshots) field.ErrorList
- type ArgoCDApplication
- type ArgoCDApplicationTemplate
- type ArgoCDDeploy
- type ArgoCDIntegration
- type Deletion
- type DeletionAuto
- type Duration
- type GatewaySecret
- type Image
- type LabelSelector
- type LegacyAutoDeletedeprecated
- type LegacyAutoSnapshotdeprecated
- type LegacyContainerStoragedeprecated
- type LegacyContainerStorageVolumedeprecated
- type LegacyOCIStoragedeprecated
- type LegacyPlatformAutoSleepdeprecated
- type LegacyPlatformAutoWakeupdeprecated
- type LegacyPlatformConfigdeprecated
- type LegacyPlatformMutator
- type LegacyS3Storagedeprecated
- type LegacyScheduledSnapshotStoragedeprecated
- type LegacySleepAutodeprecated
- type LegacySleepAutoWakeupdeprecated
- type LegacySleepModedeprecated
- type LegacyVolumeSnapshotdeprecated
- type NetrisIntegration
- type NetrisKubeVipConfig
- type ObservabilityIntegration
- type Platform
- type PlatformAPIKey
- type PlatformConfig
- type Sleep
- type SleepAuto
- type SleepAutoExclusion
- type SleepAutoWakeup
- type SnapshotRetention
- type SnapshotSecretCredential
- type SnapshotStorage
- type SnapshotStorageAzure
- type SnapshotStorageContainer
- type SnapshotStorageContainerVolume
- type SnapshotStorageOCI
- type SnapshotStorageS3
- type Snapshots
- type SnapshotsAuto
Constants ¶
const ( // DefaultObservabilityNamespace is the default namespace the metrics-writer Secret is delivered to. DefaultObservabilityNamespace = "observability" // DefaultMetricsWriterSecretName is the default name of the delivered metrics-writer Secret. DefaultMetricsWriterSecretName = "metrics-writer" )
Variables ¶
This section is empty.
Functions ¶
func ConvertExternalPlatformValues ¶
func ConvertExternalPlatformValues(values map[string]any, mutators ...LegacyPlatformMutator) (map[string]any, error)
ConvertExternalPlatformValues extracts the external.platform section from values, applies any mutators, converts it to the new format, and returns the result as a map. Returns nil if no external.platform section exists.
func ConvertPlatformConfig ¶
func ConvertPlatformConfig(legacyConfig *LegacyPlatformConfig) (string, error)
ConvertPlatformConfig converts a LegacyPlatformConfig to the new PlatformConfig format and returns it as a YAML string.
func ConvertSleepMode ¶
func ConvertSleepMode(legacySleepMode *LegacySleepMode) (string, error)
ConvertSleepMode converts a LegacySleepMode to the new Sleep format and returns it as a YAML string.
func ConvertSleepModeValues ¶
ConvertSleepModeValues extracts the sleepMode section from values, converts it to the new format, and returns the result as a map. Returns nil if no sleepMode section exists.
func SupportsSnapshotRequests ¶ added in v4.11.0
func SupportsSnapshotRequests(release storagev1.VirtualClusterHelmRelease) bool
check if vcluster chart version is compatible with snapshots requests
func ValidateArgoCD ¶ added in v4.10.0
func ValidateArgoCD(fldPath *field.Path, integration *ArgoCDIntegration, deploy *ArgoCDDeploy) field.ErrorList
ValidateArgoCD validates the Argo CD integration and deploy configuration.
func ValidateDeletion ¶
ValidateDeletion validates the new top-level Deletion configuration
func ValidateLegacyPlatformConfig ¶
func ValidateLegacyPlatformConfig(fldPath *field.Path, legacyPlatformConfig LegacyPlatformConfig) field.ErrorList
ValidateLegacyPlatformConfig validates the deprecated external.platform configuration
func ValidateLegacySleepMode ¶
func ValidateLegacySleepMode(fldPath *field.Path, sleepMode *LegacySleepMode) field.ErrorList
ValidateLegacySleepMode validates the deprecated top-level sleepMode configuration
func ValidateObservability ¶
func ValidateObservability(fldPath *field.Path, integration *ObservabilityIntegration) field.ErrorList
ValidateObservability validates the observability integration configuration.
func ValidatePlatformConfig ¶
func ValidatePlatformConfig(fldPath *field.Path, platformConfig PlatformConfig) field.ErrorList
func ValidateSleep ¶
ValidateSleep validates the new top-level Sleep configuration
Types ¶
type ArgoCDApplication ¶ added in v4.10.0
type ArgoCDApplication struct {
// Name specifies the stable identifier of the argo cd application. It is used to derive generated
// ArgoCDApplication resource names and the final Argo CD application name.
// +optional
Name string `json:"name,omitempty"`
// DisplayName specifies the display name of the argo cd application.
// +optional
DisplayName string `json:"displayName,omitempty"`
// Target specifies the target of the argo cd application. This can be "vCluster" or "host". Defaults to "vCluster".
// +optional
Target string `json:"target,omitempty"`
// Inline specifies the inline argo cd application definition. This requires the argo cd integration to be enabled.
// +optional
Inline map[string]interface{} `json:"inline,omitempty"`
// Template specifies the argo cd application template to use. This requires the argo cd integration to be enabled.
// +optional
Template *ArgoCDApplicationTemplate `json:"template,omitempty"`
}
ArgoCDApplication holds argo cd application configuration.
type ArgoCDApplicationTemplate ¶ added in v4.10.0
type ArgoCDApplicationTemplate struct {
// Name specifies the name of the argo cd application template
// +optional
Name string `json:"name,omitempty"`
// Parameters specifies the parameters to pass to the argo cd application template.
// +optional
Parameters map[string]interface{} `json:"parameters,omitempty"`
}
type ArgoCDDeploy ¶ added in v4.10.0
type ArgoCDDeploy struct {
// Applications specifies the applications to deploy. This requires the argo cd integration to be enabled.
// +optional
Applications []ArgoCDApplication `json:"applications,omitempty"`
}
ArgoCDDeploy holds argo cd deploy configuration.
type ArgoCDIntegration ¶ added in v4.10.0
type ArgoCDIntegration struct {
// Enabled defines if argo cd integration is enabled
// +optional
Enabled bool `json:"enabled,omitempty"`
// Connector specifies the argo cd connector name
// +optional
Connector string `json:"connector,omitempty"`
}
ArgoCDIntegration holds argo cd integration configuration.
type Deletion ¶
type Deletion struct {
// Prevent prevents the vCluster from being deleted
// +optional
Prevent bool `json:"prevent,omitempty" yaml:"prevent,omitempty"`
// Auto holds automatic deletion configuration
// +optional
Auto *DeletionAuto `json:"auto,omitempty" yaml:"auto,omitempty"`
}
Deletion holds configuration for automatic vCluster deletion. This replaces external.platform.autoDelete.
type DeletionAuto ¶
type DeletionAuto struct {
// AfterInactivity specifies after how long of inactivity the tenant cluster will be deleted.
// Uses Go duration format (e.g., "720h" for 30 days).
// +optional
AfterInactivity Duration `json:"afterInactivity,omitempty" yaml:"afterInactivity,omitempty"`
}
DeletionAuto holds automatic deletion configuration
type Duration ¶
type Duration string
Duration allows for automatic Marshalling from strings like "1m" to a time.Duration
func (Duration) MarshalJSON ¶
MarshalJSON implements Marshaler
func (*Duration) UnmarshalJSON ¶
UnmarshalJSON implements Marshaler
type GatewaySecret ¶
type GatewaySecret struct {
// Namespace is the namespace the Secret is delivered to.
// Required once a gatewaySecrets entry is present.
// +optional
Namespace string `json:"namespace,omitempty"`
// Name is the name of the delivered Secret.
// Required once a gatewaySecrets entry is present.
// +optional
Name string `json:"name,omitempty"`
}
GatewaySecret identifies a Secret delivery target by namespace and name.
type Image ¶
type Image struct {
// Registry is the registry of the container image, e.g. my-registry.com or ghcr.io. This setting can be globally
// overridden via the controlPlane.advanced.defaultImageRegistry option. Empty means docker hub.
Registry string `json:"registry,omitempty"`
// Repository is the repository of the container image, e.g. my-repo/my-image
Repository string `json:"repository,omitempty"`
// Tag is the tag of the container image, and is the default version.
Tag string `json:"tag,omitempty"`
}
type LabelSelector ¶
type LegacyAutoDelete
deprecated
type LegacyAutoDelete struct {
// AfterInactivity specifies after how many seconds of inactivity the tenant cluster be deleted
// +optional
AfterInactivity int64 `json:"afterInactivity,omitempty" yaml:"afterInactivity,omitempty"`
}
LegacyAutoDelete holds configuration for automatic delete.
Deprecated: Use top-level Deletion instead.
type LegacyAutoSnapshot
deprecated
type LegacyAutoSnapshot struct {
// Enable defines whether auto snapshot is enabled for the tenant cluster
// +optional
Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"`
// Timezone specifies time zone used for scheduled tenant cluster operations. Defaults to UTC.
// Accepts the same format as time.LoadLocation() in Go (https://pkg.go.dev/time#LoadLocation).
// The value should be a location name corresponding to a file in the IANA Time Zone database, such as "America/New_York".
// +optional
Timezone string `json:"timezone,omitempty" yaml:"timezone,omitempty"`
// Schedule specifies a scheduled time in Cron format, see https://en.wikipedia.org/wiki/Cron for a tenant cluster snapshot to be taken
// +optional
Schedule string `json:"schedule,omitempty" yaml:"schedule,omitempty"`
// Volumes specifies a set of configuration for the volume snapshot
// +optional
Volumes LegacyVolumeSnapshot `json:"volumes" yaml:"volumes"`
// Storage specifies a set of configuration where the snapshot will be stored
// +optional
Storage LegacyScheduledSnapshotStorage `json:"storage,omitempty" yaml:"storage,omitempty"`
// Retention specifies a set of configuration for how long the snapshot will be kept
// +optional
Retention SnapshotRetention `json:"retention,omitempty" yaml:"retention,omitempty"`
}
LegacyAutoSnapshot holds configuration for automatic snapshot of vclusters.
Deprecated: Use top-level Snapshots instead.
type LegacyContainerStorage
deprecated
type LegacyContainerStorage struct {
// Path specifies directory to store the snapshot
// +optional
Path string `json:"path,omitempty" yaml:"path,omitempty"`
// Volume specifies which volume needs to be mounted into the container to store the snapshot
// +optional
Volume LegacyContainerStorageVolume `json:"volume,omitempty" yaml:"volume,omitempty"`
}
LegacyContainerStorage holds container local storage configuration.
Deprecated: Use SnapshotStorageContainer instead.
type LegacyContainerStorageVolume
deprecated
type LegacyContainerStorageVolume struct {
// Name to be used to mount the volume
// +optional
Name string `json:"name,omitempty" yaml:"name,omitempty"`
// Path to the volume mount
// +optional
Path string `json:"path,omitempty" yaml:"path,omitempty"`
}
LegacyContainerStorageVolume holds volume mount configuration.
Deprecated: Use SnapshotStorageContainerVolume instead.
type LegacyOCIStorage
deprecated
type LegacyOCIStorage struct {
// Repository OCI repository to store the snapshot
// +optional
Repository string `json:"repository,omitempty" yaml:"repository,omitempty"`
// Credential secret with the OCI Credentials
// +optional
Credential *SnapshotSecretCredential `json:"credential,omitempty" yaml:"credential,omitempty"`
// Username to authenticate with the OCI registry
// +optional
Username string `json:"username,omitempty" yaml:"username,omitempty" url:"username"`
// Password to authenticate with the OCI registry
// +optional
Password string `json:"password,omitempty" yaml:"password,omitempty" url:"password,base64"`
}
LegacyOCIStorage holds OCI registry storage configuration.
Deprecated: Use SnapshotStorageOCI instead.
type LegacyPlatformAutoSleep
deprecated
type LegacyPlatformAutoSleep struct {
// AfterInactivity specifies after how many seconds of inactivity the tenant cluster should sleep
// +optional
AfterInactivity int64 `json:"afterInactivity,omitempty" yaml:"afterInactivity,omitempty"`
// Schedule specifies scheduled tenant cluster sleep in Cron format, see https://en.wikipedia.org/wiki/Cron.
// Note: timezone defined in the schedule string will be ignored. Use ".Timezone" field instead.
// +optional
Schedule string `json:"schedule,omitempty" yaml:"schedule,omitempty"`
// Timezone specifies time zone used for scheduled tenant cluster operations. Defaults to UTC.
// Accepts the same format as time.LoadLocation() in Go (https://pkg.go.dev/time#LoadLocation).
// The value should be a location name corresponding to a file in the IANA Time Zone database, such as "America/New_York".
// +optional
Timezone string `json:"timezone,omitempty" yaml:"timezone,omitempty"`
// AutoWakeup holds configuration for automatic wakeup
// +optional
AutoWakeup *LegacyPlatformAutoWakeup `json:"autoWakeup,omitempty" yaml:"autoWakeup,omitempty"`
}
LegacyPlatformAutoSleep holds configuration for automatic sleep and wakeup.
Deprecated: Use top-level sleepMode instead.
type LegacyPlatformAutoWakeup
deprecated
type LegacyPlatformAutoWakeup struct {
// Schedule specifies scheduled wakeup from sleep in Cron format, see https://en.wikipedia.org/wiki/Cron.
// Note: timezone defined in the schedule string will be ignored. The timezone for the autoSleep schedule will be
// used
// +optional
Schedule string `json:"schedule,omitempty" yaml:"schedule,omitempty"`
}
LegacyPlatformAutoWakeup holds configuration for automatic wakeup.
Deprecated: Use top-level sleepMode.autoWakeup instead.
type LegacyPlatformConfig
deprecated
type LegacyPlatformConfig struct {
APIKey interface{} `json:"apiKey,omitempty" yaml:"apiKey,omitempty"`
// AutoSleep holds configuration for automatic sleep and wakeup
// Deprecated: Use top-level sleepMode instead.
// +optional
AutoSleep *LegacyPlatformAutoSleep `json:"autoSleep,omitempty" yaml:"autoSleep,omitempty"`
// AutoDelete holds configuration for automatic delete
// Deprecated: Use top-level Deletion instead.
// +optional
AutoDelete *LegacyAutoDelete `json:"autoDelete,omitempty" yaml:"autoDelete,omitempty"`
// Project holds project name where vcluster should be imported
Project string `json:"project,omitempty" yaml:"project,omitempty"`
// AutoSnapshot holds configuration for automatic snapshot of vclusters
// Deprecated: Use top-level Snapshots instead.
// +optional
AutoSnapshot *LegacyAutoSnapshot `json:"autoSnapshot,omitempty" yaml:"autoSnapshot,omitempty"`
}
LegacyPlatformConfig describes platform configuration for a vCluster. This is provided through the vcluster.yaml under "external.platform".
Deprecated: Use the new top-level config types instead:
- AutoSleep -> use top-level Sleep
- AutoDelete -> use top-level Deletion
- AutoSnapshot -> use top-level Snapshots
- APIKey, Project -> use top-level Platform
type LegacyPlatformMutator ¶
type LegacyPlatformMutator func(*LegacyPlatformConfig)
LegacyPlatformMutator is a function that can mutate a LegacyPlatformConfig before conversion. This allows callers to inject platform-specific logic (e.g., sleep mode migration from annotations).
type LegacyS3Storage
deprecated
type LegacyS3Storage struct {
// Url specifies url to the storage service
// +optional
Url string `json:"url,omitempty" yaml:"url,omitempty"`
// Credential secret with the S3 Credentials, it should contain AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN
// +optional
Credential *SnapshotSecretCredential `json:"credential,omitempty" yaml:"credential,omitempty"`
}
LegacyS3Storage holds S3 storage configuration.
Deprecated: Use SnapshotStorageS3 instead.
type LegacyScheduledSnapshotStorage
deprecated
type LegacyScheduledSnapshotStorage struct {
// Type specifies supported type of storage services for a snapshot S3/OCI/Container, see https://www.vcluster.com/docs/vcluster/manage/backup-restore#store-snapshots-in-s3-buckets
// +optional
Type string `json:"type,omitempty" yaml:"type,omitempty"`
// S3 holds configuration for storing snapshots in S3-compatible bucket
// +optional
S3 LegacyS3Storage `json:"s3,omitempty" yaml:"s3,omitempty"`
// OCI holds configuration for storing snapshots in OCI image registries
// +optional
OCI LegacyOCIStorage `json:"oci,omitempty" yaml:"oci,omitempty"`
// Container holds configuration for storing snapshots as local files inside a vCluster container
// +optional
Container LegacyContainerStorage `json:"container,omitempty" yaml:"container,omitempty"`
}
LegacyScheduledSnapshotStorage holds snapshot storage configuration.
Deprecated: Use SnapshotStorage instead.
type LegacySleepAuto
deprecated
type LegacySleepAuto struct {
// AfterInactivity represents how long a vCluster can be idle before workloads are automatically put to sleep
AfterInactivity Duration `json:"afterInactivity,omitempty" yaml:"afterInactivity,omitempty"`
// Schedule represents a cron schedule for when to sleep workloads
Schedule string `json:"schedule,omitempty" yaml:"schedule,omitempty"`
// Exclude holds configuration for labels that, if present, will prevent a workload from going to sleep
Exclude SleepAutoExclusion `json:"exclude,omitempty"`
}
LegacySleepAuto holds configuration for automatic sleep and wakeup
Deprecated: Use SleepAuto instead.
type LegacySleepAutoWakeup
deprecated
type LegacySleepAutoWakeup struct {
Schedule string `json:"schedule,omitempty" yaml:"schedule,omitempty"`
}
LegacySleepAutoWakeup holds the cron schedule to wake workloads automatically
Deprecated: Use SleepAutoWakeup instead.
type LegacySleepMode
deprecated
type LegacySleepMode struct {
Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"`
TimeZone string `json:"timeZone,omitempty" yaml:"timeZone,omitempty"`
AutoSleep *LegacySleepAuto `json:"autoSleep,omitempty" yaml:"autoSleep,omitempty"`
AutoWakeup *LegacySleepAutoWakeup `json:"autoWakeup,omitempty" yaml:"autoWakeup,omitempty"`
}
LegacySleepMode holds the deprecated sleepMode configuration format.
Deprecated: Use the top-level Sleep type instead.
type LegacyVolumeSnapshot
deprecated
type LegacyVolumeSnapshot struct {
// Enabled specifies whether a snapshot should also include volumes in the snapshot
// +optional
Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"`
}
LegacyVolumeSnapshot holds volume snapshot configuration.
Deprecated: Use SnapshotVolumes instead.
type NetrisIntegration ¶
type NetrisIntegration struct {
// Enabled defines if netris integration is enabled
// +optional
Enabled bool `json:"enabled,omitempty"`
// Connector specifies the netris connector name
// +optional
Connector string `json:"connector,omitempty"`
// KubeVip holds kube-vip configuration for netris
// +optional
KubeVip NetrisKubeVipConfig `json:"kubeVip,omitempty"`
}
NetrisIntegration holds netris integration configuration. This provides type safety for the previously untyped integrations.netris field.
type NetrisKubeVipConfig ¶
type NetrisKubeVipConfig struct {
// ServerCluster specifies the server cluster name
// +optional
ServerCluster string `json:"serverCluster,omitempty"`
// Bridge specifies the bridge interface name
// +optional
Bridge string `json:"bridge,omitempty"`
// IPRange specifies the IP range for kube-vip
// +optional
IPRange string `json:"ipRange,omitempty"`
}
NetrisKubeVipConfig holds kube-vip configuration for netris integration
type ObservabilityIntegration ¶
type ObservabilityIntegration struct {
// Enabled defines if the observability integration is enabled.
// Connector must also be set for the integration to be considered configured.
// +optional
Enabled bool `json:"enabled,omitempty"`
// Connector specifies the Platform observability connector to connect to.
// Required when Enabled is true for the integration to be considered configured.
// +optional
Connector string `json:"connector,omitempty"`
// GatewaySecret overrides where the metrics-writer Secret is delivered.
// When unset, the shared default target is used: namespace "observability", name "metrics-writer".
// +optional
GatewaySecret *GatewaySecret `json:"gatewaySecret,omitempty"`
}
ObservabilityIntegration holds observability integration configuration. The integration is considered configured when both Enabled is true and Connector is set.
func (*ObservabilityIntegration) DeliveryTarget ¶
func (o *ObservabilityIntegration) DeliveryTarget() *GatewaySecret
DeliveryTarget returns where the metrics-writer Secret should be delivered. It returns nil when the integration is nil or disabled, so "off" stays distinguishable from "default target". For an enabled integration it returns the configured GatewaySecret, or the default namespace/name when none is set.
type Platform ¶
type Platform struct {
// APIKey defines where to find the platform access key and host. By default, vCluster will search in the following locations in this precedence:
// * environment variable called LICENSE
// * secret specified under platform.apiKey.secretName
// * secret called "vcluster-platform-api-key" in the vCluster namespace
APIKey PlatformAPIKey `json:"apiKey,omitempty"`
// Project specifies which platform project the vcluster should be imported to
// +optional
Project string `json:"project,omitempty"`
}
Platform holds vCluster Platform specific configuration. This replaces the remaining fields from external.platform.
type PlatformAPIKey ¶
type PlatformAPIKey struct {
// SecretName is the name of the secret where the platform access key is stored. This defaults to vcluster-platform-api-key if undefined.
// +optional
SecretName string `json:"secretName,omitempty"`
// Namespace defines the namespace where the access key secret should be retrieved from. If this is not equal to the namespace
// where the vCluster instance is deployed, you need to make sure vCluster has access to this other namespace.
// +optional
Namespace string `json:"namespace,omitempty"`
// CreateRBAC will automatically create the necessary RBAC roles and role bindings to allow vCluster to read the secret specified
// in the above namespace, if specified.
// This defaults to true.
// +optional
CreateRBAC *bool `json:"createRBAC,omitempty"`
}
PlatformAPIKey defines where to find the platform access key. The secret key name doesn't matter as long as the secret only contains a single key.
type PlatformConfig ¶
type PlatformConfig struct {
Sleep *Sleep `json:"sleep,omitempty" yaml:"sleep,omitempty"`
Snapshots *Snapshots `json:"snapshots,omitempty" yaml:"snapshots,omitempty"`
Deletion *Deletion `json:"deletion,omitempty" yaml:"deletion,omitempty"`
Platform *Platform `json:"platform,omitempty" yaml:"platform,omitempty"`
NetrisIntegration *NetrisIntegration `json:"netris,omitempty" yaml:"netris,omitempty"`
ArgoCDIntegration *ArgoCDIntegration `json:"argoCD,omitempty"`
ArgoCDDeploy *ArgoCDDeploy `json:"deploy,omitempty"`
ObservabilityIntegration *ObservabilityIntegration `json:"observability,omitempty" yaml:"observability,omitempty"`
}
func NewDefaultPlatformConfig ¶
func NewDefaultPlatformConfig() *PlatformConfig
NewDefaultPlatformConfig returns an empty platform config. All fields are optional and default to nil/zero values.
type Sleep ¶
type Sleep struct {
// Auto holds automatic sleep configuration
Auto *SleepAuto `json:"auto,omitempty" yaml:"auto,omitempty"`
}
Sleep holds configuration for automatically putting the tenant cluster to sleep. This replaces sleepMode.
type SleepAuto ¶
type SleepAuto struct {
// AfterInactivity represents how long a vCluster can be idle before workloads are automatically put to sleep
AfterInactivity Duration `json:"afterInactivity,omitempty" yaml:"afterInactivity,omitempty"`
// Schedule represents a cron schedule for when to sleep workloads
Schedule string `json:"schedule,omitempty" yaml:"schedule,omitempty"`
// Exclude holds configuration for labels that, if present, will prevent a workload from going to sleep
Exclude SleepAutoExclusion `json:"exclude,omitempty"`
// Wakeup holds configuration for waking the vCluster on a schedule
Wakeup *SleepAutoWakeup `json:"wakeup,omitempty" yaml:"wakeup,omitempty"`
// Timezone specifies time zone used for scheduled sleep operations. Defaults to UTC.
// Accepts the same format as time.LoadLocation() in Go (https://pkg.go.dev/time#LoadLocation).
// The value should be a location name corresponding to a file in the IANA Time Zone database, such as "America/New_York".
// +optional
Timezone string `json:"timezone,omitempty" yaml:"timezone,omitempty"`
}
SleepAuto holds configuration for automatic sleep and wakeup
type SleepAutoExclusion ¶
type SleepAutoExclusion struct {
Selector LabelSelector `json:"selector,omitempty"`
}
SleepAutoExclusion holds conifiguration for excluding workloads from sleeping by label(s)
type SleepAutoWakeup ¶
type SleepAutoWakeup struct {
Schedule string `json:"schedule,omitempty" yaml:"schedule,omitempty"`
}
SleepAutoWakeup holds the cron schedule to wake workloads automatically
type SnapshotRetention ¶
type SnapshotRetention struct {
// Period defines the number of days a snapshot will be kept
// +optional
Period int `json:"period,omitempty"`
// MaxSnapshots defines the number of snapshots that can be taken
// +optional
MaxSnapshots int `json:"maxSnapshots,omitempty"`
}
SnapshotRetention holds snapshot retention configuration
type SnapshotSecretCredential ¶
type SnapshotSecretCredential struct {
// SecretName is the secret name with credential
// +optional
SecretName string `json:"secretName,omitempty"`
// SecretNamespace is the secret namespace with credential
// +optional
SecretNamespace string `json:"secretNamespace,omitempty"`
}
SnapshotSecretCredential holds secret reference for credentials
type SnapshotStorage ¶
type SnapshotStorage struct {
// Type specifies supported type of storage services for a snapshot S3/OCI/Container, see https://www.vcluster.com/docs/vcluster/manage/backup-restore#store-snapshots-in-s3-buckets
// +optional
Type string `json:"type,omitempty"`
// S3 holds configuration for storing snapshots in S3-compatible bucket
// +optional
S3 SnapshotStorageS3 `json:"s3,omitempty"`
// OCI holds configuration for storing snapshots in OCI image registries
// +optional
OCI SnapshotStorageOCI `json:"oci,omitempty"`
// Container holds configuration for storing snapshots as local files inside a vCluster container
// +optional
Container SnapshotStorageContainer `json:"container,omitempty"`
// Azure holds configuration for storing snapshots in Azure Blob Storage
// +optional
Azure SnapshotStorageAzure `json:"azure,omitempty"`
}
SnapshotStorage holds snapshot storage configuration
type SnapshotStorageAzure ¶ added in v4.8.2
type SnapshotStorageAzure struct {
// BlobURL specifies the Azure Blob Storage URL in the format https://{account}.blob.core.windows.net/{container}/{path}
// +optional
BlobURL string `json:"blobUrl,omitempty"`
// Credential secret with the Azure credentials. The secret should contain either:
// AZURE_STORAGE_KEY (storage account access key), or
// AZURE_TENANT_ID, AZURE_CLIENT_ID, AZURE_CLIENT_SECRET, AZURE_SUBSCRIPTION_ID, AZURE_RESOURCE_GROUP (service principal)
// +optional
Credential *SnapshotSecretCredential `json:"credential,omitempty"`
}
SnapshotStorageAzure holds Azure Blob Storage configuration.
type SnapshotStorageContainer ¶
type SnapshotStorageContainer struct {
// Path specifies directory to store the snapshot
// +optional
Path string `json:"path,omitempty"`
// Volume specifies which volume needs to be mounted into the container to store the snapshot
// +optional
Volume SnapshotStorageContainerVolume `json:"volume,omitempty"`
}
SnapshotStorageContainer holds container local storage configuration
type SnapshotStorageContainerVolume ¶
type SnapshotStorageContainerVolume struct {
// Name to be used to mount the volume
// +optional
Name string `json:"name,omitempty"`
// Path to the volume mount
// +optional
Path string `json:"path,omitempty"`
}
SnapshotStorageContainerVolume holds volume mount configuration
type SnapshotStorageOCI ¶
type SnapshotStorageOCI struct {
// Repository OCI repository to store the snapshot
// +optional
Repository string `json:"repository,omitempty"`
// Credential secret with the OCI Credentials
// +optional
Credential *SnapshotSecretCredential `json:"credential,omitempty"`
// Username to authenticate with the OCI registry
// +optional
Username string `json:"username,omitempty"`
// Password to authenticate with the OCI registry
// +optional
Password string `json:"password,omitempty"`
}
SnapshotStorageOCI holds OCI registry storage configuration
type SnapshotStorageS3 ¶
type SnapshotStorageS3 struct {
// Url specifies url to the storage service
// +optional
Url string `json:"url,omitempty"`
// Credential secret with the S3 Credentials, it should contain AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN
// +optional
Credential *SnapshotSecretCredential `json:"credential,omitempty"`
}
SnapshotStorageS3 holds S3 storage configuration
type Snapshots ¶
type Snapshots struct {
// Auto holds automatic snapshot configuration
// +optional
Auto *SnapshotsAuto `json:"auto,omitempty" yaml:"auto,omitempty"`
}
Snapshots holds configuration for automatic vCluster snapshots. This replaces external.platform.autoSnapshot.
type SnapshotsAuto ¶
type SnapshotsAuto struct {
// Schedule specifies a scheduled time in Cron format, see https://en.wikipedia.org/wiki/Cron for a tenant cluster snapshot to be taken
// +optional
Schedule string `json:"schedule,omitempty" yaml:"schedule,omitempty"`
// Timezone specifies time zone used for scheduled snapshot operations. Defaults to UTC.
// Accepts the same format as time.LoadLocation() in Go (https://pkg.go.dev/time#LoadLocation).
// The value should be a location name corresponding to a file in the IANA Time Zone database, such as "America/New_York".
// +optional
Timezone string `json:"timezone,omitempty" yaml:"timezone,omitempty"`
// Retention specifies how long snapshots will be kept
// +optional
Retention *SnapshotRetention `json:"retention,omitempty" yaml:"retention,omitempty"`
// Storage specifies where the snapshot will be stored
// +optional
Storage *SnapshotStorage `json:"storage,omitempty" yaml:"storage,omitempty"`
}
SnapshotsAuto holds automatic snapshot scheduling and retention configuration