Role to NFS external storage provisioner. A storage class named managed-nfs-storage is created and set as default if no other default Storage Class is defined.
Name | Required | Default | Description |
---|---|---|---|
nes_nfs_server | Yes | undefined | NFS server's FQDN or IP Address |
nes_nfs_path | Yes | undefined | NFS export path |
nes_path_pattern | No | undefined | Specifies a template for creating a directory path via PVC metadata's such as labels, annotations, name or namespace |
nes_namespace | No | openshift-nfs-storage | Deployment namespace |
nes_provisioner_image | No | registry.k8s.io/sig-storage/nfs-subdir-external-provisioner:v4.0.2 | Provisioner image |
- A NFS server reachable from the OCP cluster. For details about the proper setup using RHEL see Installing NFS.
- An exported filesystem with the permission according to the pods needs.
- name: "deploy-operators : Install OCS Operator"
ansible.builtin.include_role:
name: redhatci.ocp.nfs_external_storage
vars:
nes_nfs_server: "192.168.16.11"
nes_nfs_path: "/exports/nfs-provisioner"
nes_path_pattern: "pvc123_${.PVC.name}"
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: test-claim
annotations:
volume.beta.kubernetes.io/storage-class: "managed-nfs-storage"
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1Mi
kind: Pod
apiVersion: v1
metadata:
name: test-pod
spec:
containers:
- name: test-pod
image: gcr.io/google_containers/busybox:1.36
command:
- "/bin/sh"
args:
- "-c"
- "touch /mnt/SUCCESS && exit 0 || exit 1"
volumeMounts:
- name: nfs-pvc
mountPath: "/mnt"
restartPolicy: "Never"
volumes:
- name: nfs-pvc
persistentVolumeClaim:
claimName: test-claim
- External Storage.
- Create a storage class for NFS dynamic storage provisioning in an OpenShift environment.
Apache License, Version 2.0