apiVersion: v1
kind: Service
metadata:
  name: mongodb
  labels:
    name: mongodb
spec:
  type: ClusterIP
  ports:
  - name: http
    port: 27017
    targetPort: 27017
  selector:
    name: heroes-db
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name:  heroes-db-deploy
  labels:
    name:  heroes-db
spec:
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
    type: RollingUpdate
  template:
    metadata:
      labels:
        name:  heroes-db
    spec:
      imagePullSecrets:
        - name: acr-secret
      containers:
      - image:  <login server>/azureworkshop/rating-db:v1
        name:  heroes-db-cntnr
        resources:
          requests:
            cpu: "20m"
            memory: "55M"
        ports:
        - containerPort:  27017
          name:  heroes-db
        volumeMounts:
        - mountPath: /data
          name: data
        imagePullPolicy: Always
      volumes:
        - name: data
          emptyDir: {}
      restartPolicy: Always