diff --git a/api/v1alpha1/common_types.go b/api/v1alpha1/common_types.go index c295eb77..10478440 100644 --- a/api/v1alpha1/common_types.go +++ b/api/v1alpha1/common_types.go @@ -69,6 +69,11 @@ type StorageSpec struct { // +kubebuilder:validation:MinLength=1 // +kubebuilder:validation:MaxLength=63 Class string `json:"class,omitempty"` + + // AccessModes contains the desired access modes the volume should have. + // More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes + // +optional + AccessModes []corev1.PersistentVolumeAccessMode `json:"accessModes,omitempty"` } // ContainerConfig defines generic container configuration. diff --git a/api/v1alpha1/shard_types.go b/api/v1alpha1/shard_types.go index 123058be..37c0aea2 100644 --- a/api/v1alpha1/shard_types.go +++ b/api/v1alpha1/shard_types.go @@ -36,6 +36,7 @@ import ( // +kubebuilder:rbac:groups=apps,resources=deployments;statefulsets,verbs=get;list;watch;create;update;patch;delete // +kubebuilder:rbac:groups="",resources=services,verbs=get;list;watch;create;update;patch;delete // +kubebuilder:rbac:groups="",resources=persistentvolumeclaims,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups="",resources=configmaps,verbs=get;list;watch;create;update;patch;delete // ============================================================================ // Shard Component Specs (Reusable) @@ -77,13 +78,10 @@ type PoolSpec struct { // +optional Storage StorageSpec `json:"storage,omitempty"` - // BackupStorageType defines how backup storage is provided. - // Valid values are "hostPath" (for single-node testing) and "pvc" (for production). - // Defaults to "hostPath". + // BackupStorage defines the storage configuration for backup volumes. + // Shared across all pods in a pool. Defaults to same as Storage if not specified. // +optional - // +kubebuilder:validation:Enum=hostPath;pvc - // +kubebuilder:default="hostPath" - BackupStorageType string `json:"backupStorageType,omitempty"` + BackupStorage StorageSpec `json:"backupStorage,omitempty"` // Postgres container configuration. // +optional diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index 07d8aeda..ec25e6a2 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -468,7 +468,7 @@ func (in *EtcdSpec) DeepCopyInto(out *EtcdSpec) { *out = new(int32) **out = **in } - out.Storage = in.Storage + in.Storage.DeepCopyInto(&out.Storage) in.Resources.DeepCopyInto(&out.Resources) } @@ -757,7 +757,8 @@ func (in *PoolSpec) DeepCopyInto(out *PoolSpec) { *out = new(int32) **out = **in } - out.Storage = in.Storage + in.Storage.DeepCopyInto(&out.Storage) + in.BackupStorage.DeepCopyInto(&out.BackupStorage) in.Postgres.DeepCopyInto(&out.Postgres) in.Multipooler.DeepCopyInto(&out.Multipooler) if in.Affinity != nil { @@ -1134,6 +1135,11 @@ func (in *StatelessSpec) DeepCopy() *StatelessSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *StorageSpec) DeepCopyInto(out *StorageSpec) { *out = *in + if in.AccessModes != nil { + in, out := &in.AccessModes, &out.AccessModes + *out = make([]v1.PersistentVolumeAccessMode, len(*in)) + copy(*out, *in) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageSpec.