kubernetes-retired / external-storage

[EOL] External storage plugins, provisioners, and helper libraries
Apache License 2.0
2.7k stars 1.6k forks source link

[nfs-provisioner] Running outside kubernetes (standalone) #1290

Closed uselessidbr closed 4 years ago

uselessidbr commented 4 years ago

Hello!

I'm trying to understand how the StorageClass/kubernetes will point to the nfs-provisioner (and the nfs server) running outside of the cluster (standalone or containerized).

Example:

sudo ./nfs-provisioner -provisioner=example.com/nfs \ -kubeconfig=$HOME/.kube/config \ -run-server=false \ -use-ganesha=false \ -enable-xfs-quota=true

I'm not sure how to set up, inside the kubernetes cluster, the ip address/hostname to the pointing to the nfs-provisioner.

Thanks in advance!

uselessidbr commented 4 years ago

The kubeconfig integrates the nfs-provisioner with the Kubernetes Cluster (OKD in my case).

My setup was like this:

/usr/local/bin/nfs-provisioner -provisioner=nfs-server-hostname/nfs -master=https://**cluster-api-address**:8443 -kubeconfig=/root/.kube/config -use-ganesha=false -run-server=false -server-hostname=nfs-server-hostname -enable-xfs-quota=true -export-subnet=nfs-export-subnet

Then i deployed the ServiceAccount:

apiVersion: v1
kind: ServiceAccount
metadata:
  name: nfs-provisioner

And the RBAC: https://github.com/kubernetes-incubator/external-storage/blob/master/nfs/deploy/kubernetes/rbac.yaml

After that, downloaded the kubeconfig of the SA nfs-provisioner and pointed the nfs-provisioner command line to load it.