1diff --git a/content/logs/2021-12-26-nfs-k3s.org b/content/logs/2021-12-26-nfs-k3s.org
2new file mode 100644
3index 0000000000000000000000000000000000000000..5785d4f99db2f3d74898a61808dc41a50184cafd
4--- /dev/null
5+++ b/content/logs/2021-12-26-nfs-k3s.org
6@@ -0,0 +1,61 @@
7+---
8+title: "Enable NFS on K3S"
9+date: 2021-12-26
10+tags: ['kubernetes', 'linux', 'helm', 'k3s']
11+---
12+
13+By default [[https://k3s.io/][K3S]] comes only with [[https://github.com/rancher/local-path-provisioner][local-path]] storage class, and if you are running
14+with more than one node in your cluster you may want to use a more "distributed"
15+solution. For may case I opted for NFS.
16+
17+To check the current storage class you can run:
18+
19+#+BEGIN_SRC bash
20+k3s kubectl get storageclasses
21+#+END_SRC
22+
23+And it will print something like:
24+
25+#+BEGIN_SRC
26+NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
27+local-path (default) rancher.io/local-path Delete WaitForFirstConsumer false 154d
28+#+END_SRC
29+
30+To start adding First you need to install [[https://github.com/helm/helm][helm]] on your server. To do so you may
31+run:
32+
33+#+BEGIN_SRC bash
34+curl -sSL https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
35+#+END_SRC
36+
37+*Be careful when running scripts directly into bash always check the source*
38+*Sometimes is also recommended to do not pipe directly to bash*
39+
40+Once it is installed we need to add the [[https://kubernetes.io/docs/concepts/storage/storage-classes/#nfs][NFS storage classes]]. It has two
41+providers, I have chose [[https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner][NFS Subdir External Provisioner]].
42+
43+Add the helm repo
44+
45+#+BEGIN_SRC bash
46+helm repo add nfs-subdir-external-provisioner https://kubernetes-sigs.github.io/nfs-subdir-external-provisioner/
47+#+END_SRC
48+
49+Then we need to actually install the provider
50+
51+
52+#+BEGIN_SRC bash
53+helm install nfs-subdir-external-provisioner nfs-subdir-external-provisioner/nfs-subdir-external-provisioner \
54+ --set nfs.server=x.x.x.x \
55+ --set nfs.path=/exported/path
56+#+END_SRC
57+
58+Set the ~nfs.server~ and ~nfs.path~ accordingly with your setup.
59+
60+After that if we run ~k3s kubectl get storageclasses~ it will now print another
61+NFS provider:
62+
63+#+BEGIN_SRC
64+NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
65+local-path (default) rancher.io/local-path Delete WaitForFirstConsumer false 154d
66+nfs-client cluster.local/nfs-subdir-external-provisioner Delete Immediate true 76m
67+#+END_SRC