Kubernetes

NFS Volumes

There are two ways to handle NFS:

Example for NFS Volume:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: example-app
  labels:
    app: example-app
spec:
  replicas: 1
  selector:
    matchLabels:
      app: example-app
  template:
    metadata:
      labels:
        app: example-app
    spec:
      containers:
      - name: example-app
        image: busybox:latest
        command: ["sleep", "3000"]
        volumeMounts:
        - mountPath: /persistent-volume
          name: nfs-volume
      volumes:
      - name: nfs-volume
        nfs:
          server: "server_ip"
          path: "/path/to/directory"

NGINX