---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: music-sshfs
spec:
  selector:
    matchLabels:
      component: music-sshfs
  replicas: 1
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        component: music-sshfs
    spec:
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
              - matchExpressions:
                  - key: kubernetes.io/arch
                    operator: In
                    values:
                      - "amd64"
      containers:
        - name: music-sshfs
          image: gjyoung1974/alpine-sshd
          ports:
            - containerPort: 22
          volumeMounts:
            - mountPath: /music
              name: music-library
          envFrom:
            - secretRef:
                name: music-sshfs-secret
      restartPolicy: Always
      volumes:
        - name: music-library
          persistentVolumeClaim:
            claimName: music-library
