blob: 9e83d47c95e7bdf0e005cfb60c3727d75d30e1a7 [file] [log] [blame] [view]
Giorgi Lekveishviliee15ee22024-03-28 12:35:10 +04001# Installing a NFS-provisioner
2
3Gerrit requires access to a persistent volume capable of running in
4`Read Write Many (RWM)`-mode to store the git repositories, since the repositories
5have to be accessed by mutiple pods. One possibility to provide such volumes
6is to install a provisioner for NFS-volumes into the same Kubernetes-cluster.
7This document will guide through the process.
8
9The [Kubernetes external-storage project](https://github.com/kubernetes-incubator/external-storage)
10provides an out-of-tree dynamic [provisioner](https://github.com/kubernetes-incubator/external-storage/tree/master/nfs)
11for NFS volumes. A chart exists for easy deployment of the project onto a
12Kubernetes cluster. The chart's sources can be found [here](https://github.com/helm/charts/tree/master/stable/nfs-server-provisioner).
13
14## Prerequisites
15
16This guide will use Helm to install the NFS-provisioner. Thus, Helm has to be
17installed.
18
19## Installing the nfs-server-provisioner chart
20
21A custom `values.yaml`-file containing a configuration tested with the
22gerrit charts can be found in the `supplements/nfs`-directory in the
23gerrit chart's root directory. In addition a file stating the tested
24version of the nfs-server-provisioner chart is present in the same directory.
25
26If needed, adapt the `values.yaml`-file for the nfs-server-provisioner chart
27further and then run:
28
29```sh
30cd $(git rev-parse --show-toplevel)/helm-charts/gerrit/supplements/nfs
31helm install nfs \
32 stable/nfs-server-provisioner \
33 -f values.yaml \
34 --version $(cat VERSION)
35```
36
37For a description of the configuration options, refer to the
38[chart's documentation](https://github.com/helm/charts/blob/master/stable/nfs-server-provisioner/README.md).
39
40Here are some tips for configuring the nfs-server-provisioner chart to work with
41the gerrit chart:
42
43- Deploying more than 1 `replica` led to some reliability issues in tests and
44 should be further tested for now, if required.
45- The name of the StorageClass created for NFS-volumes has to be the same as the
46 one defined in the gerrit chart for `storageClasses.shared.name`
47- The StorageClas for NFS-volumes needs to have the parameter `mountOptions: vers=4.1`,
48 due to compatibility [issues](https://github.com/kubernetes-incubator/external-storage/issues/223)
49 with Ganesha.
50
51## Deleting the nfs-server-provisioner chart
52
53***note
54**Attention:** Never delete the nfs-server-provisioner chart, if there is still a
55PersistentVolumeClaim and Pods using a NFS-volume provisioned by the NFS server
56provisioner. This will lead to crashed pods, that will not be terminated correctly.
57***
58
59If no Pod or PVC is using a NFS-volume provisioned by the NFS server provisioner
60anymore, delete it like any other chart:
61
62```sh
63helm delete nfs
64```