Skip to content

Commit bbe33f4

Browse files
authored
Merge pull request #395 from chaosaffe/fibre-channel-grammar
Enhance Fibre Channel Documentation
2 parents 527276d + bc7a20b commit bbe33f4

File tree

2 files changed

+60
-40
lines changed

2 files changed

+60
-40
lines changed

staging/volumes/fibre_channel/README.md

Lines changed: 56 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,91 @@
1-
## Step 1. Setting up Fibre Channel Target
1+
# Consuming Fibre Channel Storage on Kubernetes
22

3-
On your FC SAN Zone manager, allocate and mask LUNs so Kubernetes hosts can access them.
3+
## Table of Contents
44

5-
## Step 2. Creating the Pod with Fibre Channel persistent storage
5+
- [Example Parameters](#example-parameters)
6+
- [Step-by-Step](#step-by-step)
7+
- [Multipath Considerations](#multipath-considerations)
68

7-
Once you have installed Fibre Channel initiator and new Kubernetes, you can create a pod based on my example [fc.yaml](fc.yaml). In the pod JSON, you need to provide *targetWWNs* (array of Fibre Channel target's World Wide Names), *lun*, and the type of the filesystem that has been created on the lun, and *readOnly* boolean.
9+
## Example Parameters
810

9-
Once your pod is created, run it on the Kubernetes master:
10-
11-
```console
12-
kubectl create -f ./your_new_pod.json
11+
```yaml
12+
fc:
13+
targetWWNs:
14+
- '500a0982991b8dc5'
15+
- '500a0982891b8dc5'
16+
lun: 2
17+
fsType: ext4
18+
readOnly: true
1319
```
1420
15-
Here is my command and output:
21+
[API Reference](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#fcvolumesource-v1-core)
22+
23+
## Step-by-Step
24+
25+
### Set up a Fibre Channel Target
26+
27+
Using your Fibre Channel SAN Zone manager you must allocate and mask LUNs so that all hosts in the Kubernetes cluster can access them
28+
29+
### Prepare nodes in your Kubernetes cluster
30+
31+
You will need to install and configured a Fibre Channel initiator on the hosts within your Kubernetes cluster.
32+
33+
### Create a Pod using Fibre Channel persistent storage
34+
35+
Create a pod manifest based on [fc.yaml](fc.yaml). You will need to provide *targetWWNs* (array of Fibre Channel target's World Wide Names), *lun*, and the type of the filesystem that has been created on the LUN if it is not _ext4_
36+
37+
Once you have created a pod manifest you can deploy it by running:
1638
1739
```console
18-
# kubectl create -f examples/volumes/fibre_channel/fc.yaml
19-
# kubectl get pods
20-
NAME READY STATUS RESTARTS AGE
21-
fcpd 2/2 Running 0 10m
40+
kubectl apply -f ./your_new_pod.yaml
2241
```
2342

24-
On the Kubernetes host, I got these in mount output
43+
You can then confirm that the pod hase been sucessfully deployed by running `kubectl get pod fibre-channel-example-pod -o wide`
2544

2645
```console
27-
#mount |grep /var/lib/kubelet/plugins/kubernetes.io
28-
/dev/mapper/360a98000324669436c2b45666c567946 on /var/lib/kubelet/plugins/kubernetes.io/fc/500a0982991b8dc5-lun-2 type ext4 (ro,relatime,seclabel,stripe=16,data=ordered)
29-
/dev/mapper/360a98000324669436c2b45666c567944 on /var/lib/kubelet/plugins/kubernetes.io/fc/500a0982991b8dc5-lun-1 type ext4 (rw,relatime,seclabel,stripe=16,data=ordered)
46+
# kubectl get pod fibre-channel-example-pod -o wide
47+
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
48+
fibre-channel-example-pod 1/1 READY 0 1m8s 192.168.172.11 node0 <none> <none>
49+
3050
```
3151

32-
If you ssh to that machine, you can run `docker ps` to see the actual pod.
52+
If you connect to the console on the Kubernetes node that the pod has been assigned to you can see that the volume is mounted to the pod by running `mount | grep /var/lib/kubelet/plugins/kubernetes.io/fc/`
3353

3454
```console
35-
# docker ps
36-
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
37-
090ac457ddc2 kubernetes/pause "/pause" 12 minutes ago Up 12 minutes k8s_fcpd-rw.aae720ec_fcpd_default_4024318f-4121-11e5-a294-e839352ddd54_99eb5415
38-
5e2629cf3e7b kubernetes/pause "/pause" 12 minutes ago Up 12 minutes k8s_fcpd-ro.857720dc_fcpd_default_4024318f-4121-11e5-a294-e839352ddd54_c0175742
39-
2948683253f7 k8s.gcr.io/pause:0.8.0 "/pause" 12 minutes ago Up 12 minutes k8s_POD.7be6d81d_fcpd_default_4024318f-4121-11e5-a294-e839352ddd54_8d9dd7bf
40-
```
55+
# mount | grep /var/lib/kubelet/plugins/kubernetes.io/fc/
56+
/dev/mapper/360a98000324669436c2b45666c567946 on /var/lib/kubelet/plugins/kubernetes.io/fc/500a0982991b8dc5-lun-2 type ext4 (relatime,seclabel,stripe=16,data=ordered)
57+
```
4158

42-
## Multipath
59+
## Multipath Considerations
4360

44-
To leverage multiple paths for block storage, it is important to perform the
61+
To leverage multiple paths for block storage, it is important to perform
4562
multipath configuration on the host.
4663
If your distribution does not provide `/etc/multipath.conf`, then you can
4764
either use the following minimalistic one:
4865

49-
defaults {
50-
find_multipaths yes
51-
user_friendly_names yes
52-
}
66+
```
67+
defaults {
68+
find_multipaths yes
69+
user_friendly_names yes
70+
}
71+
```
5372

5473
or create a new one by running:
5574

56-
$ mpathconf --enable
75+
```console
76+
$ mpathconf --enable
77+
```
5778

5879
Finally you'll need to ensure to start or reload and enable multipath:
5980

60-
$ systemctl enable multipathd.service
61-
$ systemctl restart multipathd.service
81+
```console
82+
$ systemctl enable --now multipathd.service
83+
```
6284

6385
**Note:** Any change to `multipath.conf` or enabling multipath can lead to
64-
inaccessible block devices, because they'll be claimed by multipath and
86+
inaccessible block devices as they will be claimed by multipath and
6587
exposed as a device in /dev/mapper/*.
6688

67-
Some additional informations about multipath can be found in the
68-
[iSCSI documentation](../iscsi/README.md)
69-
7089

7190
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
7291
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/examples/volumes/fibre_channel/README.md?pixel)]()

staging/volumes/fibre_channel/fc.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v1
22
kind: Pod
33
metadata:
4-
name: fc
4+
name: fibre-channel-example-pod
55
spec:
66
containers:
77
- image: kubernetes/pause
@@ -12,7 +12,8 @@ spec:
1212
volumes:
1313
- name: fc-vol
1414
fc:
15-
targetWWNs: ['500a0982991b8dc5', '500a0982891b8dc5']
16-
lun: 2
15+
targetWWNs:
16+
- <ADD Target WWN Here>
17+
lun: <ADD LUN ID Here>
1718
fsType: ext4
1819
readOnly: true

0 commit comments

Comments
 (0)