apiVersion: v1
kind: Service
metadata:
  name: hammond
spec:
  type: NodePort
  ports:
    - name: http
      port: 3000
      nodePort: 30081
      targetPort: hammond-http
  selector:
    app: hammond
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: hammond-assets-claim
  labels:
    app: hammond
spec:
  accessModes:
    - ReadWriteMany
  storageClassName: ""
  resources:
    requests:
      storage: 2Gi
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: hammond-config-claim
  labels:
    app: hammond
spec:
  accessModes:
    - ReadWriteMany
  storageClassName: ""
  resources:
    requests:
      storage: 1Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: hammond
  labels:
    app: hammond
spec:
  selector:
    matchLabels:
      app: hammond
      tier: frontend
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: hammond
        tier: frontend
    spec:
      containers:
      - name: hammond
        image: akhilrex/hammond
        ports:
        - containerPort: 3000
          name: "hammond-http"
        volumeMounts:
        - name: hammond-assets-folder
          mountPath: /assets
        - name: hammond-config-folder
          mountPath: /config
      imagePullSecrets:
      - name: reg-cred-secret
      volumes:
      - name: hammond-assets-folder
        persistentVolumeClaim:
          claimName: hammond-assets-claim
      - name: hammond-config-folder
        persistentVolumeClaim:
          claimName: hammond-config-claim
