|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * storage/persistent-storage/persistent-storage-manila.adoc |
| 4 | + |
| 5 | +[id="persistent-storage-manila-install-{context}"] |
| 6 | += Installing the external provisioner |
| 7 | + |
| 8 | +To use OpenStack Manila persistent storage you must install |
| 9 | +and configure an external provisioner in the {product-title} |
| 10 | +cluster. |
| 11 | + |
| 12 | +The external provisioner is distributed as a container image |
| 13 | +and can be run in the {product-title} cluster as usual. |
| 14 | + |
| 15 | +.Procedure |
| 16 | + |
| 17 | +. Create a service account: |
| 18 | ++ |
| 19 | +[source,yaml] |
| 20 | +---- |
| 21 | +apiVersion: v1 |
| 22 | +kind: ServiceAccount |
| 23 | +metadata: |
| 24 | + name: manila-provisioner-runner |
| 25 | +---- |
| 26 | + |
| 27 | +. Create a ClusterRole: |
| 28 | ++ |
| 29 | +[source,yaml] |
| 30 | +---- |
| 31 | +kind: ClusterRole |
| 32 | +apiVersion: rbac.authorization.k8s.io/v1 |
| 33 | +metadata: |
| 34 | + name: manila-provisioner-role |
| 35 | +rules: |
| 36 | + - apiGroups: [""] |
| 37 | + resources: ["persistentvolumes", "endpoints"] |
| 38 | + verbs: ["get", "list", "watch", "create", "delete", "update"] |
| 39 | + - apiGroups: [""] |
| 40 | + resources: ["persistentvolumeclaims"] |
| 41 | + verbs: ["get", "list", "watch", "update"] |
| 42 | + - apiGroups: ["storage.k8s.io"] |
| 43 | + resources: ["storageclasses"] |
| 44 | + verbs: ["get", "list", "watch"] |
| 45 | + - apiGroups: [""] |
| 46 | + resources: ["events"] |
| 47 | + verbs: ["list", "watch", "create", "update", "patch"] |
| 48 | + - apiGroups: ["v1"] |
| 49 | + resources: ["secrets"] |
| 50 | + verbs: ["get", "list"] |
| 51 | +---- |
| 52 | + |
| 53 | +. Bind the rules via ClusterRoleBinding: |
| 54 | ++ |
| 55 | +[source,yaml] |
| 56 | +---- |
| 57 | +apiVersion: rbac.authorization.k8s.io/v1 |
| 58 | +kind: ClusterRoleBinding |
| 59 | +metadata: |
| 60 | + name: manila-provisioner |
| 61 | +roleRef: |
| 62 | + apiGroup: rbac.authorization.k8s.io |
| 63 | + kind: ClusterRole |
| 64 | + name: manila-provisioner-role |
| 65 | +subjects: |
| 66 | +- kind: ServiceAccount |
| 67 | + name: manila-provisioner-runner |
| 68 | + namespace: default |
| 69 | +---- |
| 70 | + |
| 71 | +. Create a new secret: |
| 72 | ++ |
| 73 | +[source,yaml] |
| 74 | +---- |
| 75 | +apiVersion: v1 |
| 76 | +kind: Secret |
| 77 | +metadata: |
| 78 | + name: manila-secret <1> |
| 79 | + namespace: default <2> |
| 80 | +data: |
| 81 | + os-authURL: <base64 encoded OpenStack Keystone URL> |
| 82 | + os-userName: <base64 encoded Manila username> |
| 83 | + os-password: <base64 encoded password> |
| 84 | + os-projectName: <base64 encoded OpenStack project (tenant) name> |
| 85 | + os-domainName: <base64 encoded OpenStack Manila service domain> |
| 86 | + os-region: <base64 encoded OpenStack region> |
| 87 | +---- |
| 88 | +<1> The secret name will be referenced by the Manila volume's |
| 89 | +StorageClass. |
| 90 | +<2> The secret namespace will be referenced by the Manila |
| 91 | +volume's StorageClass. |
| 92 | + |
| 93 | +. Create a new StorageClass: |
| 94 | ++ |
| 95 | +[source,yaml] |
| 96 | +---- |
| 97 | +apiVersion: storage.k8s.io/v1 |
| 98 | +kind: StorageClass |
| 99 | +metadata: |
| 100 | + name: "manila-share" |
| 101 | +provisioner: "externalstorage.k8s.io/manila" |
| 102 | +parameters: |
| 103 | + type: "default" <1> |
| 104 | + zones: "nova" <2> |
| 105 | + protocol: "NFS" <3> |
| 106 | + backend: "nfs" <4> |
| 107 | + osSecretName: "manila-secret" <5> |
| 108 | + osSecretNamespace: "default" <6> |
| 109 | + nfs-share-client: "0.0.0.0" <7> |
| 110 | +---- |
| 111 | +<1> The link:https://docs.openstack.org/manila/latest/admin/shared-file-systems-share-types.html[Manila share type] |
| 112 | +the provisioner will create for the volume. This field is optional, |
| 113 | +and defaults to `default`. |
| 114 | +<2> Set of Manila availability zones that the volume might be created |
| 115 | +in. This field is optional, and defaults to `nova`. |
| 116 | +<3> Protocol used when provisioning a share. Valid options are |
| 117 | +`NFS` and `CEPHFS`. This field is required. |
| 118 | +<4> Backend share used for granting access and creating the |
| 119 | +`PersistentVolumeSource`. Valid options are `nfs` and `cephfs`. |
| 120 | +This field is required. |
| 121 | +<5> Name of the secret object containing OpenStack credentials. |
| 122 | +This field is required. |
| 123 | +<6> Namespace of the OpenStack credentials secret object. This field |
| 124 | +is optional, and defaults to `default`. |
| 125 | +<7> Default NFS client for the share exported. This field is optional, |
| 126 | +and is only used for the `NFS` protocol. Defaults to `0.0.0.0`. |
| 127 | + |
| 128 | +. Start the provisioner itself. The following example uses a Deployment: |
| 129 | ++ |
| 130 | +[source, yaml] |
| 131 | +---- |
| 132 | +kind: Deployment |
| 133 | +apiVersion: apps/v1 |
| 134 | +metadata: |
| 135 | + name: manila-provisioner |
| 136 | +spec: |
| 137 | + replicas: 1 |
| 138 | + strategy: |
| 139 | + type: Recreate |
| 140 | + template: |
| 141 | + metadata: |
| 142 | + labels: |
| 143 | + app: manila-provisioner |
| 144 | + spec: |
| 145 | + serviceAccountName: manila-provisioner-runner |
| 146 | + containers: |
| 147 | + - image: "registry.redhat.io/openshift/manila-provisioner:latest" |
| 148 | + imagePullPolicy: "IfNotPresent" |
| 149 | + name: manila-provisioner |
| 150 | +---- |
0 commit comments