-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Testing volsync without ramen is the best way to understand how it works and how we need to use it when using minikube (or vanilla k8s?). Work in progress: - Add busybox deployment (based on ramen samples), but using securityContext so the pod does not run as root. This is not needed on openshift since it inject security context to the namespace, but with minikube plain busybox runs as root. This requires privileged volsync which may be possible but very complex to configure with ocm. Using security context looks like the right way to run workloads on minikube and supported by volsync. - Add volsync replication destination - seems to work, but uses ClusterIP service, so not accessible from the source cluster. We need to add submariner to the volsync env to use volsync. - Add volsync replication source - not tested yet. Signed-off-by: Nir Soffer <nsoffer@redhat.com>
- Loading branch information
Showing
9 changed files
with
144 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,7 @@ | ||
# SPDX-FileCopyrightText: The RamenDR authors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
--- | ||
resources: | ||
- namespace.yaml | ||
- pvc.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,8 @@ | ||
# SPDX-FileCopyrightText: The RamenDR authors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
--- | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: 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 @@ | ||
# SPDX-FileCopyrightText: The RamenDR authors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
--- | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: busybox-pvc | ||
namespace: busybox | ||
labels: | ||
appname: busybox | ||
spec: | ||
accessModes: [ "ReadWriteOnce" ] | ||
storageClassName: "csi-hostpath-sc" | ||
resources: | ||
requests: | ||
storage: 1Gi |
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,20 @@ | ||
# SPDX-FileCopyrightText: The RamenDR authors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
--- | ||
apiVersion: volsync.backube/v1alpha1 | ||
kind: ReplicationDestination | ||
metadata: | ||
name: busybox-dst | ||
namespace: busybox | ||
spec: | ||
rsyncTLS: | ||
copyMethod: Snapshot | ||
capacity: 1Gi | ||
accessModes: ["ReadWriteOnce"] | ||
storageClassName: "csi-hostpath-sc" | ||
volumeSnapshotClassName: csi-hostpath-snapclass | ||
moverSecurityContext: | ||
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,37 @@ | ||
# SPDX-FileCopyrightText: The RamenDR authors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
appname: busybox | ||
name: busybox | ||
namespace: busybox | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
appname: busybox | ||
template: | ||
metadata: | ||
labels: | ||
appname: busybox | ||
spec: | ||
containers: | ||
- image: docker.io/library/busybox:latest | ||
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: volume | ||
mountPath: /mnt/test | ||
volumes: | ||
- name: volume | ||
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,8 @@ | ||
# SPDX-FileCopyrightText: The RamenDR authors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
--- | ||
resources: | ||
- namespace.yaml | ||
- 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,8 @@ | ||
# SPDX-FileCopyrightText: The RamenDR authors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
--- | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: 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 @@ | ||
# SPDX-FileCopyrightText: The RamenDR authors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
--- | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: busybox-pvc | ||
namespace: busybox | ||
labels: | ||
appname: busybox | ||
spec: | ||
accessModes: [ "ReadWriteOnce" ] | ||
storageClassName: "csi-hostpath-sc" | ||
resources: | ||
requests: | ||
storage: 1Gi |
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,22 @@ | ||
# SPDX-FileCopyrightText: The RamenDR authors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
--- | ||
apiVersion: volsync.backube/v1alpha1 | ||
kind: ReplicationSource | ||
metadata: | ||
name: busybox-src | ||
namespace: busybox | ||
spec: | ||
sourcePVC: busybox-pvc | ||
trigger: | ||
schedule: "*/1 * * * *" | ||
rsyncTLS: | ||
keySecret: busybox-dst-secret | ||
address: 192.168.122.150 | ||
copyMethod: Snapshot | ||
volumeSnapshotClassName: csi-hostpath-snapclass | ||
moverSecurityContext: | ||
runAsUser: 10000 | ||
runAsGroup: 10000 | ||
fsGroup: 10000 |