Skip to content

Commit 8b63e47

Browse files
authored
Merge pull request #115 from numtide/add-pvc-rbac-for-backup
Add pvc handling for controller
2 parents c02430f + f0cdef4 commit 8b63e47

File tree

6 files changed

+60
-0
lines changed

6 files changed

+60
-0
lines changed

api/v1alpha1/shard_types.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import (
3535
// +kubebuilder:rbac:groups=multigres.com,resources=shards/finalizers,verbs=update
3636
// +kubebuilder:rbac:groups=apps,resources=deployments;statefulsets,verbs=get;list;watch;create;update;patch;delete
3737
// +kubebuilder:rbac:groups="",resources=services,verbs=get;list;watch;create;update;patch;delete
38+
// +kubebuilder:rbac:groups="",resources=persistentvolumeclaims,verbs=get;list;watch;create;update;patch;delete
3839

3940
// ============================================================================
4041
// Shard Component Specs (Reusable)
@@ -76,6 +77,14 @@ type PoolSpec struct {
7677
// +optional
7778
Storage StorageSpec `json:"storage,omitempty"`
7879

80+
// BackupStorageType defines how backup storage is provided.
81+
// Valid values are "hostPath" (for single-node testing) and "pvc" (for production).
82+
// Defaults to "hostPath".
83+
// +optional
84+
// +kubebuilder:validation:Enum=hostPath;pvc
85+
// +kubebuilder:default="hostPath"
86+
BackupStorageType string `json:"backupStorageType,omitempty"`
87+
7988
// Postgres container configuration.
8089
// +optional
8190
Postgres ContainerConfig `json:"postgres,omitempty"`

config/crd/bases/multigres.com_multigresclusters.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4401,6 +4401,16 @@ spec:
44014401
x-kubernetes-list-type: atomic
44024402
type: object
44034403
type: object
4404+
backupStorageType:
4405+
default: hostPath
4406+
description: |-
4407+
BackupStorageType defines how backup storage is provided.
4408+
Valid values are "hostPath" (for single-node testing) and "pvc" (for production).
4409+
Defaults to "hostPath".
4410+
enum:
4411+
- hostPath
4412+
- pvc
4413+
type: string
44044414
cells:
44054415
description: Cells defines the list of
44064416
cells where this Pool should be deployed.
@@ -6669,6 +6679,16 @@ spec:
66696679
x-kubernetes-list-type: atomic
66706680
type: object
66716681
type: object
6682+
backupStorageType:
6683+
default: hostPath
6684+
description: |-
6685+
BackupStorageType defines how backup storage is provided.
6686+
Valid values are "hostPath" (for single-node testing) and "pvc" (for production).
6687+
Defaults to "hostPath".
6688+
enum:
6689+
- hostPath
6690+
- pvc
6691+
type: string
66726692
cells:
66736693
description: Cells defines the list of
66746694
cells where this Pool should be deployed.

config/crd/bases/multigres.com_shards.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2066,6 +2066,16 @@ spec:
20662066
x-kubernetes-list-type: atomic
20672067
type: object
20682068
type: object
2069+
backupStorageType:
2070+
default: hostPath
2071+
description: |-
2072+
BackupStorageType defines how backup storage is provided.
2073+
Valid values are "hostPath" (for single-node testing) and "pvc" (for production).
2074+
Defaults to "hostPath".
2075+
enum:
2076+
- hostPath
2077+
- pvc
2078+
type: string
20692079
cells:
20702080
description: Cells defines the list of cells where this Pool
20712081
should be deployed.

config/crd/bases/multigres.com_shardtemplates.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1982,6 +1982,16 @@ spec:
19821982
x-kubernetes-list-type: atomic
19831983
type: object
19841984
type: object
1985+
backupStorageType:
1986+
default: hostPath
1987+
description: |-
1988+
BackupStorageType defines how backup storage is provided.
1989+
Valid values are "hostPath" (for single-node testing) and "pvc" (for production).
1990+
Defaults to "hostPath".
1991+
enum:
1992+
- hostPath
1993+
- pvc
1994+
type: string
19851995
cells:
19861996
description: Cells defines the list of cells where this Pool
19871997
should be deployed.

config/crd/bases/multigres.com_tablegroups.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2097,6 +2097,16 @@ spec:
20972097
x-kubernetes-list-type: atomic
20982098
type: object
20992099
type: object
2100+
backupStorageType:
2101+
default: hostPath
2102+
description: |-
2103+
BackupStorageType defines how backup storage is provided.
2104+
Valid values are "hostPath" (for single-node testing) and "pvc" (for production).
2105+
Defaults to "hostPath".
2106+
enum:
2107+
- hostPath
2108+
- pvc
2109+
type: string
21002110
cells:
21012111
description: Cells defines the list of cells where this
21022112
Pool should be deployed.

config/rbac/role.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ rules:
77
- apiGroups:
88
- ""
99
resources:
10+
- persistentvolumeclaims
1011
- services
1112
verbs:
1213
- create

0 commit comments

Comments
 (0)