Skip to content

Commit a8bbc4f

Browse files
committed
OSDOCS-393: Include the Manila PV.
1 parent 2bcf553 commit a8bbc4f

File tree

4 files changed

+214
-0
lines changed

4 files changed

+214
-0
lines changed

_topic_map.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,8 @@ Topics:
345345
File: persistent-storage-iscsi
346346
- Name: Persistent storage using Container Storage Interface (CSI)
347347
File: persistent-storage-csi
348+
- Name: Persistent storage using OpenStack Manila
349+
File: persistent-storage-manila
348350
- Name: Dynamic provisioning
349351
File: dynamic-provisioning
350352
---
Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
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+
----
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * storage/persistent-storage/persistent-storage-manila.adoc
4+
5+
[id="persistent-storage-manila-usage-{context}"]
6+
= Provisioning an OpenStack Manila persistent volume
7+
8+
OpenStack Manila shares are dynamically provisioned as needed. When the
9+
PersistentVolumeClaim is deleted the provisioner will automatically
10+
delete and unexport the OpenStack Manila share.
11+
12+
.Prerequisites
13+
14+
* The OpenStack Manila external provisioner must be installed.
15+
16+
.Procedure
17+
18+
* Create a PersistentVolumeClaim using the corresponding
19+
StorageClass.
20+
+
21+
[source,yaml]
22+
----
23+
kind: PersistentVolumeClaim
24+
apiVersion: v1
25+
metadata:
26+
name: manila-nfs-pvc
27+
spec:
28+
accessModes:
29+
- ReadWriteOnce
30+
resources:
31+
requests:
32+
storage: 2G
33+
storageClassName: manila-share
34+
----
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[id="persistent-storage-using-manila"]
2+
= Persistent storage using OpenStack Manila
3+
include::modules/common-attributes.adoc[]
4+
:context: persistent-storage-manila
5+
6+
toc::[]
7+
8+
{product-title} is capable of provisioning PVs using the
9+
link:https://wiki.openstack.org/wiki/Manila[OpenStack Manila] shared
10+
file system service.
11+
12+
It is assumed the OpenStack Manila service has been correctly set up and is
13+
accessible from the {product-title} cluster. Only the NFS share type can be
14+
provisioned.
15+
16+
:FeatureName: OpenStack Manila persistent storage
17+
include::modules/technology-preview.adoc[leveloffset=+0]
18+
19+
.Additional resources
20+
21+
* link:https://kubernetes.io/docs/concepts/storage/persistent-volumes/[Persistent volumes (PV)]
22+
* link:https://kubernetes.io/docs/concepts/storage/persistent-volumes/#persistentvolumeclaims[Persistent volume claims (PVCs)]
23+
* link:https://kubernetes.io/docs/concepts/storage/dynamic-provisioning/[Dynamic provisioning]
24+
* link:https://kubernetes.io/docs/admin/authorization/rbac/[RBAC authorization]
25+
26+
include::modules/persistent-storage-manila-install.adoc[leveloffset=+1]
27+
28+
include::modules/persistent-storage-manila-usage.adoc[leveloffset=+1]

0 commit comments

Comments
 (0)