apiVersion: apps/v1
kind: "Deployment"
metadata:
  name: "kupping-backend"
  namespace: "default"
  labels:
    app: "kupping-backend"
spec:
  replicas: 1
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1 
      maxUnavailable: 1
  selector:
    matchLabels:
      app: "kupping-backend"
  template:
    metadata:
      labels:
        app: "kupping-backend"
    spec:
      volumes:
      - name: tickets
        persistentVolumeClaim:
          claimName: ticket-disk
      containers:
      - name: backend
        image: eu.gcr.io/k3s-tests/kupping/backend
        resources:
          requests:
            memory: "256Mi"
            cpu: "60m"
          limits:
            memory: "512Mi"
            cpu: "160m"
        volumeMounts:
        - mountPath: "/var/tickets"
          name: tickets
        env:
        - name: PORT
          valueFrom:
            configMapKeyRef:
              key: PORT
              name: kupping-backend-config
        - name: docker
          valueFrom:
            configMapKeyRef:
              key: docker
              name: kupping-backend-config
        - name: MONGO
          valueFrom:
            configMapKeyRef:
              key: MONGO
              name: kupping-backend-config
        - name: MONGO_PORT
          valueFrom:
            configMapKeyRef:
              key: MONGO_PORT
              name: kupping-backend-config
        - name: MONGO_PREFIX
          valueFrom:
            configMapKeyRef:
              key: MONGO_PREFIX
              name: kupping-backend-config
        - name: MONGO_USER
          valueFrom:
            configMapKeyRef:
              key: MONGO_USER
              name: kupping-backend-config
        - name: MONGO_PASSWORD
          valueFrom:
            configMapKeyRef:
              key: MONGO_PASSWORD
              name: kupping-backend-config
        - name: MONGO_PARAMS
          valueFrom:
            configMapKeyRef:
              key: MONGO_PARAMS
              name: kupping-backend-config
        - name: MONGO_DATABASE
          valueFrom:
            configMapKeyRef:
              key: MONGO_DATABASE
              name: kupping-backend-config
