nixos-servers/kubernetes/nfs-test.yaml

55 lines
1 KiB
YAML

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