apiVersion: v1
kind: Pod
metadata:
  name: grq
spec:
  initContainers:
    - name: init-grq-redis
      image: busybox
      volumeMounts:
      - mountPath: /wait-for-it.sh
        name: global-config
        subPath: wait-for-it.sh
      command: ['sh', '/wait-for-it.sh', '-t', '0', 'grq-redis:6379']
    - name: init-grq-elasticsearch
      image: busybox
      volumeMounts:
      - mountPath: /wait-for-it.sh
        name: global-config
        subPath: wait-for-it.sh
      command: ['sh', '/wait-for-it.sh', '-t', '0', 'grq-elasticsearch:9200']
  containers:
  - name: grq
    image: hysds/grq:latest
    ports:
    - containerPort: 22
      name: ssh
    - containerPort: 80
      name: http
    - containerPort: 443
      name: https
    - containerPort: 8878
      name: grq2
    - containerPort: 8879
      name: tosca
    - containerPort: 9001
      name: supervisord
    resources:
      limits:
        cpu: "0.5"
    volumeMounts:
    - mountPath: /home/ops/.ssh/id_rsa
      name: global-secrets
      subPath: id_rsa
      readOnly: true
    - mountPath: /home/ops/.ssh/authorized_keys
      name: global-secrets
      subPath: id_rsa.pub
      readOnly: true
    - mountPath: /home/ops/.aws/config
      name: global-config
      subPath: aws_config
      readOnly: true
    - mountPath: /home/ops/.aws/credentials
      name: global-config
      subPath: aws_credentials
      readOnly: true
    - mountPath: /home/ops/sciflo/etc/celeryconfig.py
      name: global-config
      subPath: celeryconfig.py
    - mountPath: /home/ops/mozart/etc/datasets.json
      name: global-config
      subPath: datasets.json
    - mountPath: /home/ops/sciflo/etc/grq2_settings.cfg
      name: config
      subPath: settings.cfg.grq2
    - mountPath: /home/ops/sciflo/etc/tosca_settings.cfg
      name: config
      subPath: settings.cfg.tosca
    - mountPath: /home/ops/sciflo/log
      name: log
  volumes:
  - name: global-secrets
    secret:
      secretName: hysds-global-secrets
  - name: global-config
    configMap:
      name: hysds-global-config
  - name: config
    configMap:
      name: hysds-grq-config
  - name: log
    emptyDir: {}
