Yamls

From My Wiki
Jump to: navigation, search

POD with NFS mount

# Create a pod that reads and writes to the NFS server via an NFS volume.

kind: Pod
apiVersion: v1
metadata:
  name: pod-using-nfs
spec:
  # Add the server as an NFS volume for the pod
  volumes:
    - name: nfs-volume
      nfs: 
        # URL for the NFS server
        server: 10.128.0.4        # Change to the NFS server IP
        path: /mnt/sharedfolder  # Change to the exported folder name

  # In this container, we'll mount the NFS volume
  # and write the date to a file inside it.
  containers:
    - name: app
      image: alpine              # Change to the needed image

      # Mount the NFS volume in the container
      volumeMounts:
        - name: nfs-volume
          mountPath: /var/nfs    # Change to the desired mount point


VPN client

Deployment YAML:

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  annotations:
    kompose.cmd: kompose convert --volumes persistentVolumeClaim
    kompose.version: 1.16.0 (0c01309)
  creationTimestamp: null
  labels:
    io.kompose.service: vpn
  name: vpn
spec:
  replicas: 1
  strategy:
    type: Recreate
  template:
    metadata:
      creationTimestamp: null
      labels:
        io.kompose.service: vpn
    spec:
      containers:
      - env:
        - name: TZ
          value: EST5EDT
        image: dperson/openvpn-client
        name: vpn
        resources: {}
        securityContext:
          capabilities:
            add:
            - net_admin
        stdin: true
        tty: true
        volumeMounts:
        - mountPath: /vpn
          name: vpn-claim0
        - mountPath: /run
          name: vpn-tmpfs0
        - mountPath: /tmp
          name: vpn-tmpfs1
      restartPolicy: Always
      volumes:
      - name: vpn-claim0
        persistentVolumeClaim:
          claimName: vpn-claim0
      - emptyDir:
          medium: Memory
        name: vpn-tmpfs0
      - emptyDir:
          medium: Memory
        name: vpn-tmpfs1
status: {}


Storage yaml:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  creationTimestamp: null
  labels:
    io.kompose.service: vpn-claim0
  name: vpn-claim0
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 100Mi
status: {}