How to get SFTP details to each PV in Kubernetes

7/15/2019

I'm hosting multiple sites in a Kubernetes cluster for each client. WP sites have its own persistent disk using NFS server with ReadWriteMany mode. Each customer needs SFTP/FTP login details

I managed to run SFTP in K8s using https://github.com/atmoz/sftp and get credentials. It works, but I'm not able to edit/delete files. Also after creating this, WP now asks for FTP credentials for doing everything. Looks like it lost the permission

Here is how my spec looks like:

spec:
  #secrets and config
  volumes:
    - name: nfs
      persistentVolumeClaim:
        claimName: nfs

  containers:
    #the sftp server itself
    - name: sftp
      image: atmoz/sftp:latest
      imagePullPolicy: Always
      args: ["admin:admin:1010:1013"]
      ports:
        - containerPort: 22
      volumeMounts:
        - mountPath: /var/www/html
          name: nfs
      securityContext:
        capabilities:
          add: ["SYS_ADMIN"]
      resources: {}
-- Gijo Varghese
kubernetes
sftp
wordpress

0 Answers