nfs-ganesha

This commit is contained in:
azykov@mail.ru
2026-07-31 08:51:16 +03:00
parent 03f0a108d9
commit c16fbac895
9 changed files with 221 additions and 2 deletions
@@ -0,0 +1,51 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: nfs-ganesha-config
namespace: nfs
data:
ganesha.conf: |
NFS_Core_Param {
NFS_Port = 2049;
Protocols = NFSv4;
Fsid_Device = true;
}
NFSV4 {
RecoveryBackend = fs_ng;
RecoveryRoot = /recovery;
Lease_Lifetime = 40;
Grace_Period = 50;
}
VFS {
Link_Support = true;
Symlink_Support = true;
CanSetTime = true;
umask = 0000;
}
EXPORT {
Export_Id = 1;
Path = /export;
Pseudo = /exports/shared/documents;
SecType = sys;
Protocols = NFSv4;
FSAL {
Name = VFS;
}
CLIENT {
Clients = *;
Access_Type = RW;
Squash = No_Root_Squash;
Protocols = NFSv4;
}
}
LOG {
Default_Log_Level = INFO;
}
@@ -0,0 +1,114 @@
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: nfs-ganesha
namespace: nfs
spec:
interval: 30m
chartRef:
kind: OCIRepository
name: nfs-ganesha
values:
controllers:
app:
strategy: Recreate
podDisruptionBudget:
maxUnavailable: "0"
initContainers:
mtab-setup:
image:
repository: hectorm/nfs-ganesha
tag: v10
command:
- sh
- -c
- cat /proc/self/mounts > /mtab-vol/mtab
containers:
app:
image:
repository: hectorm/nfs-ganesha
tag: v10
securityContext:
readOnlyRootFilesystem: true
capabilities:
drop:
- ALL
add:
- CHOWN
- DAC_OVERRIDE
- DAC_READ_SEARCH
- FOWNER
- FSETID
- SETGID
- SETUID
- SYS_RESOURCE
probes:
liveness:
enabled: true
spec:
initialDelaySeconds: 2
periodSeconds: 10
timeoutSeconds: 2
failureThreshold: 3
readiness:
enabled: true
spec:
initialDelaySeconds: 1
periodSeconds: 2
timeoutSeconds: 1
failureThreshold: 2
resources:
requests:
cpu: 50m
memory: 128Mi
limits:
memory: 512Mi
service:
app:
controller: app
type: LoadBalancer
labels:
loadBalancerPool: nfs
ports:
nfs:
port: 2049
protocol: TCP
persistence:
config:
type: configMap
name: nfs-ganesha-config
globalMounts:
- path: /etc/ganesha/ganesha.conf
subPath: ganesha.conf
readOnly: true
export:
type: persistentVolumeClaim
accessMode: ReadWriteOnce
size: 30Gi
storageClass: longhorn
retain: true
globalMounts:
- path: /export
run:
type: emptyDir
globalMounts:
- path: /run
tmp:
type: emptyDir
globalMounts:
- path: /tmp
recovery:
type: emptyDir
globalMounts:
- path: /recovery
etc-mtab:
type: emptyDir
advancedMounts:
app:
app:
- path: /etc/mtab
subPath: mtab
mtab-setup:
- path: /mtab-vol
@@ -0,0 +1,10 @@
apiVersion: source.toolkit.fluxcd.io/v1
kind: OCIRepository
metadata:
name: nfs-ganesha
namespace: nfs
spec:
interval: 1h
url: oci://ghcr.io/bjw-s-labs/helm/app-template
ref:
tag: "5.0.1"
@@ -0,0 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- helmrepository.yaml
- configmap.yaml
- helmrelease.yaml
+17 -1
View File
@@ -6,7 +6,8 @@ metadata:
namespace: metallb-system
spec:
addresses:
- 10.0.64.5-10.0.64.6
# exclude 10.0.64.5, its in nfs-pool
- 10.0.64.6
# exclude 10.0.64.7, its in dmz-pool
# exclude 10.0.64.8, its in mqtt-pool
- 10.0.64.9-10.0.64.19
@@ -16,6 +17,21 @@ spec:
- matchLabels:
loadBalancerPool: default
---
# NFS ip
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
name: dmz-pool
namespace: metallb-system
spec:
addresses:
- 10.0.64.5/32
autoAssign: true
serviceAllocation:
serviceSelectors:
- matchLabels:
loadBalancerPool: nfs
---
# DMZ (not really, just for clarity) ip, will have ports forwarded from WAN router
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
+4
View File
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: nfs