apiVersion: v1
kind: Service
metadata:
  name: navidrome
  namespace: navidrome
spec:
  type: NodePort
  ports:
    - name: http
      port: 4533
      nodePort: 30781
      targetPort: navidrome-http
  selector:
    app: navidrome
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: navidrome-pv-claim
  namespace: navidrome
  labels:
    app: navidrome
spec:
  accessModes:
    - ReadWriteMany
  storageClassName: ""
  resources:
    requests:
      storage: 2Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: navidrome
  namespace: navidrome
  labels:
    app: navidrome
spec:
  selector:
    matchLabels:
      app: navidrome
      tier: frontend
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: navidrome
        tier: frontend
    spec:
      containers:
      - env:
          - name: JAVA_OPTS
            value: -Dserver.port=4533
        name: navidrome
        image: deluan/navidrome:latest
        imagePullPolicy: IfNotPresent
        ports:
        - containerPort: 4533
          name: "navidrome-http"
        volumeMounts:
        - name: navidrome-www-folder
          mountPath: /data
        - name: navidrome-www-folder
          mountPath: /music
      volumes:
      - name: navidrome-www-folder
        persistentVolumeClaim:
          claimName: navidrome-pv-claim
