Skip to content

Instantly share code, notes, and snippets.

@rcarrata
Last active February 7, 2022 07:51
Show Gist options
  • Save rcarrata/cc06b058c52ff389e31817fa57dcb4dd to your computer and use it in GitHub Desktop.
Save rcarrata/cc06b058c52ff389e31817fa57dcb4dd to your computer and use it in GitHub Desktop.
Openshift Container Storage 4 Examples
#
# Namespace used for sandboxing
#
---
apiVersion: v1
kind: Namespace
metadata:
creationTimestamp: null
name: demo-ocs-workloads
#
# ConfigMap to store DD parameters used for all tests
#
---
apiVersion: v1
kind: ConfigMap
metadata:
name: demo-dd-config
namespace: demo-ocs-workloads
data:
# Maximum file size (dd_block_size x dd_block_count) is 300G (PVC size)
dd_block_size: "64k"
dd_block_count: "81920"
#
# Resources to test Ceph RBD (RWO) volume
#
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: demo-pvc-ceph-rbd
namespace: demo-ocs-workloads
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 300Gi
storageClassName: ocs-storagecluster-ceph-rbd
---
apiVersion: batch/v1
kind: Job
metadata:
name: demo-job-ceph-rbd
namespace: demo-ocs-workloads
labels:
app: demo-job-ceph-rbd
spec:
template:
metadata:
labels:
app: demo-job-ceph-rbd
spec:
restartPolicy: OnFailure
containers:
- name: ubi-writer
image: registry.access.redhat.com/ubi8/ubi
env:
- name: DD_BLOCK_SIZE
valueFrom:
configMapKeyRef:
name: demo-dd-config
key: dd_block_size
- name: DD_BLOCK_COUNT
valueFrom:
configMapKeyRef:
name: demo-dd-config
key: dd_block_count
command:
- '/usr/bin/bash'
args:
- '-c'
- 'dd if=/dev/zero of=/data/file bs=$(DD_BLOCK_SIZE) count=$(DD_BLOCK_COUNT) conv=fdatasync status=progress'
volumeMounts:
- name: demo-pvc
mountPath: /data
volumes:
- name: demo-pvc
persistentVolumeClaim:
claimName: demo-pvc-ceph-rbd
readOnly: false
#
# Resources to test CephFS (RWX) volume
#
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: demo-pvc-cephfs
namespace: demo-ocs-workloads
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 300Gi
storageClassName: ocs-storagecluster-cephfs
---
apiVersion: batch/v1
kind: Job
metadata:
name: demo-job-cephfs
namespace: demo-ocs-workloads
labels:
app: demo-job-cephfs
spec:
template:
metadata:
labels:
app: demo-job-cephfs
spec:
restartPolicy: OnFailure
containers:
- name: dd-writer
image: registry.access.redhat.com/ubi8/ubi
env:
- name: DD_BLOCK_SIZE
valueFrom:
configMapKeyRef:
name: demo-dd-config
key: dd_block_size
- name: DD_BLOCK_COUNT
valueFrom:
configMapKeyRef:
name: demo-dd-config
key: dd_block_count
command:
- '/usr/bin/bash'
args:
- '-c'
- 'dd if=/dev/zero of=/data/file bs=$(DD_BLOCK_SIZE) count=$(DD_BLOCK_COUNT) conv=fdatasync status=progress'
volumeMounts:
- name: demo-pvc
mountPath: /data
volumes:
- name: demo-pvc
persistentVolumeClaim:
claimName: demo-pvc-cephfs
readOnly: false
#
# Resources to test the MCG (Noobaa)
#
---
apiVersion: objectbucket.io/v1alpha1
kind: ObjectBucketClaim
metadata:
name: demo-obc-noobaa
namespace: demo-ocs-workloads
spec:
generateBucketName: "demo-obc-noobaa"
storageClassName: openshift-storage.noobaa.io
---
apiVersion: batch/v1
kind: Job
metadata:
name: demo-job-noobaa
namespace: demo-ocs-workloads
labels:
app: demo-job-noobaa
spec:
template:
metadata:
labels:
app: demo-job-noobaa
spec:
restartPolicy: OnFailure
containers:
- image: mesosphere/aws-cli:latest
command: ["sh"]
args:
- '-c'
- 'set -x && s3cmd --no-check-certificate --host $BUCKET_HOST:$BUCKET_PORT --host-bucket $BUCKET_HOST:$BUCKET_PORT du'
name: demo-job-noobaa
env:
- name: BUCKET_NAME
valueFrom:
configMapKeyRef:
name: demo-obc-noobaa
key: BUCKET_NAME
- name: BUCKET_HOST
valueFrom:
configMapKeyRef:
name: demo-obc-noobaa
key: BUCKET_HOST
- name: BUCKET_PORT
valueFrom:
configMapKeyRef:
name: demo-obc-noobaa
key: BUCKET_PORT
- name: AWS_DEFAULT_REGION
valueFrom:
configMapKeyRef:
name: demo-obc-noobaa
key: BUCKET_REGION
- name: AWS_ACCESS_KEY_ID
valueFrom:
secretKeyRef:
name: demo-obc-noobaa
key: AWS_ACCESS_KEY_ID
- name: AWS_SECRET_ACCESS_KEY
valueFrom:
secretKeyRef:
name: demo-obc-noobaa
key: AWS_SECRET_ACCESS_KEY
#
# Resources to test vSphere (Thin) volume
#
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: demo-pvc-vsphere
namespace: demo-ocs-workloads
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 300Gi
storageClassName: thin
---
apiVersion: batch/v1
kind: Job
metadata:
name: demo-job-vsphere
namespace: demo-ocs-workloads
labels:
app: demo-job-vsphere
spec:
template:
metadata:
labels:
app: demo-job-vsphere
spec:
restartPolicy: OnFailure
containers:
- name: dd-writer
image: registry.access.redhat.com/ubi8/ubi
env:
- name: DD_BLOCK_SIZE
valueFrom:
configMapKeyRef:
name: demo-dd-config
key: dd_block_size
- name: DD_BLOCK_COUNT
valueFrom:
configMapKeyRef:
name: demo-dd-config
key: dd_block_count
command:
- '/usr/bin/bash'
args:
- '-c'
- 'dd if=/dev/zero of=/data/file bs=$(DD_BLOCK_SIZE) count=$(DD_BLOCK_COUNT) conv=fdatasync status=progress'
volumeMounts:
- name: demo-pvc
mountPath: /data
volumes:
- name: demo-pvc
persistentVolumeClaim:
claimName: demo-pvc-vsphere
readOnly: false
#
# Resources to test AWS EBS (GP2) volume
#
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: demo-pvc-aws
namespace: demo-ocs-workloads
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 300Gi
storageClassName: gp2
---
apiVersion: batch/v1
kind: Job
metadata:
name: demo-job-aws
namespace: demo-ocs-workloads
labels:
app: demo-job-aws
spec:
template:
metadata:
labels:
app: demo-job-aws
spec:
restartPolicy: OnFailure
containers:
- name: dd-writer
image: registry.access.redhat.com/ubi8/ubi
env:
- name: DD_BLOCK_SIZE
valueFrom:
configMapKeyRef:
name: demo-dd-config
key: dd_block_size
- name: DD_BLOCK_COUNT
valueFrom:
configMapKeyRef:
name: demo-dd-config
key: dd_block_count
command:
- '/usr/bin/bash'
args:
- '-c'
- 'dd if=/dev/zero of=/data/file bs=$(DD_BLOCK_SIZE) count=$(DD_BLOCK_COUNT) conv=fdatasync status=progress'
volumeMounts:
- name: demo-pvc
mountPath: /data
volumes:
- name: demo-pvc
persistentVolumeClaim:
claimName: demo-pvc-aws
readOnly: false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment