apiVersion: apps/v1
kind: Deployment
metadata:
  name: wecal-deployment
  labels:
    app: wecal
spec:
  replicas: 1
  selector:
    matchLabels:
      app: wecal
  template:
    metadata:
      labels:
        app: wecal
    spec:
      containers:
      - name: wecal
        # image: yutaarai/wecal:1
        image: gcr.io/wecal-kube/wecal:v2
        ports:
          - containerPort: 8080
        env:
        - name: MONGO_INITDB_ROOT_USERNAME
          valueFrom:
            secretKeyRef:
              name: mongodb-secret
              key: mongo-root-username
        - name: MONGO_INITDB_ROOT_PASSWORD
          valueFrom: 
            secretKeyRef:
              name: mongodb-secret
              key: mongo-root-password
        - name: DB_CONNECTION
          valueFrom: 
            configMapKeyRef:
              name: mongodb-configmap
              key: database_url


