initial commit

This commit is contained in:
allard
2025-11-23 18:58:51 +01:00
commit 376a944abc
1553 changed files with 314731 additions and 0 deletions

35
lp/nfs/README.md Executable file
View File

@@ -0,0 +1,35 @@
NFS Installatie:
================
helm repo add nfs-subdir-external-provisioner \
https://kubernetes-sigs.github.io/nfs-subdir-external-provisioner
helm install -n nfs-provisioning --create-namespace nfs-subdir-external-provisioner \
nfs-subdir-external-provisioner/nfs-subdir-external-provisioner \
--set nfs.server=192.168.2.110 --set nfs.path=/opt/dynamic-storage
Testen:
kubectl apply -f demo-pvc.yaml
kubectl apply -f test-pod.yaml
kubectl exec -it test-pod -n nfs-provisioning -- df -h
#nfs als default storage instellen:
kubectl get storageclass
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
microk8s-hostpath microk8s.io/hostpath Delete WaitForFirstConsumer false 33m
nfs-client cluster.local/nfs-subdir-external-provisioner Delete Immediate true 18m
kubectl patch storageclass microk8s-hostpath -p \
'{"metadata": \
{"annotations":{"storageclass.kubernetes.io/is-default-class":"false"}}}'
kubectl patch storageclass nfs-client -p \
'{"metadata": \
{"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'

11
lp/nfs/catalog-info.yaml Normal file
View File

@@ -0,0 +1,11 @@
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: lp-nfs
title: Nfs (lp)
spec:
type: service
lifecycle: production
owner: platform-team
partOf:
- ../catalog-info.yaml

12
lp/nfs/demo-pvc.yaml Executable file
View File

@@ -0,0 +1,12 @@
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: demo-claim
namespace: nfs-provisioning
spec:
storageClassName: nfs-client
accessModes:
- ReadWriteMany
resources:
requests:
storage: 10Mi

18
lp/nfs/k3s/nfs.yaml Executable file
View File

@@ -0,0 +1,18 @@
apiVersion: v1
kind: Namespace
metadata:
name: nfs-provisioning
---
apiVersion: helm.cattle.io/v1
kind: HelmChart
metadata:
name: nfs-provisioning
namespace: kube-system
spec:
repo: https://kubernetes-sigs.github.io/nfs-subdir-external-provisioner
chart: nfs-subdir-external-provisioner
targetNamespace: nfs-provisioning
valuesContent: |-
nfs:
server: 192.168.2.100
path: /opt/dynamic-storage

View File

@@ -0,0 +1,13 @@
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: nfs-csi
provisioner: nfs.csi.k8s.io
parameters:
server: 192.168.2.110
share: /mnt/nfs_share/nfs-dynamic/
reclaimPolicy: Delete
volumeBindingMode: Immediate
mountOptions:
- hard
- nfsvers=4.1

29
lp/nfs/test-nfs.yaml Executable file
View File

@@ -0,0 +1,29 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: fedoratest
labels:
app: fedoratest
spec:
replicas: 1
selector:
matchLabels:
app: fedora
template:
metadata:
labels:
app: fedora
spec:
containers:
- name: fedora
image: fedora
command: ["/bin/bash", "-c", "--"]
args: ["while true; do sleep 30; done;"]
volumeMounts:
- name: nfs-vol
mountPath: /opt/nfs
volumes:
- name: nfs-vol
nfs:
server: 192.168.40.100
path: /mnt/nfs_share

22
lp/nfs/test-pod.yaml Executable file
View File

@@ -0,0 +1,22 @@
kind: Pod
apiVersion: v1
metadata:
name: test-pod
namespace: nfs-provisioning
spec:
containers:
- name: test-pod
image: busybox:latest
command:
- "/bin/sh"
args:
- "-c"
- "touch /mnt/SUCCESS && sleep 600"
volumeMounts:
- name: nfs-pvc
mountPath: "/mnt"
restartPolicy: "Never"
volumes:
- name: nfs-pvc
persistentVolumeClaim:
claimName: demo-claim