block

package
v1.12.4 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: MPL-2.0 Imports: 24 Imported by: 2

Documentation

Overview

Package block provides block device and volume configuration documents.

Index

Constants

View Source
const ExistingVolumeConfigKind = "ExistingVolumeConfig"

ExistingVolumeConfigKind is a config document kind.

View Source
const RawVolumeConfigKind = "RawVolumeConfig"

RawVolumeConfigKind is a config document kind.

View Source
const SwapVolumeConfigKind = "SwapVolumeConfig"

SwapVolumeConfigKind is a config document kind.

View Source
const UserVolumeConfigKind = "UserVolumeConfig"

UserVolumeConfigKind is a config document kind.

View Source
const VolumeConfigKind = "VolumeConfig"

VolumeConfigKind is a config document kind.

View Source
const ZswapConfigKind = "ZswapConfig"

ZswapConfigKind is a config document kind.

Variables

This section is empty.

Functions

func GetFileDoc

func GetFileDoc() *encoder.FileDoc

GetFileDoc returns documentation for the file block_doc.go.

Types

type ByteSize

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

ByteSize is a byte size which can be convienintly represented as a human readable string with IEC sizes, e.g. 100MB.

func MustByteSize

func MustByteSize(value string) ByteSize

MustByteSize returns a new Size with the given ByteSize value.

It panics if the value is invalid.

func (ByteSize) IsZero

func (bs ByteSize) IsZero() bool

IsZero implements yaml.IsZeroer.

func (ByteSize) MarshalText

func (bs ByteSize) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*ByteSize) Merge added in v1.9.2

func (bs *ByteSize) Merge(other any) error

Merge implements merger interface.

func (*ByteSize) UnmarshalText

func (bs *ByteSize) UnmarshalText(text []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (ByteSize) Value

func (bs ByteSize) Value() uint64

Value returns the value.

type DiskSelector

type DiskSelector struct {
	//   description: |
	//     The Common Expression Language (CEL) expression to match the disk.
	//   schema:
	//     type: string
	//   examples:
	//    - value: >
	//        exampleDiskSelector1()
	//      name: match disks with size between 120GB and 1TB
	//    - value: >
	//        exampleDiskSelector2()
	//      name: match SATA disks that are not rotational and not system disks
	Match cel.Expression `yaml:"match,omitempty"`
}

DiskSelector selects a disk for the volume.

func (DiskSelector) Doc

func (DiskSelector) Doc() *encoder.Doc

type EncryptionKey added in v1.10.0

type EncryptionKey struct {
	//   description: >
	//     Key slot number for LUKS2 encryption.
	KeySlot int `yaml:"slot"`
	//   description: >
	//     Key which value is stored in the configuration file.
	KeyStatic *EncryptionKeyStatic `yaml:"static,omitempty"`
	//   description: >
	//     Deterministically generated key from the node UUID and PartitionLabel.
	KeyNodeID *EncryptionKeyNodeID `yaml:"nodeID,omitempty"`
	//   description: >
	//     KMS managed encryption key.
	KeyKMS *EncryptionKeyKMS `yaml:"kms,omitempty"`
	//   description: >
	//     Enable TPM based disk encryption.
	KeyTPM *EncryptionKeyTPM `yaml:"tpm,omitempty"`
	//   description: >
	//     Lock the disk encryption key to the random salt stored in the STATE partition.
	//     This is useful to prevent the volume from being unlocked if STATE partition is compromised
	//     or replaced. It is recommended to use this option with TPM disk encryption for
	//     non-STATE volumes.
	KeyLockToSTATE *bool `yaml:"lockToState,omitempty"`
}

EncryptionKey represents configuration for disk encryption key.

func (EncryptionKey) Doc added in v1.10.0

func (EncryptionKey) Doc() *encoder.Doc

func (EncryptionKey) KMS added in v1.10.0

KMS implements the config.Provider interface.

func (EncryptionKey) LockToSTATE added in v1.11.0

func (k EncryptionKey) LockToSTATE() bool

LockToSTATE implements the config.Provider interface.

func (EncryptionKey) NodeID added in v1.10.0

NodeID implements the config.Provider interface.

func (EncryptionKey) Slot added in v1.10.0

func (k EncryptionKey) Slot() int

Slot implements the config.Provider interface.

func (EncryptionKey) Static added in v1.10.0

Static implements the config.Provider interface.

func (EncryptionKey) TPM added in v1.10.0

TPM implements the config.Provider interface.

type EncryptionKeyKMS added in v1.10.0

type EncryptionKeyKMS struct {
	//   description: >
	//     KMS endpoint to Seal/Unseal the key.
	KMSEndpoint string `yaml:"endpoint"`
}

EncryptionKeyKMS represents a key that is generated and then sealed/unsealed by the KMS server.

examples:
  - value: exampleKMSKey()

func (EncryptionKeyKMS) Doc added in v1.10.0

func (EncryptionKeyKMS) Doc() *encoder.Doc

func (*EncryptionKeyKMS) Endpoint added in v1.10.0

func (e *EncryptionKeyKMS) Endpoint() string

Endpoint implements the config.Provider interface.

func (*EncryptionKeyKMS) String added in v1.10.0

func (e *EncryptionKeyKMS) String() string

String implements the config.Provider interface.

type EncryptionKeyNodeID added in v1.10.0

type EncryptionKeyNodeID struct{}

EncryptionKeyNodeID represents deterministically generated key from the node UUID and PartitionLabel.

func (EncryptionKeyNodeID) Doc added in v1.10.0

func (*EncryptionKeyNodeID) String added in v1.10.0

func (e *EncryptionKeyNodeID) String() string

String implements the config.Provider interface.

type EncryptionKeyStatic added in v1.10.0

type EncryptionKeyStatic struct {
	//   description: >
	//     Defines the static passphrase value.
	KeyData string `yaml:"passphrase,omitempty"`
}

EncryptionKeyStatic represents throw away key type.

func (EncryptionKeyStatic) Doc added in v1.10.0

func (*EncryptionKeyStatic) Key added in v1.10.0

func (e *EncryptionKeyStatic) Key() []byte

Key implements the config.Provider interface.

func (*EncryptionKeyStatic) String added in v1.10.0

func (e *EncryptionKeyStatic) String() string

String implements the config.Provider interface.

type EncryptionKeyTPM added in v1.10.0

type EncryptionKeyTPM struct {
	//   description: >
	//     TPM options for key protection.
	TPMOptions *EncryptionKeyTPMOptions `yaml:"options,omitempty"`

	//   description: >
	//     Check that Secureboot is enabled in the EFI firmware.
	//
	//     If Secureboot is not enabled, the enrollment of the key will fail.
	TPMCheckSecurebootStatusOnEnroll *bool `yaml:"checkSecurebootStatusOnEnroll,omitempty"`
}

EncryptionKeyTPM represents a key that is generated and then sealed/unsealed by the TPM.

func (*EncryptionKeyTPM) CheckSecurebootOnEnroll added in v1.10.0

func (e *EncryptionKeyTPM) CheckSecurebootOnEnroll() bool

CheckSecurebootOnEnroll implements the config.Provider interface.

func (EncryptionKeyTPM) Doc added in v1.10.0

func (EncryptionKeyTPM) Doc() *encoder.Doc

func (*EncryptionKeyTPM) PCRs added in v1.12.0

func (e *EncryptionKeyTPM) PCRs() []int

PCRs implements the config.Provider interface.

func (*EncryptionKeyTPM) PubKeyPCRs added in v1.12.0

func (e *EncryptionKeyTPM) PubKeyPCRs() []int

PubKeyPCRs implements the config.Provider interface.

func (*EncryptionKeyTPM) String added in v1.10.0

func (e *EncryptionKeyTPM) String() string

String implements the config.Provider interface.

type EncryptionKeyTPMOptions added in v1.12.0

type EncryptionKeyTPMOptions struct {
	//   description: >
	//     List of PCRs to bind the key to.
	//     If not set, defaults to PCR 7, can be disabled by passing an empty list.
	PCRs []int `yaml:"pcrs,omitempty"`
}

EncryptionKeyTPMOptions represents the options for TPM-based key protection.

func (EncryptionKeyTPMOptions) Doc added in v1.12.0

type EncryptionSpec added in v1.10.0

type EncryptionSpec struct {
	//   description: >
	//     Encryption provider to use for the encryption.
	//   values:
	//     - luks2
	EncryptionProvider block.EncryptionProviderType `yaml:"provider"`
	//   description: >
	//     Defines the encryption keys generation and storage method.
	EncryptionKeys []EncryptionKey `yaml:"keys"`
	//   description: >
	//     Cipher to use for the encryption.
	//     Depends on the encryption provider.
	//   values:
	//     - aes-xts-plain64
	//     - xchacha12,aes-adiantum-plain64
	//     - xchacha20,aes-adiantum-plain64
	//   examples:
	//     - value: '"aes-xts-plain64"'
	EncryptionCipher string `yaml:"cipher,omitempty"`
	//   description: >
	//     Defines the encryption key length.
	EncryptionKeySize uint `yaml:"keySize,omitempty"`
	//   description: >
	//     Defines the encryption sector size.
	//   examples:
	//     - value: '4096'
	EncryptionBlockSize uint64 `yaml:"blockSize,omitempty"`
	//   description: >
	//     Additional --perf parameters for the LUKS2 encryption.
	//   values:
	//     - no_read_workqueue
	//     - no_write_workqueue
	//     - same_cpu_crypt
	//   examples:
	//     -  value: >
	//          []string{"no_read_workqueue","no_write_workqueue"}
	EncryptionPerfOptions []string `yaml:"options,omitempty"`
}

EncryptionSpec represents volume encryption settings.

examples:
  - value: exampleEncryptionSpec()

func (EncryptionSpec) BlockSize added in v1.10.0

func (s EncryptionSpec) BlockSize() uint64

BlockSize implements the config.Provider interface.

func (EncryptionSpec) Cipher added in v1.10.0

func (s EncryptionSpec) Cipher() string

Cipher implements the config.Provider interface.

func (EncryptionSpec) Doc added in v1.10.0

func (EncryptionSpec) Doc() *encoder.Doc

func (EncryptionSpec) IsZero added in v1.12.0

func (s EncryptionSpec) IsZero() bool

IsZero checks if the encryption spec is zero.

func (EncryptionSpec) KeySize added in v1.10.0

func (s EncryptionSpec) KeySize() uint

KeySize implements the config.Provider interface.

func (EncryptionSpec) Keys added in v1.10.0

func (s EncryptionSpec) Keys() []config.EncryptionKey

Keys implements the config.Provider interface.

func (EncryptionSpec) Options added in v1.10.0

func (s EncryptionSpec) Options() []string

Options implements the config.Provider interface.

func (EncryptionSpec) Provider added in v1.10.0

Provider implements the config.Provider interface.

func (EncryptionSpec) Validate added in v1.10.0

func (s EncryptionSpec) Validate() ([]string, error)

Validate implements config.Validator interface.

type ExistingVolumeConfigV1Alpha1 added in v1.11.0

type ExistingVolumeConfigV1Alpha1 struct {
	meta.Meta `yaml:",inline"`

	//   description: |
	//     Name of the volume.
	//
	//     Name can only contain:
	//     lowercase and uppercase ASCII letters, digits, and hyphens.
	MetaName string `yaml:"name"`
	//   description: |
	//     The discovery describes how to find a volume.
	VolumeDiscoverySpec VolumeDiscoverySpec `yaml:"discovery,omitempty"`
	//   description: |
	//     The mount describes additional mount options.
	MountSpec MountSpec `yaml:"mount,omitempty"`
}

ExistingVolumeConfigV1Alpha1 is an existing volume configuration document.

description: |
  Existing volumes allow to mount partitions (or whole disks) that were created
  outside of Talos. Volume will be mounted under `/var/mnt/<name>`.
  The existing volume config name should not conflict with user volume names.
examples:
  - value: exampleExistingVolumeConfigV1Alpha1()
alias: ExistingVolumeConfig
schemaRoot: true
schemaMeta: v1alpha1/ExistingVolumeConfig

func NewExistingVolumeConfigV1Alpha1 added in v1.11.0

func NewExistingVolumeConfigV1Alpha1() *ExistingVolumeConfigV1Alpha1

NewExistingVolumeConfigV1Alpha1 creates a new raw volume config document.

func (*ExistingVolumeConfigV1Alpha1) Clone added in v1.11.0

Clone implements config.Document interface.

func (*ExistingVolumeConfigV1Alpha1) ConflictsWithKinds added in v1.11.0

func (s *ExistingVolumeConfigV1Alpha1) ConflictsWithKinds() []string

ConflictsWithKinds implements config.ConflictingDocument interface.

func (*ExistingVolumeConfigV1Alpha1) DeepCopy added in v1.11.0

DeepCopy generates a deep copy of *ExistingVolumeConfigV1Alpha1.

func (ExistingVolumeConfigV1Alpha1) Doc added in v1.11.0

func (*ExistingVolumeConfigV1Alpha1) ExistingVolumeConfigSignal added in v1.11.0

func (s *ExistingVolumeConfigV1Alpha1) ExistingVolumeConfigSignal()

ExistingVolumeConfigSignal is a signal for user volume config.

func (*ExistingVolumeConfigV1Alpha1) Mount added in v1.11.0

Mount implements config.ExistingVolumeConfig interface.

func (*ExistingVolumeConfigV1Alpha1) Name added in v1.11.0

Name implements config.NamedDocument interface.

func (*ExistingVolumeConfigV1Alpha1) Validate added in v1.11.0

Validate implements config.Validator interface.

func (*ExistingVolumeConfigV1Alpha1) VolumeDiscovery added in v1.11.0

VolumeDiscovery implements config.ExistingVolumeConfig interface.

type FilesystemSpec added in v1.10.0

type FilesystemSpec struct {
	//   description: |
	//     Filesystem type. Default is `xfs`.
	//   values:
	//     - ext4
	//     - xfs
	FilesystemType block.FilesystemType `yaml:"type,omitempty"`
	//   description: |
	//     Enables project quota support, valid only for 'xfs' filesystem.
	//
	//     Note: changing this value might require a full remount of the filesystem.
	ProjectQuotaSupportConfig *bool `yaml:"projectQuotaSupport,omitempty"`
}

FilesystemSpec configures the filesystem for the volume.

func (FilesystemSpec) Doc added in v1.10.0

func (FilesystemSpec) Doc() *encoder.Doc

func (FilesystemSpec) IsZero added in v1.12.0

func (s FilesystemSpec) IsZero() bool

IsZero checks if the filesystem spec is zero.

func (FilesystemSpec) ProjectQuotaSupport added in v1.11.0

func (s FilesystemSpec) ProjectQuotaSupport() bool

ProjectQuotaSupport implements config.FilesysteemConfig interface.

func (FilesystemSpec) Type added in v1.10.0

Type implements config.FilesystemConfig interface.

func (FilesystemSpec) Validate added in v1.10.0

func (s FilesystemSpec) Validate() ([]string, error)

Validate implements config.Validator interface.

type MountSpec added in v1.11.0

type MountSpec struct {
	//   description: |
	//     Mount the volume read-only.
	MountReadOnly *bool `yaml:"readOnly,omitempty"`
}

MountSpec describes how the volume is mounted.

func (MountSpec) Doc added in v1.11.0

func (MountSpec) Doc() *encoder.Doc

func (MountSpec) ReadOnly added in v1.11.0

func (s MountSpec) ReadOnly() bool

ReadOnly implements config.VolumeMountConfig interface.

type PercentageSize added in v1.12.0

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

PercentageSize is a size in percents.

func (PercentageSize) IsZero added in v1.12.0

func (ps PercentageSize) IsZero() bool

IsZero implements yaml.IsZeroer.

func (PercentageSize) MarshalText added in v1.12.0

func (ps PercentageSize) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*PercentageSize) Merge added in v1.12.3

func (ps *PercentageSize) Merge(other any) error

Merge implements merger interface.

func (*PercentageSize) UnmarshalText added in v1.12.0

func (ps *PercentageSize) UnmarshalText(text []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (PercentageSize) Value added in v1.12.0

func (ps PercentageSize) Value() uint64

Value returns the value.

type ProvisioningSpec

type ProvisioningSpec struct {
	//   description: |
	//     The disk selector expression.
	DiskSelectorSpec DiskSelector `yaml:"diskSelector,omitempty"`
	//   description: |
	//    Should the volume grow to the size of the disk (if possible).
	ProvisioningGrow *bool `yaml:"grow,omitempty"`
	//  description: |
	//    The minimum size of the volume.
	//
	//    Size is specified in bytes, but can be expressed in human readable format, e.g. 100MB.
	//  examples:
	//    - value: >
	//        "2.5GiB"
	//  schema:
	//    type: string
	ProvisioningMinSize ByteSize `yaml:"minSize,omitempty"`
	//  description: |
	//    The maximum size of the volume, if not specified the volume can grow to the size of the
	//    disk.
	//
	//    Size is specified in bytes or in percents. It can be expressed in human readable format, e.g. 100MB.
	//  examples:
	//    - value: >
	//        "50GiB"
	//    - value: >
	//        "80%"
	//  schema:
	//    type: string
	ProvisioningMaxSize Size `yaml:"maxSize,omitempty"`
}

ProvisioningSpec describes how the volume is provisioned.

func (ProvisioningSpec) DiskSelector

func (s ProvisioningSpec) DiskSelector() optional.Optional[cel.Expression]

DiskSelector implements config.VolumeProvisioningConfig interface.

func (ProvisioningSpec) Doc

func (ProvisioningSpec) Doc() *encoder.Doc

func (ProvisioningSpec) Grow

Grow implements config.VolumeProvisioningConfig interface.

func (ProvisioningSpec) IsZero added in v1.11.0

func (s ProvisioningSpec) IsZero() bool

IsZero checks if the provisioning spec is zero.

func (ProvisioningSpec) MaxSize

MaxSize implements config.VolumeProvisioningConfig interface.

func (ProvisioningSpec) MinSize

MinSize implements config.VolumeProvisioningConfig interface.

func (ProvisioningSpec) RelativeMaxSize added in v1.12.0

func (s ProvisioningSpec) RelativeMaxSize() optional.Optional[uint64]

RelativeMaxSize implements config.VolumeProvisioningConfig interface.

func (ProvisioningSpec) Validate added in v1.10.0

func (s ProvisioningSpec) Validate(required bool, sizeSupported bool) ([]string, error)

Validate the provisioning spec.

type RawVolumeConfigV1Alpha1 added in v1.11.0

type RawVolumeConfigV1Alpha1 struct {
	meta.Meta `yaml:",inline"`

	//   description: |
	//     Name of the volume.
	//
	//     Name might be between 1 and 34 characters long and can only contain:
	//     lowercase and uppercase ASCII letters, digits, and hyphens.
	MetaName string `yaml:"name"`
	//   description: |
	//     The provisioning describes how the volume is provisioned.
	ProvisioningSpec ProvisioningSpec `yaml:"provisioning,omitempty"`
	//   description: |
	//     The encryption describes how the volume is encrypted.
	EncryptionSpec EncryptionSpec `yaml:"encryption,omitempty"`
}

RawVolumeConfigV1Alpha1 is a raw volume configuration document.

	description: |
	  Raw volumes allow to create partitions without formatting them.
   If you want to use local storage, user volumes is a better choice,
   raw volumes are intended to be used with CSI provisioners.
	  The partition label is automatically generated as `r-<name>`.
	examples:
	  - value: exampleRawVolumeConfigV1Alpha1()
	alias: RawVolumeConfig
	schemaRoot: true
	schemaMeta: v1alpha1/RawVolumeConfig

func NewRawVolumeConfigV1Alpha1 added in v1.11.0

func NewRawVolumeConfigV1Alpha1() *RawVolumeConfigV1Alpha1

NewRawVolumeConfigV1Alpha1 creates a new raw volume config document.

func (*RawVolumeConfigV1Alpha1) Clone added in v1.11.0

Clone implements config.Document interface.

func (*RawVolumeConfigV1Alpha1) DeepCopy added in v1.11.0

DeepCopy generates a deep copy of *RawVolumeConfigV1Alpha1.

func (RawVolumeConfigV1Alpha1) Doc added in v1.11.0

func (*RawVolumeConfigV1Alpha1) Encryption added in v1.11.0

Encryption implements config.RawVolumeConfig interface.

func (*RawVolumeConfigV1Alpha1) Name added in v1.11.0

func (s *RawVolumeConfigV1Alpha1) Name() string

Name implements config.NamedDocument interface.

func (*RawVolumeConfigV1Alpha1) Provisioning added in v1.11.0

Provisioning implements config.RawVolumeConfig interface.

func (*RawVolumeConfigV1Alpha1) RawVolumeConfigSignal added in v1.11.0

func (s *RawVolumeConfigV1Alpha1) RawVolumeConfigSignal()

RawVolumeConfigSignal is a signal for user volume config.

func (*RawVolumeConfigV1Alpha1) Validate added in v1.11.0

Validate implements config.Validator interface.

type Size added in v1.12.0

type Size struct {
	PercentageSize *PercentageSize
	ByteSize       *ByteSize
}

Size is either a PercentageSize or ByteSize.

func MustSize added in v1.12.0

func MustSize(value string) Size

MustSize returns a new Size with the given value.

It panics if the value is invalid.

func (Size) IsRelative added in v1.12.0

func (s Size) IsRelative() bool

IsRelative returns if the Size is a relative size.

func (Size) IsZero added in v1.12.0

func (s Size) IsZero() bool

IsZero implements yaml.IsZeroer.

func (Size) MarshalText added in v1.12.0

func (s Size) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (Size) RelativeValue added in v1.12.0

func (s Size) RelativeValue() (uint64, bool)

RelativeValue returns the relative value.

func (*Size) UnmarshalText added in v1.12.0

func (s *Size) UnmarshalText(text []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (Size) Value added in v1.12.0

func (s Size) Value() uint64

Value returns the value.

type SwapVolumeConfigV1Alpha1 added in v1.11.0

type SwapVolumeConfigV1Alpha1 struct {
	meta.Meta `yaml:",inline"`

	//   description: |
	//     Name of the volume.
	//
	//     Name might be between 1 and 34 characters long and can only contain:
	//     lowercase and uppercase ASCII letters, digits, and hyphens.
	MetaName string `yaml:"name"`
	//   description: |
	//     The provisioning describes how the volume is provisioned.
	ProvisioningSpec ProvisioningSpec `yaml:"provisioning,omitempty"`
	//   description: |
	//     The encryption describes how the volume is encrypted.
	EncryptionSpec EncryptionSpec `yaml:"encryption,omitempty"`
}

SwapVolumeConfigV1Alpha1 is a disk swap volume configuration document.

description: |
  Swap volume is automatically allocated as a partition on the specified disk
  and activated as swap, removing a swap volume deactivates swap.
  The partition label is automatically generated as `s-<name>`.
examples:
  - value: exampleSwapVolumeConfigV1Alpha1()
alias: SwapVolumeConfig
schemaRoot: true
schemaMeta: v1alpha1/SwapVolumeConfig

func NewSwapVolumeConfigV1Alpha1 added in v1.11.0

func NewSwapVolumeConfigV1Alpha1() *SwapVolumeConfigV1Alpha1

NewSwapVolumeConfigV1Alpha1 creates a new user volume config document.

func (*SwapVolumeConfigV1Alpha1) Clone added in v1.11.0

Clone implements config.Document interface.

func (*SwapVolumeConfigV1Alpha1) DeepCopy added in v1.11.0

DeepCopy generates a deep copy of *SwapVolumeConfigV1Alpha1.

func (SwapVolumeConfigV1Alpha1) Doc added in v1.11.0

func (*SwapVolumeConfigV1Alpha1) Encryption added in v1.11.0

Encryption implements config.SwapVolumeConfig interface.

func (*SwapVolumeConfigV1Alpha1) Name added in v1.11.0

func (s *SwapVolumeConfigV1Alpha1) Name() string

Name implements config.NamedDocument interface.

func (*SwapVolumeConfigV1Alpha1) Provisioning added in v1.11.0

Provisioning implements config.SwapVolumeConfig interface.

func (*SwapVolumeConfigV1Alpha1) SwapVolumeConfigSignal added in v1.11.0

func (s *SwapVolumeConfigV1Alpha1) SwapVolumeConfigSignal()

SwapVolumeConfigSignal is a signal for swap volume config.

func (*SwapVolumeConfigV1Alpha1) Validate added in v1.11.0

Validate implements config.Validator interface.

type UserVolumeConfigV1Alpha1 added in v1.10.0

type UserVolumeConfigV1Alpha1 struct {
	meta.Meta `yaml:",inline"`

	//   description: |
	//     Name of the volume.
	//
	//     Name might be between 1 and 34 characters long and can only contain:
	//     lowercase and uppercase ASCII letters, digits, and hyphens.
	MetaName string `yaml:"name"`
	//   description: |
	//     Volume type.
	//   values:
	//     - directory
	//     - disk
	//     - partition
	//  schema:
	//    type: string
	VolumeType *VolumeType `yaml:"volumeType,omitempty"`
	//   description: |
	//     The provisioning describes how the volume is provisioned.
	ProvisioningSpec ProvisioningSpec `yaml:"provisioning,omitempty"`
	//   description: |
	//     The filesystem describes how the volume is formatted.
	FilesystemSpec FilesystemSpec `yaml:"filesystem,omitempty"`
	//   description: |
	//     The encryption describes how the volume is encrypted.
	EncryptionSpec EncryptionSpec `yaml:"encryption,omitempty"`
}

UserVolumeConfigV1Alpha1 is a user volume configuration document.

description: |
  User volume is automatically allocated as a partition on the specified disk
  and mounted under `/var/mnt/<name>`.
  The partition label is automatically generated as `u-<name>`.
examples:
  - value: exampleUserVolumeConfigV1Alpha1Directory()
  - value: exampleUserVolumeConfigV1Alpha1Disk()
  - value: exampleUserVolumeConfigV1Alpha1Partition()
alias: UserVolumeConfig
schemaRoot: true
schemaMeta: v1alpha1/UserVolumeConfig

func NewUserVolumeConfigV1Alpha1 added in v1.10.0

func NewUserVolumeConfigV1Alpha1() *UserVolumeConfigV1Alpha1

NewUserVolumeConfigV1Alpha1 creates a new user volume config document.

func (*UserVolumeConfigV1Alpha1) Clone added in v1.10.0

Clone implements config.Document interface.

func (*UserVolumeConfigV1Alpha1) ConflictsWithKinds added in v1.11.0

func (s *UserVolumeConfigV1Alpha1) ConflictsWithKinds() []string

ConflictsWithKinds implements config.ConflictingDocument interface.

func (*UserVolumeConfigV1Alpha1) DeepCopy added in v1.10.0

DeepCopy generates a deep copy of *UserVolumeConfigV1Alpha1.

func (UserVolumeConfigV1Alpha1) Doc added in v1.10.0

func (*UserVolumeConfigV1Alpha1) Encryption added in v1.10.0

Encryption implements config.UserVolumeConfig interface.

func (*UserVolumeConfigV1Alpha1) Filesystem added in v1.10.0

Filesystem implements config.UserVolumeConfig interface.

func (*UserVolumeConfigV1Alpha1) Name added in v1.10.0

func (s *UserVolumeConfigV1Alpha1) Name() string

Name implements config.NamedDocument interface.

func (*UserVolumeConfigV1Alpha1) Provisioning added in v1.10.0

Provisioning implements config.UserVolumeConfig interface.

func (*UserVolumeConfigV1Alpha1) Type added in v1.12.0

Type implements config.UserVolumeConfig interface.

func (*UserVolumeConfigV1Alpha1) UserVolumeConfigSignal added in v1.10.0

func (s *UserVolumeConfigV1Alpha1) UserVolumeConfigSignal()

UserVolumeConfigSignal is a signal for user volume config.

func (*UserVolumeConfigV1Alpha1) Validate added in v1.10.0

Validate implements config.Validator interface.

type VolumeConfigV1Alpha1

type VolumeConfigV1Alpha1 struct {
	meta.Meta `yaml:",inline"`

	//   description: |
	//     Name of the volume.
	MetaName string `yaml:"name"`
	//   description: |
	//     The provisioning describes how the volume is provisioned.
	ProvisioningSpec ProvisioningSpec `yaml:"provisioning,omitempty"`
	//   description: |
	//     The encryption describes how the volume is encrypted.
	EncryptionSpec EncryptionSpec `yaml:"encryption,omitempty"`
}

VolumeConfigV1Alpha1 is a system volume configuration document.

description: |
  Note: at the moment, only `STATE`, `EPHEMERAL` and `IMAGE-CACHE` system volumes are supported.
examples:
  - value: exampleVolumeConfigEphemeralV1Alpha1()
alias: VolumeConfig
schemaRoot: true
schemaMeta: v1alpha1/VolumeConfig

func NewVolumeConfigV1Alpha1

func NewVolumeConfigV1Alpha1() *VolumeConfigV1Alpha1

NewVolumeConfigV1Alpha1 creates a new volume config document.

func (*VolumeConfigV1Alpha1) Clone

Clone implements config.Document interface.

func (*VolumeConfigV1Alpha1) DeepCopy

DeepCopy generates a deep copy of *VolumeConfigV1Alpha1.

func (VolumeConfigV1Alpha1) Doc

func (*VolumeConfigV1Alpha1) Encryption added in v1.11.0

Encryption implements config.VolumeConfig interface.

func (*VolumeConfigV1Alpha1) Name

func (s *VolumeConfigV1Alpha1) Name() string

Name implements config.NamedDocument interface.

func (*VolumeConfigV1Alpha1) Provisioning

Provisioning implements config.VolumeConfig interface.

func (*VolumeConfigV1Alpha1) V1Alpha1ConflictValidate added in v1.12.0

func (s *VolumeConfigV1Alpha1) V1Alpha1ConflictValidate(v1alpha1Config *v1alpha1.Config) error

V1Alpha1ConflictValidate implements container.V1Alpha1ConflictValidator interface.

func (*VolumeConfigV1Alpha1) Validate

Validate implements config.Validator interface.

type VolumeDiscoverySpec added in v1.11.0

type VolumeDiscoverySpec struct {
	//   description: |
	//     The volume selector expression.
	VolumeSelectorConfig VolumeSelector `yaml:"volumeSelector,omitempty"`
}

VolumeDiscoverySpec describes how the volume is discovered.

func (VolumeDiscoverySpec) Doc added in v1.11.0

func (VolumeDiscoverySpec) Validate added in v1.11.0

func (s VolumeDiscoverySpec) Validate(required bool) ([]string, error)

Validate the provisioning spec.

func (VolumeDiscoverySpec) VolumeSelector added in v1.11.0

func (s VolumeDiscoverySpec) VolumeSelector() cel.Expression

VolumeSelector implements config.VolumeDiscoveryConfig interface.

type VolumeSelector added in v1.11.0

type VolumeSelector struct {
	//   description: |
	//     The Common Expression Language (CEL) expression to match the volume.
	//   schema:
	//     type: string
	//   examples:
	//    - value: >
	//        exampleVolumeSelector1()
	//      name: match volumes with partition label MY-DATA
	//    - value: >
	//        exampleVolumeSelector2()
	//      name: match xfs volume on disk with serial 'SERIAL123'
	Match cel.Expression `yaml:"match,omitempty"`
}

VolumeSelector selects an existing volume.

func (VolumeSelector) Doc added in v1.11.0

func (VolumeSelector) Doc() *encoder.Doc

type VolumeType added in v1.12.0

type VolumeType = block.VolumeType

VolumeType is an alias for block.VolumeType.

type ZswapConfigV1Alpha1 added in v1.11.0

type ZswapConfigV1Alpha1 struct {
	meta.Meta `yaml:",inline"`

	//   description: |
	//     The maximum percent of memory that zswap can use.
	//     This is a percentage of the total system memory.
	//     The value must be between 0 and 100.
	MaxPoolPercentConfig *int `yaml:"maxPoolPercent,omitempty"`
	//   description: |
	//    Enable the shrinker feature: kernel might move
	//    cold pages from zswap to swap device to free up memory
	//    for other use cases.
	ShrinkerEnabledConfig *bool `yaml:"shrinkerEnabled,omitempty"`
}

ZswapConfigV1Alpha1 is a zswap (compressed memory) configuration document.

description: |
  When zswap is enabled, Linux kernel compresses pages that would otherwise be swapped out to disk.
  The compressed pages are stored in a memory pool, which is used to avoid writing to disk
  when the system is under memory pressure.
examples:
  - value: exampleZswapConfigV1Alpha1()
alias: ZswapConfig
schemaRoot: true
schemaMeta: v1alpha1/ZswapConfig

func NewZswapConfigV1Alpha1 added in v1.11.0

func NewZswapConfigV1Alpha1() *ZswapConfigV1Alpha1

NewZswapConfigV1Alpha1 creates a new zswap config document.

func (*ZswapConfigV1Alpha1) Clone added in v1.11.0

func (s *ZswapConfigV1Alpha1) Clone() config.Document

Clone implements config.Document interface.

func (*ZswapConfigV1Alpha1) DeepCopy added in v1.11.0

DeepCopy generates a deep copy of *ZswapConfigV1Alpha1.

func (ZswapConfigV1Alpha1) Doc added in v1.11.0

func (*ZswapConfigV1Alpha1) MaxPoolPercent added in v1.11.0

func (s *ZswapConfigV1Alpha1) MaxPoolPercent() int

MaxPoolPercent implements config.ZswapConfig interface.

func (*ZswapConfigV1Alpha1) ShrinkerEnabled added in v1.11.0

func (s *ZswapConfigV1Alpha1) ShrinkerEnabled() bool

ShrinkerEnabled implements config.ZswapConfig interface.

func (*ZswapConfigV1Alpha1) Validate added in v1.11.0

Validate implements config.Validator interface.

func (*ZswapConfigV1Alpha1) ZswapConfigSignal added in v1.11.0

func (s *ZswapConfigV1Alpha1) ZswapConfigSignal()

ZswapConfigSignal is a signal for zswap config.

Directories

Path Synopsis
Package blockhelpers provides helper functions for working with block resources.
Package blockhelpers provides helper functions for working with block resources.

Jump to

Keyboard shortcuts

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