This is the multi-page printable view of this section. Click here to print.
RecoveryPlan
- 1: Generic Applications
- 2: Namespaces
- 3: Secrets
- 4: Services
1 - Generic Applications
The following RecoveryPlan synchronize many Kubernetes resources between the source and destination clusters:
- Deployments
- ConfigMaps
- Secrets
- Services
- CronJobs
Filters
Only the resources with labeldisaster-recovery=enabled will be synchronized.apiVersion: dr.astronetes.io/v1alpha1
kind: RecoveryPlan
metadata:
name: applications
spec:
suspend: false
forceNamespaceCreation: true
sourceClusterRef:
name: source
namespace: dr-maqueta
destinationClusterRef:
name: destination
namespace: dr-maqueta
resources:
- group: apps
version: v1
resource: deployments
transformation:
patch:
- op: replace
path: /spec/replicas
value: 0
filters:
selector:
matchLabels:
disaster-recovery: enabled
recoveryProcess:
fromPatch:
- op: replace
path: /spec/replicas
value: 1
- version: v1
resource: services
filters:
selector:
matchLabels:
disaster-recovery: enabled
- version: v1
resource: secrets
filters:
selector:
matchLabels:
disaster-recovery: enabled
- version: v1
resource: configmaps
filters:
selector:
matchLabels:
disaster-recovery: enabled
- group: batch
version: v1
resource: cronjobs
filters:
selector:
matchLabels:
disaster-recovery: enabled
2 - Namespaces
This RecoveryPlan synchronize namespaces between the source and destination clusters.
Filters
Only the resources with labelsdisaster-recovery=enabled will be synchronized. Note that system namespaces that start with either kube- or openshift- will not be replicated even when the labels match.apiVersion: dr.astronetes.io/v1alpha1
kind: RecoveryPlan
metadata:
name: ns
spec:
suspend: false
sourceClusterRef:
name: source
namespace: dr-maqueta
destinationClusterRef:
name: destination
namespace: dr-maqueta
resources:
- version: v1
resource: namespaces
filters:
selector:
matchLabels:
disaster-recovery: enabled
3 - Secrets
This RecoveryPlan synchronize the secrets between the source and destination clusters.
Filters
Only the resources with labelsdisaster-recovery=enabled will be synchronized.apiVersion: dr.astronetes.io/v1alpha1
kind: RecoveryPlan
metadata:
name: apps-pre
spec:
suspend: false
forceNamespaceCreation: true
sourceClusterRef:
name: source
namespace: dr-maqueta
destinationClusterRef:
name: destination
namespace: dr-maqueta
resources:
- version: v1
resource: secrets
filters:
selector:
matchLabels:
disaster-recovery: enabled
4 - Services
This RecoveryPlan synchronize the Services between the source and destination clusters.
Filters
Only the resources with labelsdisaster-recovery=enabled will be synchronized.apiVersion: dr.astronetes.io/v1alpha1
kind: RecoveryPlan
metadata:
name: apps-pre
spec:
suspend: false
forceNamespaceCreation: true
sourceClusterRef:
name: source
namespace: dr-maqueta
destinationClusterRef:
name: destination
namespace: dr-maqueta
resources:
- version: v1
resource: services
filters:
selector:
matchLabels:
disaster-recovery: enabled
transformation:
patch:
- op: remove
path: /spec/clusterIP
- op: remove
path: /spec/clusterIPs