add nfs-provisioner with sensible path template

This commit is contained in:
Remy Moll 2024-03-28 12:29:16 +01:00
parent 571aebe78d
commit eff07665de
8 changed files with 87 additions and 0 deletions

View File

@ -0,0 +1,20 @@
## How to use
This deployment exposes a `StorageClass` named `nfs-client` that can be used to create `PersistentVolumeClaim` resources:
```
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: test-claim
namespace: test-namespace
spec:
storageClassName: nfs-client
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1Mi
```
This will create a new folder in the NFS server under `<base-path>/test-namespace/test-claim` and mount it.

View File

@ -0,0 +1,12 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: nfs-provisioner
resources:
- github.com/kubernetes-sigs/nfs-subdir-external-provisioner//deploy
- namespace.yaml
patches:
- path: nfs_values.yaml
- path: storageclass_values.yaml

View File

@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: placeholder

View File

@ -0,0 +1,21 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: nfs-client-provisioner
name: nfs-client-provisioner
spec:
template:
spec:
containers:
- name: nfs-client-provisioner
env:
- name: NFS_SERVER
value: 192.168.1.157
- name: NFS_PATH
value: /export/kluster/
volumes:
- name: nfs-client-root
nfs:
server: 192.168.1.157
path: /export/kluster/

View File

@ -0,0 +1,7 @@
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: nfs-client
parameters:
archiveOnDelete: "true"
pathPattern: "${.PVC.namespace}/${.PVC.name}"

View File

@ -11,6 +11,7 @@ resources:
# infrastructure apps
- projects.yaml
- nfs-provisioner/
- backup/
- pg-ha/
- gitea/

View File

@ -0,0 +1,18 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: nfs-provisioner-application
namespace: argocd
spec:
project: infrastructure
source:
repoURL: git@github.com:moll-re/bootstrap-k3s-infra.git
targetRevision: main
path: infrastructure/nfs-provisioner/
destination:
server: https://kubernetes.default.svc
namespace: nfs-provisioner
syncPolicy:
automated:
prune: true
selfHeal: true

View File

@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- application.yaml