commit 4f6c5285832253656a03d303f06443cdaa10c998 parent 64625d6a07f2fb5452aaa18608d702ff32eff117 Author: MTRNord <mtrnord1@gmail.com> Date: Wed, 19 Jul 2023 10:59:28 +0200 nfs server in-cluster Diffstat:
| A | apps/production/nfs-server.yaml | | | 60 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1 file changed, 60 insertions(+), 0 deletions(-)
diff --git a/apps/production/nfs-server.yaml b/apps/production/nfs-server.yaml @@ -0,0 +1,60 @@ +--- +kind: Service +apiVersion: v1 +metadata: + name: nfs-server + labels: + app: nfs-server +spec: + type: ClusterIP # use "LoadBalancer" to get a public ip + selector: + app: nfs-server + ports: + - name: tcp-2049 + port: 2049 + protocol: TCP + - name: udp-111 + port: 111 + protocol: UDP +--- +kind: Deployment +apiVersion: apps/v1 +metadata: + name: nfs-server +spec: + replicas: 1 + selector: + matchLabels: + app: nfs-server + template: + metadata: + name: nfs-server + labels: + app: nfs-server + spec: + nodeSelector: + "kubernetes.io/hostname": "nordgedanken.dev" + containers: + - name: nfs-server + image: git.nordgedanken.dev/kubernetes/gitops/itsthenetwork/nfs-server-alpine:latest + securityContext: + capabilities: + add: ["SYS_ADMIN", "SETPCAP"] + env: + - name: SHARED_DIRECTORY + value: "/exports" + volumeMounts: + - mountPath: /exports + name: nfs-vol + ports: + - name: tcp-2049 + containerPort: 2049 + protocol: TCP + - name: udp-111 + containerPort: 111 + protocol: UDP + volumes: + - name: nfs-vol + hostPath: + path: /kubernetes # modify this to specify another path to store nfs share data + type: DirectoryOrCreate