apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: molecuilder-server
  labels:
    app: server
spec:
  replicas: 1
  selector:
    matchLabels:
      app: server
  template:
    metadata:
      labels:
        app: server
    spec:
      containers:
      - name: server
        image: registry.dev.svc.cluster.local:5000/molecuilder:1.7.0-qtless
        imagePullPolicy: Always
        env:
          - name: SERVER_PORT
            value: "20025"
          - name: CONTROLLER_PORT
            value: "20024"
          - name: WORKER_ADDRESS
            value: "molecuilder-worker:20026"
        command: ["/home/molecuilder/_pkgs/molecuilder-1.6.1/bin/molecuilder_server"]
        args: ["--signal", "15", "--workeraddress", "$(WORKER_ADDRESS)", "--controllerport", "$(CONTROLLER_PORT)", "--workerport", "$(SERVER_PORT)", "--verbosity", "4", "--timeout", "60"]
        ports:
        - containerPort: 20024
          name: controllerport
        - containerPort: 20025
          name: workerport
        livenessProbe:
          exec:
            command:
              - /home/molecuilder/_pkgs/molecuilder-1.6.1/bin/molecuilder_controller
              - --server
              - localhost:20024
              - --command
              - checkresults
          initialDelaySeconds: 5
          periodSeconds: 30
