forked from apecloud/kubeblocks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrestore-cmpd.yaml
64 lines (64 loc) · 3.06 KB
/
restore-cmpd.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
apiVersion: apps.kubeblocks.io/v1alpha1
kind: Cluster
metadata:
name: redis-cluster-restore
namespace: default
annotations:
kubeblocks.io/restore-from-backup: '{"redis":{"connectionPassword":"<backup-connection-password>","name":"redis-cluster-backup","namespace":"default","volumeRestorePolicy":"Parallel"}}'
spec:
# Specifies the behavior when a Cluster is deleted.
# - `DoNotTerminate`: Prevents deletion of the Cluster. This policy ensures that all resources remain intact.
# - `Halt`: Deletes Cluster resources like Pods and Services but retains Persistent Volume Claims (PVCs), allowing for data preservation while stopping other operations.
# - `Delete`: Extends the `Halt` policy by also removing PVCs, leading to a thorough cleanup while removing all persistent data.
# - `WipeOut`: An aggressive policy that deletes all Cluster resources, including volume snapshots and backups in external storage. This results in complete data removal and should be used cautiously, primarily in non-production environments to avoid irreversible data loss.
terminationPolicy: Delete
# Specifies a list of ClusterComponentSpec objects used to define the individual components that make up a Cluster.
componentSpecs:
# Specifies the name of the Component. This name is also part of the Service DNS name and must comply with the IANA service naming rule.
- name: redis
# References the name of a ComponentDefinition. The ComponentDefinition specifies the behavior and characteristics of the Component. If both `componentDefRef` and `componentDef` are provided, the `componentDef` will take precedence over `componentDefRef`.
componentDef: redis-7
# Determines whether the metrics exporter needs to be published to the service endpoint.
disableExporter: true
# Specifies which types of logs should be collected for the Cluster.
enabledLogs:
- running
# Specifies the name of the ServiceAccount required by the running Component.
serviceAccountName: kb-redis-cluster
# Each component supports running multiple replicas to provide high availability and persistence. This field can be used to specify the desired number of replicas.
replicas: 3
# Specifies the resources required by the Component. It allows defining the CPU, memory requirements and limits for the Component's containers.
resources:
limits:
cpu: '1'
memory: 1Gi
requests:
cpu: '1'
memory: 1Gi
# Specifies a list of PersistentVolumeClaim templates that define the storage requirements for the Component.
volumeClaimTemplates:
- name: data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 30Gi
- componentDef: redis-sentinel-7
name: redis-sentinel
replicas: 3
resources:
limits:
cpu: '0.5'
memory: 0.5Gi
requests:
cpu: '0.5'
memory: 0.5Gi
volumeClaimTemplates:
- name: data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 20Gi