apiVersion: apps/v1
kind: Deployment
metadata:
  name: cubanews-rest-api-deployment
  labels:
    app: cubanews-rest-api
    project: cubanews
spec:
  replicas: 1
  selector:
    matchLabels:
      app: cubanews-rest-api
  template:
    metadata:
      labels:
        app: cubanews-rest-api
    spec:
      containers:
      - name: cubanews-rest-api
        image: cubanews-rest-api:1.0.0
        imagePullPolicy: IfNotPresent
        ports:
          - containerPort: 8080
        resources:
          limits:
            memory: "1Gi"
            cpu: "200m"
        volumeMounts:
        - name: storage
          mountPath: /data
        - name: datastore-key
          mountPath: "/etc/datastore"
      volumes:
      - name: storage
        emptyDir: {}
      - name: datastore-key
        secret:
          secretName: datastore-key

# TODO: Migrate to an external volume that will not be linked to the node.