apiVersion: apps/v1
kind: Deployment
metadata:
  name: server-deployment
spec:
  replicas: 3
  selector:
    matchLabels:
      component: server
  template:
    metadata:
      labels:
        component: server
    spec:
      containers:
        - name: server
          image: gcr.io/thesis2020-04/server
          ports:
            - containerPort: 5000
          env:
            - name: MONGO_HOST
              value: mongo-cluster-ip-service
            - name: MONGO_PORT
              value: "27017"
            - name: MONGO_DATABASE
              value: mongo
            - name: MONGO_USERNAME
              valueFrom:
                secretKeyRef:
                  name: mysecret
                  key: MONGO_USERNAME
            - name: MONGO_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: mysecret
                  key: MONGO_PASSWORD
            - name: SECRET_KEY
              valueFrom:
                secretKeyRef:
                  name: mysecret
                  key: SECRET_KEY
