add kubernetes test for nfs mounts
This commit is contained in:
parent
217051981c
commit
9185beb663
3 changed files with 58 additions and 2 deletions
55
kubernetes/nfs-test.yaml
Normal file
55
kubernetes/nfs-test.yaml
Normal file
|
@ -0,0 +1,55 @@
|
|||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
app: fedoratest
|
||||
name: fedoratest
|
||||
spec:
|
||||
replicas: 2
|
||||
selector:
|
||||
matchLabels:
|
||||
app: fedoratest
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: fedoratest
|
||||
spec:
|
||||
containers:
|
||||
- image: registry.fedoraproject.org/fedora:35
|
||||
name: fedora
|
||||
command: ["/bin/bash", "-c", "--"]
|
||||
args: ["while true; do sleep 30; done;"]
|
||||
volumeMounts:
|
||||
# name must match the volume name below
|
||||
- name: media
|
||||
mountPath: "/mnt/media"
|
||||
volumes:
|
||||
- name: media
|
||||
persistentVolumeClaim:
|
||||
claimName: media
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: media
|
||||
spec:
|
||||
capacity:
|
||||
storage: 1Mi
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
nfs:
|
||||
server: lewis.hyp
|
||||
path: "/mnt/data/nfs/media"
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: media
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
storageClassName: ""
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Mi
|
||||
volumeName: media
|
|
@ -96,6 +96,7 @@
|
|||
pciutils
|
||||
dmidecode
|
||||
openssl
|
||||
nfs-utils
|
||||
];
|
||||
|
||||
nixpkgs.overlays = [
|
||||
|
|
|
@ -33,7 +33,7 @@ let
|
|||
nfsExports = lib.strings.concatLines (
|
||||
builtins.map
|
||||
(share:
|
||||
"${cfg.nfsRoot}${share} 192.168.30.0/${config.lab.networking.dmz.ipv4.prefixLength}(rw,sync,no_subtree_check,no_root_squash)"
|
||||
"${cfg.nfsRoot}${share} 192.168.30.0/16(rw,sync,no_subtree_check,no_root_squash)"
|
||||
)
|
||||
nfsShares
|
||||
);
|
||||
|
@ -66,7 +66,7 @@ in
|
|||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
networking.firewall.interfaces.${config.lab.networking.dmz.bridgeName}.allowedTCPPorts = [
|
||||
networking.firewall.allowedTCPPorts = [
|
||||
2049 # NFS
|
||||
5432 # PostgeSQL
|
||||
111 # NFS
|
||||
|
|
Loading…
Reference in a new issue