mirror of
https://github.com/oracle/zfssa-csi-driver.git
synced 2025-09-07 15:50:31 +00:00
Initial publication of ZFSSA CSI driver
This commit is contained in:
4
examples/nfs-multi/Chart.yaml
Normal file
4
examples/nfs-multi/Chart.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
name: zfssa-nfs-multi-example
|
||||
version: 0.0.1
|
||||
description: Deploys an end to end NFS volume example for Oracle ZFS Storage Appliance CSI driver.
|
46
examples/nfs-multi/README.md
Normal file
46
examples/nfs-multi/README.md
Normal file
@@ -0,0 +1,46 @@
|
||||
# Introduction
|
||||
|
||||
This is an end-to-end example of using NFS filesystems on a target
|
||||
Oracle ZFS Storage Appliance. It creates several PVCs and optionally
|
||||
creates a pod to consume them.
|
||||
|
||||
This example also illustrates the use of namespaces with PVCs and pods.
|
||||
Be aware that PVCs and pods will be created in the user defined namespace
|
||||
not in the default namespace as in other examples.
|
||||
|
||||
Prior to running this example, the NFS environment must be set up properly
|
||||
on both the Kubernetes worker nodes and the Oracle ZFS Storage Appliance.
|
||||
Refer to the [INSTALLATION](../../INSTALLATION.md) instructions for details.
|
||||
|
||||
## Configuration
|
||||
|
||||
Set up a local values files. It must contain the values that customize to the
|
||||
target appliance, but can container others. The minimum set of values to
|
||||
customize are:
|
||||
|
||||
* appliance:
|
||||
* targetGroup: the target group that contains data path interfaces on the target appliance
|
||||
* pool: the pool to create shares in
|
||||
* project: the project to create shares in
|
||||
* targetPortal: the target iSCSI portal on the appliance
|
||||
* nfsServer: the NFS data path IP address
|
||||
* volSize: the size of the filesystem share to create
|
||||
|
||||
## Deployment
|
||||
|
||||
Assuming there is a set of values in the local-values directory, deploy using Helm 3:
|
||||
|
||||
```
|
||||
helm install -f ../local-values/local-values.yaml zfssa-nfs-multi ./
|
||||
```
|
||||
|
||||
## Check pod mounts
|
||||
|
||||
If you enabled the use of the test pod, exec into it and check the NFS volumes:
|
||||
|
||||
```
|
||||
kubectl exec -n zfssa-nfs-multi -it zfssa-nfs-multi-example-pod -- /bin/sh
|
||||
/ # cd /mnt
|
||||
/mnt # ls
|
||||
ssec0 ssec1 ssec2 ssg ssp-many
|
||||
```
|
20
examples/nfs-multi/templates/00-storage-class.yaml
Normal file
20
examples/nfs-multi/templates/00-storage-class.yaml
Normal file
@@ -0,0 +1,20 @@
|
||||
apiVersion: storage.k8s.io/v1
|
||||
kind: StorageClass
|
||||
metadata:
|
||||
name: {{ .Values.scNfsMultiName }}
|
||||
provisioner: zfssa-csi-driver
|
||||
reclaimPolicy: Delete
|
||||
volumeBindingMode: Immediate
|
||||
parameters:
|
||||
volumeType: {{ .Values.appliance.volumeType }}
|
||||
targetGroup: {{ .Values.appliance.targetGroup }}
|
||||
blockSize: "8192"
|
||||
pool: {{ .Values.appliance.pool }}
|
||||
project: {{ .Values.appliance.project }}
|
||||
targetPortal: {{ .Values.appliance.targetPortal }}
|
||||
nfsServer: {{ .Values.appliance.nfsServer }}
|
||||
rootUser: {{ .Values.appliance.rootUser }}
|
||||
rootGroup: {{ .Values.appliance.rootGroup }}
|
||||
rootPermissions: "777"
|
||||
shareNFS: {{ .Values.appliance.shareNFS }}
|
||||
restrictChown: "false"
|
74
examples/nfs-multi/templates/01-pvc.yaml
Normal file
74
examples/nfs-multi/templates/01-pvc.yaml
Normal file
@@ -0,0 +1,74 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: {{ .Values.namespace }}
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: {{ .Values.pvc0 }}
|
||||
namespace: {{ .Values.namespace }}
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.volSize }}
|
||||
storageClassName: {{ .Values.scNfsMultiName }}
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: {{ .Values.pvc1 }}
|
||||
namespace: {{ .Values.namespace }}
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.volSize }}
|
||||
storageClassName: {{ .Values.scNfsMultiName }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: {{ .Values.pvc2 }}
|
||||
namespace: {{ .Values.namespace }}
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.volSize }}
|
||||
storageClassName: {{ .Values.scNfsMultiName }}
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: {{ .Values.pvc3 }}
|
||||
namespace: {{ .Values.namespace }}
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.volSize }}
|
||||
storageClassName: {{ .Values.scNfsMultiName }}
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: {{ .Values.pvc4 }}
|
||||
namespace: {{ .Values.namespace }}
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.volSize }}
|
||||
storageClassName: {{ .Values.scNfsMultiName }}
|
49
examples/nfs-multi/templates/02-pod.yaml
Normal file
49
examples/nfs-multi/templates/02-pod.yaml
Normal file
@@ -0,0 +1,49 @@
|
||||
{{- if .Values.deployPod -}}
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: {{ .Values.podNfsMultiName }}
|
||||
namespace: {{ .Values.namespace }}
|
||||
labels:
|
||||
name: ol7slim-test
|
||||
|
||||
spec:
|
||||
restartPolicy: Always
|
||||
containers:
|
||||
- image: container-registry.oracle.com/os/oraclelinux:7-slim
|
||||
command: ["/bin/sh", "-c"]
|
||||
args: [ "tail -f /dev/null" ]
|
||||
name: ol7slim
|
||||
volumeMounts:
|
||||
- name: vol0
|
||||
mountPath: /mnt/{{ .Values.pvc0 }}
|
||||
- name: vol1
|
||||
mountPath: /mnt/{{ .Values.pvc1 }}
|
||||
- name: vol2
|
||||
mountPath: /mnt/{{ .Values.pvc2 }}
|
||||
- name: vol3
|
||||
mountPath: /mnt/{{ .Values.pvc3 }}
|
||||
- name: vol4
|
||||
mountPath: /mnt/{{ .Values.pvc4 }}
|
||||
volumes:
|
||||
- name: vol0
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ .Values.pvc0 }}
|
||||
readOnly: false
|
||||
- name: vol1
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ .Values.pvc1 }}
|
||||
readOnly: false
|
||||
- name: vol2
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ .Values.pvc2 }}
|
||||
readOnly: false
|
||||
- name: vol3
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ .Values.pvc3 }}
|
||||
readOnly: false
|
||||
- name: vol4
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ .Values.pvc4 }}
|
||||
readOnly: false
|
||||
{{- end }}
|
27
examples/nfs-multi/values.yaml
Normal file
27
examples/nfs-multi/values.yaml
Normal file
@@ -0,0 +1,27 @@
|
||||
# Various names used through example
|
||||
scNfsMultiName: zfssa-nfs-multi-example-sc
|
||||
pvc0: ssec0
|
||||
pvc1: ssec1
|
||||
pvc2: ssec2
|
||||
pvc3: ssg
|
||||
pvc4: ssp-many
|
||||
podNfsMultiName: zfssa-nfs-multi-example-pod
|
||||
namespace: zfssa-nfs-multi
|
||||
|
||||
# Settings for target appliance
|
||||
appliance:
|
||||
volumeType: thin
|
||||
targetGroup: OVERRIDE
|
||||
pool: OVERRIDE
|
||||
project: OVERRIDE
|
||||
targetPortal: OVERRIDE
|
||||
nfsServer: OVERRIDE
|
||||
rootUser: root
|
||||
rootGroup: other
|
||||
shareNFS: "on"
|
||||
|
||||
# Settings for volume
|
||||
volSize: OVERRIDE
|
||||
|
||||
# Deploy a pod to consume the volumes
|
||||
deployPod: true
|
Reference in New Issue
Block a user