apiVersion: v1
kind: ReplicationController
metadata:
  name: ${nfsBucketServerName}
spec:
  replicas: 1
  selector:
    role: ${nfsBucketServerName}
  template:
    metadata:
      labels:
        role: ${nfsBucketServerName}
    spec:
      volumes:
        - name: ${serviceAccountSecret}
          secret:
            secretName:  ${serviceAccountSecret}
      containers:
      - name: nfs-bucket-server
        image: docker.io/anderselton/nfs-bucket-server:1.0
        env:
        - name: BUCKET
          value: "${nfsBucket}"
        ports:
          - name: nfs
            containerPort: 2049
          - name: mountd
            containerPort: 20048
          - name: rpcbind
            containerPort: 111
        volumeMounts:
          - name:  ${serviceAccountSecret}
            mountPath: "/accounts"
            readOnly: true
        securityContext:
          privileged: true