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
        imagePullPolicy: IfNotPresent
        image: us-east1-docker.pkg.dev/crawl-and-search/cubanews/cubanews-rest-api:IMAGE_VERSION
        ports:
          - containerPort: 8080
        volumeMounts:
        - name: cubanews-persistent-storage
          mountPath: /data
        - name: datastore-key
          mountPath: "/etc/datastore"
        env:
          - name: GOOGLE_APPLICATION_CREDENTIALS
            value: /etc/datastore/datastore-key
      volumes:
      - name: cubanews-persistent-storage
        persistentVolumeClaim:
          claimName: cubanews-volumeclaim
      - name: datastore-key
        secret:
          secretName: datastore-key