apiVersion: apps/v1
kind: Deployment
metadata:
  name: opencga
spec:
  selector:
    matchLabels:
      app: opencga
  replicas: 1  
  template:
    metadata:
      labels:
        app: opencga
    spec:
      nodeSelector:
        node : worker
      containers:
      - name: opencga
        image: opencb/opencga-next:X.4
        imagePullPolicy: Always
        env:
          - name: PASSWORD
            valueFrom:
              secretKeyRef:
                name: installation-password
                key: password
        command: ["/bin/sh"]
        args: 
        - "-c"
#        - "echo $PASSWORD | /opt/opencga/bin/opencga-admin.sh catalog install" 
 #       - "sleep 60"
        - "echo $PASSWORD | /opt/opencga/bin/opencga-admin.sh server rest --start"
        ports:
        - containerPort: 9090
        volumeMounts:
        - name : conf
          mountPath: /opt/opencga/conf
          readOnly: true
        - name : opencga-shared
          mountPath: /opt/opencga/sessions
      volumes:
      - name: conf
        configMap:
         name: conf
      - name: opencga-shared
        persistentVolumeClaim:
          claimName: opencga-storage-claim

