-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_templates.gotmpl
More file actions
165 lines (141 loc) · 4.79 KB
/
Copy path_templates.gotmpl
File metadata and controls
165 lines (141 loc) · 4.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
{{ define "extra.logo" -}}
```
,-.
, ,-. ,-.
/ \ ( )-( )
\ | ,.>-( )-<
\|,' ( )-( )
Y ___`-' `-'
|/__/ `-'
|
|
| -hi-
__|_____________
```
{{- end }}
{{ define "extra.introduction" -}}
## Introduction
This Kubernetes helm chart allows the management of Network File System (NFS) storage. It does this by deploying, to each node in the cluster, a pod running both the driver and CSI Node Driver Registrar sidecar containers. Applications can access existing NFS shares by simply specifying a Storage Class (SC), Persistent Volume (PV) and Persistent Volume Claim (PVC).
This chart was developed and tested on kubernetes version 1.19, but should work on earlier or later versions.
{{- end }}
{{ define "extra.requirementsSection" -}}
* helm 3 installation
* Nodes have enought resources to run the chart pod.
* Any one namespace to deploy into.
* NFS Client installed on each node in the cluster.
* An NFS server and existing accessible shares (confirm that the shares are accessible from one or more of the cluster nodes).
Images:
* Node Driver Registrar: https://github.com/kubernetes-csi/node-driver-registrar
* CSI NFS driver: https://github.com/kubernetes-csi/csi-driver-nfs
{{- end }}
{{ define "extra.chartInstallation" -}}
## Installing the Chart
There are two methods that can be used to install the chart.
Use the chart from the Keyporttech Helm Repository
```console
helm repo add keyporttech https://keyporttech.github.io/helm-charts/
helm install my-release keyporttech/{{ template "chart.name" . }} -n my-namespace
```
or clone this repo and install from the local file system.
```console
$ helm install my-release . -n my-namespace
```
Only a single instance of the NFS CSI Driver can exist in a cluster so only one helm release of the chart is permissible.
> **Tip**: There should not be a need to modify any of the chart values. Use the default [values.yaml](values.yaml) file.
{{- end }}
{{ define "extra.chartUninstall" -}}
## Uninstalling the Chart
To uninstall/delete the `my-release` deployment:
```console
$ helm uninstall my-release -n my-namespace
```
All resources associated with the last release of the chart as well as its release history will be deleted.
{{- end }}
{{ define "extra.storage" -}}
## Storage
This chart enables applications to access existing NFS shares through SCs, PVs and PVCs. By default no shares will be deleted when the chart is uninstalled.
In the repository root folder there is a examples subfolder containing the nginx web server. It shows how to create a sc, pv and pvc outside the chart so that an application can mount an existing NFS share.
Applications do not have to be installed into the same namespace as this chart. Already deployed applications can remain in their current namespace and be updated to use the driver.
See nginx pod example below. The following may need to change:
* SC, PV and PVC name
* PV and PVC storage size
* PV mountOptions and volumeAttributes
```yaml
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: csi-driver-nfs-nginx-sc
annotations:
storageclass.kubernetes.io/is-default-class: "false"
provisioner: nfs.csi.k8s.io
reclaimPolicy: Retain
volumeBindingMode: Immediate
parameters:
storagepolicyname: "NFS CSI Driver" # Optional Parameter
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: csi-driver-nfs-nginx-pv
spec:
#claimRef:
# name: csi-driver-nfs-nginx-pvc
# namespace: apps
accessModes:
- ReadWriteMany
persistentVolumeReclaimPolicy: Retain
capacity:
storage: 1Gi
volumeMode: Filesystem
storageClassName: csi-driver-nfs-nginx-sc
mountOptions:
- nfsvers=3
- nolock
#- hard
csi:
driver: nfs.csi.k8s.io
volumeHandle: nginx-data-id
volumeAttributes:
# NFS server and mount path i.e. share or its subdirectory
# server: IP or FQDN i.e. host.example.com
server: 192.168.x.x
share: /mnt/pool/share/csi-dir
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: csi-driver-nfs-nginx-pvc
spec:
storageClassName: csi-driver-nfs-nginx-sc
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1Gi
---
apiVersion: v1
kind: Pod
metadata:
name: nginx
spec:
#serviceAccount: csi-driver-nfs-nodeplugin
containers:
- image: maersk/nginx
name: nginx
ports:
- containerPort: 80
protocol: TCP
volumeMounts:
- mountPath: /var/www
name: nginx-data-nfs
volumes:
- name: nginx-data-nfs
persistentVolumeClaim:
claimName: csi-driver-nfs-nginx-pvc
```
This will enable direct communication between the NFS server and the CSI Driver running in the cluster.
{{- end }}
{{ define "extra.contributing" -}}
## Contributing
Please see [keyporttech charts contribution guidelines](https://github.com/keyporttech/helm-charts/blob/master/CONTRIBUTING.md)
{{- end }}