apiVersion: apps/v1
kind: Deployment
metadata:
  name: story-deployment
  namespace: default
  labels:
    name: story-deployment
spec:
  selector:
    matchLabels:
      app: story-app
  replicas: 1
  template:
    metadata:
      labels:
        app: story-app
    spec:
      containers:
        - name: story
          image: gcr.io/tradaccs/kub-data:v5

#          more complex configuration, but might be necessary if you don't want
#          to apply ALL key-value pairs from the config map
#          env:
#            - name: STORY_DIR
#              valueFrom:
#                configMapKeyRef:
#                  name: story-config
#                  key: STORY_DIR

#          applies ALL key-value pairs from the config map
          envFrom:
            - configMapRef:
                name: story-config
          ports:
            - containerPort: 3000
#          resources:
#            requests:
#              cpu: 200m
          volumeMounts:
            - mountPath: /app/story
              name: story-volume
      volumes:
        - name: story-volume
          persistentVolumeClaim:
            claimName: story-volume-claim
#          emptyDir: {}
#          hostPath:
#            path: /var/story
#            type: DirectoryOrCreate
