ITNEXT

ITNEXT is a platform for IT developers & software engineers to share knowledge, connect, collaborate, learn and experience next-gen technologies.

Follow publication

Member-only story

Kubernetes Storage — Part 1 — NFS complete tutorial

Saeid Bostandoust
ITNEXT
Published in
4 min readOct 20, 2021

--

In this series of articles, I intend to talk about available Kubernetes storage solutions with the complete manual to deploying and connecting them to the Kubernetes. Each article contains a different storage solution that can be used in combination with Kubernetes. This series of tutorials is useful for everyone who knows the Kubernetes storage architecture and concepts. Please note that this series of the tutorial is not a conceptual one about the Kubernetes and I’m not talking about the Kubernetes concepts. So, let’s get the party started with the NFS storage.

Resource Requirements:

  • A running Kubernetes cluster. 1.18+ is suggested.
  • A running node with some available storage.

I will run the steps on Ubuntu-based systems. I suggest you do too.

For this demonstration, I use two nodes with the following configuration:

A running node using as the NFS server:

OS: Ubuntu 20.04
FQDN: node004.b9tcluster.local
IP Address: 192.168.12.7

A single-node Kubernetes cluster:

OS: Ubuntu 20.04
Kubernetes: 1.21.5 (k3s distribution)
FQDN: node005.b9tcluster.local
IP Address: 192.168.12.8

1- Deploy and configuring the NFS server:

Run the following commands on the node you considered as an NFS server. Please note that you can deploy the NFS server in a clustered way with high availability support. Search it if you want.

apt update && apt -y upgradeapt install -y nfs-servermkdir /datacat << EOF >> /etc/exports
/data 192.168.12.8(rw,no_subtree_check,no_root_squash)
EOF
systemctl enable --now nfs-serverexportfs -ar

That commands install the NFS server and export /data which is accessible by the Kubernetes cluster. In the case of a multi-node Kubernetes cluster, you should allow all Kubernetes worker nodes.

2- Prepare Kubernetes worker nodes:

--

--

Published in ITNEXT

ITNEXT is a platform for IT developers & software engineers to share knowledge, connect, collaborate, learn and experience next-gen technologies.

Responses (3)

Write a response