v1

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package v1 contains API Schema definitions for the vko v1 API group. +kubebuilder:object:generate=true +groupName=vko.gtrfc.com

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects.
	GroupVersion = schema.GroupVersion{Group: "vko.gtrfc.com", Version: "v1"}

	// SchemeBuilder is used to add go types to the GroupVersionResource scheme.
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

This section is empty.

Types

type AuthSpec

type AuthSpec struct {
	// SecretName is the name of the Kubernetes Secret containing the password.
	// +optional
	SecretName string `json:"secretName,omitempty"`

	// SecretPasswordKey is the key within the Secret that holds the password.
	// +kubebuilder:default=password
	// +optional
	SecretPasswordKey string `json:"secretPasswordKey,omitempty"`
}

AuthSpec defines authentication configuration for Valkey.

func (*AuthSpec) DeepCopy

func (in *AuthSpec) DeepCopy() *AuthSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthSpec.

func (*AuthSpec) DeepCopyInto

func (in *AuthSpec) DeepCopyInto(out *AuthSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CertManagerIssuerSpec

type CertManagerIssuerSpec struct {
	// Group is the API group of the issuer (defaults to cert-manager.io).
	// +kubebuilder:default="cert-manager.io"
	// +optional
	Group string `json:"group,omitempty"`

	// Kind is the kind of the issuer (Issuer or ClusterIssuer).
	// +kubebuilder:validation:Enum=Issuer;ClusterIssuer
	Kind string `json:"kind"`

	// Name is the name of the issuer resource.
	Name string `json:"name"`
}

CertManagerIssuerSpec defines the cert-manager issuer reference.

func (*CertManagerIssuerSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertManagerIssuerSpec.

func (*CertManagerIssuerSpec) DeepCopyInto

func (in *CertManagerIssuerSpec) DeepCopyInto(out *CertManagerIssuerSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CertManagerSpec

type CertManagerSpec struct {
	// Issuer references the cert-manager issuer to use.
	Issuer CertManagerIssuerSpec `json:"issuer"`

	// ExtraDNSNames specifies additional DNS names to include in the certificate
	// beyond the automatically generated ones (pod DNS names, service names).
	// +optional
	ExtraDNSNames []string `json:"extraDnsNames,omitempty"`
}

CertManagerSpec defines the cert-manager configuration.

func (*CertManagerSpec) DeepCopy

func (in *CertManagerSpec) DeepCopy() *CertManagerSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertManagerSpec.

func (*CertManagerSpec) DeepCopyInto

func (in *CertManagerSpec) DeepCopyInto(out *CertManagerSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ConditionType added in v1.2.0

type ConditionType = string

ConditionType is the type identifier for a status condition.

const (
	// ConditionTypeSidecarUpdatePending is set on standalone Valkey instances when
	// the sidecar container image has drifted from the desired version.
	// Standalone pods are not automatically restarted for sidecar-only changes;
	// the update will occur on the next pod restart (manual delete or image change).
	ConditionTypeSidecarUpdatePending ConditionType = "SidecarUpdatePending"
)

type MetricsSpec

type MetricsSpec struct {
	// Enabled activates the metrics exporter sidecar.
	// +kubebuilder:default=false
	Enabled bool `json:"enabled,omitempty"`
}

MetricsSpec defines metrics/exporter configuration.

func (*MetricsSpec) DeepCopy

func (in *MetricsSpec) DeepCopy() *MetricsSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricsSpec.

func (*MetricsSpec) DeepCopyInto

func (in *MetricsSpec) DeepCopyInto(out *MetricsSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type NetworkPolicySpec

type NetworkPolicySpec struct {
	// Enabled activates NetworkPolicy creation.
	// +kubebuilder:default=false
	Enabled bool `json:"enabled,omitempty"`

	// NamePrefix is prepended to generated NetworkPolicy names.
	// +optional
	NamePrefix string `json:"namePrefix,omitempty"`
}

NetworkPolicySpec defines network policy configuration.

func (*NetworkPolicySpec) DeepCopy

func (in *NetworkPolicySpec) DeepCopy() *NetworkPolicySpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkPolicySpec.

func (*NetworkPolicySpec) DeepCopyInto

func (in *NetworkPolicySpec) DeepCopyInto(out *NetworkPolicySpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PersistenceMode

type PersistenceMode string

PersistenceMode defines the persistence strategy for Valkey. +kubebuilder:validation:Enum=rdb;aof;both

const (
	// PersistenceModeRDB enables RDB snapshotting.
	PersistenceModeRDB PersistenceMode = "rdb"
	// PersistenceModeAOF enables append-only file persistence.
	PersistenceModeAOF PersistenceMode = "aof"
	// PersistenceModeBoth enables both RDB and AOF persistence.
	PersistenceModeBoth PersistenceMode = "both"
)

type PersistenceSpec

type PersistenceSpec struct {
	// Enabled activates persistent storage for Valkey data.
	// +kubebuilder:default=false
	Enabled bool `json:"enabled,omitempty"`

	// Mode selects the persistence strategy: rdb, aof, or both.
	// +kubebuilder:default=rdb
	// +optional
	Mode PersistenceMode `json:"mode,omitempty"`

	// StorageClass is the name of the StorageClass to use. Empty string means default.
	// +optional
	StorageClass string `json:"storageClass,omitempty"`

	// Size is the requested storage size.
	// +kubebuilder:default="1Gi"
	// +optional
	Size resource.Quantity `json:"size,omitempty"`
}

PersistenceSpec defines data persistence configuration.

func (*PersistenceSpec) DeepCopy

func (in *PersistenceSpec) DeepCopy() *PersistenceSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PersistenceSpec.

func (*PersistenceSpec) DeepCopyInto

func (in *PersistenceSpec) DeepCopyInto(out *PersistenceSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SentinelSpec

type SentinelSpec struct {
	// Enabled activates Sentinel-based HA mode.
	// +kubebuilder:default=false
	Enabled bool `json:"enabled,omitempty"`

	// Replicas is the number of Sentinel instances to run.
	// +kubebuilder:validation:Minimum=1
	// +kubebuilder:default=3
	Replicas int32 `json:"replicas,omitempty"`

	// PodLabels are additional labels applied to Sentinel pods.
	// +optional
	PodLabels map[string]string `json:"podLabels,omitempty"`

	// PodAnnotations are additional annotations applied to Sentinel pods.
	// +optional
	PodAnnotations map[string]string `json:"podAnnotations,omitempty"`

	// AllowUnencrypted keeps the plaintext Sentinel port (26379) open alongside the TLS port (36379).
	// Only effective when spec.tls.enabled is true. Default: false.
	// +kubebuilder:default=false
	// +optional
	AllowUnencrypted bool `json:"allowUnencrypted,omitempty"`
}

SentinelSpec defines the Sentinel configuration embedded in the Valkey CRD.

func (*SentinelSpec) DeepCopy

func (in *SentinelSpec) DeepCopy() *SentinelSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SentinelSpec.

func (*SentinelSpec) DeepCopyInto

func (in *SentinelSpec) DeepCopyInto(out *SentinelSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TLSSpec

type TLSSpec struct {
	// Enabled activates TLS encryption.
	// +kubebuilder:default=false
	Enabled bool `json:"enabled,omitempty"`

	// CertManager configures cert-manager integration for automatic certificate management.
	// Mutually exclusive with SecretName.
	// +optional
	CertManager *CertManagerSpec `json:"certManager,omitempty"`

	// SecretName references an existing Kubernetes Secret containing TLS certificates.
	// The Secret must contain keys: tls.crt, tls.key, and ca.crt.
	// Mutually exclusive with CertManager.
	// +optional
	SecretName string `json:"secretName,omitempty"`

	// AllowUnencrypted keeps the plaintext Valkey port (6379) open alongside the TLS port (16379).
	// Internal replication always uses TLS. Default: false (plaintext port disabled when TLS is active).
	// +kubebuilder:default=false
	// +optional
	AllowUnencrypted bool `json:"allowUnencrypted,omitempty"`
}

TLSSpec defines TLS configuration for Valkey.

func (*TLSSpec) DeepCopy

func (in *TLSSpec) DeepCopy() *TLSSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TLSSpec.

func (*TLSSpec) DeepCopyInto

func (in *TLSSpec) DeepCopyInto(out *TLSSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Valkey

type Valkey struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   ValkeySpec   `json:"spec,omitempty"`
	Status ValkeyStatus `json:"status,omitempty"`
}

Valkey is the Schema for the valkeys API.

func (*Valkey) DeepCopy

func (in *Valkey) DeepCopy() *Valkey

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Valkey.

func (*Valkey) DeepCopyInto

func (in *Valkey) DeepCopyInto(out *Valkey)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Valkey) DeepCopyObject

func (in *Valkey) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*Valkey) IsAuthEnabled

func (v *Valkey) IsAuthEnabled() bool

IsAuthEnabled returns true if authentication is configured.

func (*Valkey) IsCertManagerEnabled

func (v *Valkey) IsCertManagerEnabled() bool

IsCertManagerEnabled returns true if TLS is enabled and cert-manager is configured.

func (*Valkey) IsMetricsEnabled

func (v *Valkey) IsMetricsEnabled() bool

IsMetricsEnabled returns true if metrics exporter is enabled.

func (*Valkey) IsNetworkPolicyEnabled

func (v *Valkey) IsNetworkPolicyEnabled() bool

IsNetworkPolicyEnabled returns true if network policies are enabled.

func (*Valkey) IsPersistenceEnabled

func (v *Valkey) IsPersistenceEnabled() bool

IsPersistenceEnabled returns true if persistence is configured and enabled.

func (*Valkey) IsSentinelEnabled

func (v *Valkey) IsSentinelEnabled() bool

IsSentinelEnabled returns true if Sentinel HA mode is configured and enabled.

func (*Valkey) IsSentinelUnencryptedAllowed added in v1.3.0

func (v *Valkey) IsSentinelUnencryptedAllowed() bool

IsSentinelUnencryptedAllowed returns true when TLS is enabled but the plaintext Sentinel port (26379) should remain open alongside the TLS port (36379).

func (*Valkey) IsTLSEnabled

func (v *Valkey) IsTLSEnabled() bool

IsTLSEnabled returns true if TLS is configured and enabled.

func (*Valkey) IsTLSSecretProvided

func (v *Valkey) IsTLSSecretProvided() bool

IsTLSSecretProvided returns true if TLS is enabled with a user-provided Secret.

func (*Valkey) IsValkeyUnencryptedAllowed added in v1.3.0

func (v *Valkey) IsValkeyUnencryptedAllowed() bool

IsValkeyUnencryptedAllowed returns true when TLS is enabled but the plaintext Valkey port (6379) should remain open alongside the TLS port (16379).

type ValkeyList

type ValkeyList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Valkey `json:"items"`
}

ValkeyList contains a list of Valkey.

func (*ValkeyList) DeepCopy

func (in *ValkeyList) DeepCopy() *ValkeyList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ValkeyList.

func (*ValkeyList) DeepCopyInto

func (in *ValkeyList) DeepCopyInto(out *ValkeyList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ValkeyList) DeepCopyObject

func (in *ValkeyList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ValkeyPhase

type ValkeyPhase string

ValkeyPhase describes the current phase of the Valkey instance.

const (
	// ValkeyPhaseOK indicates a healthy instance.
	ValkeyPhaseOK ValkeyPhase = "OK"
	// ValkeyPhaseProvisioning indicates the instance is being set up.
	ValkeyPhaseProvisioning ValkeyPhase = "Provisioning"
	// ValkeyphaseSyncing indicates replication is in progress.
	ValkeyphaseSyncing ValkeyPhase = "Syncing"
	// ValkeyPhaseRollingUpdate indicates a rolling update is in progress.
	ValkeyPhaseRollingUpdate ValkeyPhase = "Rolling Update"
	// ValkeyPhaseFailover indicates a failover is in progress.
	ValkeyPhaseFailover ValkeyPhase = "Failover in progress"
	// ValkeyPhaseError indicates an error state.
	ValkeyPhaseError ValkeyPhase = "Error"
)

type ValkeySpec

type ValkeySpec struct {
	// Replicas is the number of Valkey instances to run.
	// +kubebuilder:validation:Minimum=1
	// +kubebuilder:default=1
	Replicas int32 `json:"replicas,omitempty"`

	// Image is the Valkey container image to use.
	// +kubebuilder:validation:MinLength=1
	Image string `json:"image"`

	// Sentinel configures Sentinel-based HA mode.
	// +optional
	Sentinel *SentinelSpec `json:"sentinel,omitempty"`

	// Auth configures authentication.
	// +optional
	Auth *AuthSpec `json:"auth,omitempty"`

	// TLS configures TLS encryption.
	// +optional
	TLS *TLSSpec `json:"tls,omitempty"`

	// Metrics configures the metrics exporter.
	// +optional
	Metrics *MetricsSpec `json:"metrics,omitempty"`

	// NetworkPolicy configures network policies.
	// +optional
	NetworkPolicy *NetworkPolicySpec `json:"networkPolicy,omitempty"`

	// Persistence configures data persistence.
	// +optional
	Persistence *PersistenceSpec `json:"persistence,omitempty"`

	// PodLabels are additional labels applied to Valkey pods.
	// +optional
	PodLabels map[string]string `json:"podLabels,omitempty"`

	// PodAnnotations are additional annotations applied to Valkey pods.
	// +optional
	PodAnnotations map[string]string `json:"podAnnotations,omitempty"`

	// Resources defines the compute resource requirements for Valkey containers.
	// +optional
	Resources corev1.ResourceRequirements `json:"resources,omitempty"`
}

ValkeySpec defines the desired state of Valkey.

func (*ValkeySpec) DeepCopy

func (in *ValkeySpec) DeepCopy() *ValkeySpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ValkeySpec.

func (*ValkeySpec) DeepCopyInto

func (in *ValkeySpec) DeepCopyInto(out *ValkeySpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ValkeyStatus

type ValkeyStatus struct {
	// ReadyReplicas is the number of ready Valkey instances.
	ReadyReplicas int32 `json:"readyReplicas,omitempty"`

	// MasterPod is the name of the current master pod.
	// +optional
	MasterPod string `json:"masterPod,omitempty"`

	// Phase describes the current lifecycle phase of the Valkey cluster.
	// +optional
	Phase ValkeyPhase `json:"phase,omitempty"`

	// Message is a human-readable description of the current state.
	// +optional
	Message string `json:"message,omitempty"`

	// OperatorVersion is the version of the operator that last reconciled this resource.
	// +optional
	OperatorVersion string `json:"operatorVersion,omitempty"`

	// Conditions represent the latest available observations of the Valkey state.
	// +optional
	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

ValkeyStatus defines the observed state of Valkey.

func (*ValkeyStatus) DeepCopy

func (in *ValkeyStatus) DeepCopy() *ValkeyStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ValkeyStatus.

func (*ValkeyStatus) DeepCopyInto

func (in *ValkeyStatus) DeepCopyInto(out *ValkeyStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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