forked from RamenDR/ramen
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests application based on ocm-ramen-samples for using in drenv tests. We 2 variants: - `rbd`: for testing replication using RBD mirroring - `hostpath`: for testing replication using minikube `csi-hostpath-sc` via volsync. The application are identical except the pvc storage class and namespace. We can add another variant for CephFS once we add it to to test environment. Signed-off-by: Nir Soffer <nsoffer@redhat.com>
- Loading branch information
Showing
16 changed files
with
222 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Ramen test applications | ||
|
||
This directory contains test applications for testing disaster recovery | ||
flows using the drenv environment. | ||
|
||
The applications are kustomized for minikube based clusters. To test on | ||
OpenShift clusters, use the | ||
[RamenDR ocm-ramen-samples repository](https://github.com/RamenDR/ocm-ramen-samples). | ||
|
||
## Channel | ||
|
||
Channel pointing to ramen github repo. Must be installed to use these | ||
applications. | ||
|
||
## Bases | ||
|
||
- `busybox`: Base busybox application. To create an actual application | ||
create an overlay and kustomize namespace and the pvc storageClassName. | ||
|
||
- `subscription`: Base busybox subscription. To create an actual | ||
subscription crate an overlay and kustomize the namespace git | ||
github-path annotation. | ||
|
||
## Overlays | ||
|
||
- `rbd`: busybox and subscription overlays for testing replication with | ||
RBD mirroring. | ||
|
||
- `hostpath`: busybox and subscription overlays for testing replication | ||
using `csi-hostpath-sc` storage class via `volsync`. | ||
|
||
## Deployment | ||
|
||
1. Install the channel | ||
|
||
``` | ||
kubectl apply -k channel | ||
``` | ||
|
||
2. Install the subscription | ||
|
||
To install the `rbd` subscription and application: | ||
|
||
``` | ||
kubectl apply -k rbd/subscription | ||
``` | ||
|
||
This installs the busybox-sub subscription in in the `busybox-rbd` | ||
namespace on the 'hub' cluster, and the `busybox` application in the | ||
`busybox-rbd` namespace in cluster `dr1`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
appname: busybox | ||
name: busybox | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
appname: busybox | ||
template: | ||
metadata: | ||
labels: | ||
appname: busybox | ||
spec: | ||
containers: | ||
- image: docker.io/library/busybox:stable | ||
imagePullPolicy: IfNotPresent | ||
name: busybox | ||
command: ['sh', '-c', 'trap exit TERM; while true; do echo $(date) | tee -a /mnt/test/outfile; sync; sleep 10 & wait; done'] | ||
volumeMounts: | ||
- name: mypvc | ||
mountPath: /mnt/test | ||
volumes: | ||
- name: mypvc | ||
persistentVolumeClaim: | ||
claimName: busybox-pvc | ||
securityContext: | ||
runAsUser: 10000 | ||
runAsGroup: 10000 | ||
fsGroup: 10000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
resources: | ||
- pvc.yaml | ||
- deploy.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: busybox-pvc | ||
labels: | ||
appname: busybox | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
storageClassName: storage-class-name | ||
resources: | ||
requests: | ||
storage: 5Gi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
apiVersion: apps.open-cluster-management.io/v1 | ||
kind: Channel | ||
metadata: | ||
name: ramen-gitops | ||
namespace: ramen-samples | ||
spec: | ||
type: GitHub | ||
pathname: https://github.com/RamenDR/ramen.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
resources: | ||
- channel.yaml | ||
- namespace.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: ramen-samples |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
resources: | ||
- ../../busybox | ||
namespace: busybox-hostpath | ||
patches: | ||
- target: | ||
kind: PersistentVolumeClaim | ||
name: busybox-pvc | ||
patch: |- | ||
- op: replace | ||
path: /spec/storageClassName | ||
value: csi-hostpath-sc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
resources: | ||
- ../../subscription | ||
namespace: busybox-hostpath | ||
patches: | ||
- target: | ||
kind: Subscription | ||
name: busybox-sub | ||
patch: |- | ||
- op: replace | ||
path: /metadata/annotations/apps.open-cluster-management.io~1github-path | ||
value: test/apps/hostpath/busybox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
resources: | ||
- ../../busybox | ||
namespace: busybox-rbd | ||
patches: | ||
- target: | ||
kind: PersistentVolumeClaim | ||
name: busybox-pvc | ||
patch: |- | ||
- op: replace | ||
path: /spec/storageClassName | ||
value: rook-ceph-block |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
resources: | ||
- ../../subscription | ||
namespace: busybox-rbd | ||
patches: | ||
- target: | ||
kind: Subscription | ||
name: busybox-sub | ||
patch: |- | ||
- op: replace | ||
path: /metadata/annotations/apps.open-cluster-management.io~1github-path | ||
value: test/apps/rbd/busybox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
apiVersion: ramendr.openshift.io/v1alpha1 | ||
kind: DRPlacementControl | ||
metadata: | ||
name: busybox-drpc | ||
labels: | ||
app: busybox-sample | ||
spec: | ||
preferredCluster: dr1 | ||
drPolicyRef: | ||
name: dr-policy | ||
placementRef: | ||
kind: PlacementRule | ||
name: busybox-placement | ||
pvcSelector: | ||
matchLabels: | ||
appname: busybox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
resources: | ||
- namespace.yaml | ||
- placementrule.yaml | ||
- subscription.yaml | ||
- drpc.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: busybox-sample |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
apiVersion: apps.open-cluster-management.io/v1 | ||
kind: PlacementRule | ||
metadata: | ||
name: busybox-placement | ||
labels: | ||
app: busybox-sample | ||
spec: | ||
clusterConditions: | ||
- type: ManagedClusterConditionAvailable | ||
status: True | ||
clusterReplicas: 1 | ||
schedulerName: ramen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
apiVersion: apps.open-cluster-management.io/v1 | ||
kind: Subscription | ||
metadata: | ||
annotations: | ||
apps.open-cluster-management.io/github-branch: main | ||
apps.open-cluster-management.io/github-path: github-path | ||
labels: | ||
app: busybox-sample | ||
name: busybox-sub | ||
spec: | ||
channel: ramen-samples/ramen-gitops | ||
placement: | ||
placementRef: | ||
kind: PlacementRule | ||
name: busybox-placement |