apiVersion: apps/v1
kind: Deployment
metadata:
  name: gnzcacher
spec:
  selector:
    matchLabels:
      app: gnzcacher
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
  replicas: 2
  template:
    metadata:
      labels:
        app: gnzcacher
    spec:
      containers:
      - name: gnzcacher
        image: grantnz/gnzcacher:latest
        env:
        - name: LOG_LEVEL
          value: "info"
        - name: DB_ENGINE
          value: "mysql"
        - name: DB_HOST
          value: "docker.for.mac.localhost"
        - name: DB_USER
          value: "root"
        - name: DB_PORT
          value: "3306"
        - name: DB_NAME
          value: "grant_n_z"
        - name: ETCD_HOST
          value: "docker.for.mac.localhost"
        - name: ETCD_PORT
          value: "2379"
        - name: CACHER_TIME_MILLIS
          value: "1000"
        - name: DB_PASSWORD
          valueFrom:
            secretKeyRef:
              name: grantnz-db-secret
              key: rdbms-password
