---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: dd-cyberia-development-blue
  namespace: default
  labels:
    app: dd-cyberia-development-blue
    deploy-id: dd-cyberia-development
spec:
  replicas: 1
  selector:
    matchLabels:
      app: dd-cyberia-development-blue
  template:
    metadata:
      labels:
        app: dd-cyberia-development-blue
        deploy-id: dd-cyberia-development
    spec:
      containers:
        - name: dd-cyberia-development-blue
          image: underpost/underpost-engine:v3.3.0
          imagePullPolicy: IfNotPresent
          envFrom:
            - secretRef:
                name: underpost-config
          env:
            - name: UNDERPOST_INTERNAL_PORT
              value: "4004"

          command:
            - /bin/sh
            - -c
            - >
              underpost secret underpost --create-from-env &&
              underpost start --build --run dd-cyberia development
          readinessProbe:
            {
              "httpGet": {
                "path": "/_internal/ready",
                "port": 4004
              },
              "initialDelaySeconds": 5,
              "periodSeconds": 5,
              "timeoutSeconds": 3,
              "failureThreshold": 3
            }
          livenessProbe:
            {
              "httpGet": {
                "path": "/_internal/health",
                "port": 4004
              },
              "initialDelaySeconds": 30,
              "periodSeconds": 15,
              "timeoutSeconds": 3,
              "failureThreshold": 3
            }
          startupProbe:
            {
              "httpGet": {
                "path": "/_internal/ready",
                "port": 4004
              },
              "initialDelaySeconds": 10,
              "periodSeconds": 10,
              "timeoutSeconds": 3,
              "failureThreshold": 180
            }


    
          volumeMounts:
            - name: vol-public-dd-cyberia-dd-cyberia-development-blue
              mountPath: /home/dd/engine/src/client/public/cyberia
    
            - name: vol-public-dd-cyberia-underpost-dd-cyberia-development-blue
              mountPath: /home/dd/engine/src/client/public/underpost
    
      volumes:
        - name: vol-public-dd-cyberia-dd-cyberia-development-blue
          persistentVolumeClaim:
            claimName: pvc-public-dd-cyberia-dd-cyberia-development-blue
    
      
        - name: vol-public-dd-cyberia-underpost-dd-cyberia-development-blue
          persistentVolumeClaim:
            claimName: pvc-public-dd-cyberia-underpost-dd-cyberia-development-blue
    
      
---
apiVersion: v1
kind: Service
metadata:
  name: dd-cyberia-development-blue-service
  namespace: default
spec:
  selector:
    app: dd-cyberia-development-blue
  ports:
    - name: 'tcp-4005'
      protocol: TCP
      port: 4005
      targetPort: 4005
    - name: 'udp-4005'
      protocol: UDP
      port: 4005
      targetPort: 4005

    - name: 'tcp-4006'
      protocol: TCP
      port: 4006
      targetPort: 4006
    - name: 'udp-4006'
      protocol: UDP
      port: 4006
      targetPort: 4006

    - name: 'tcp-4007'
      protocol: TCP
      port: 4007
      targetPort: 4007
    - name: 'udp-4007'
      protocol: UDP
      port: 4007
      targetPort: 4007

    - name: 'tcp-4008'
      protocol: TCP
      port: 4008
      targetPort: 4008
    - name: 'udp-4008'
      protocol: UDP
      port: 4008
      targetPort: 4008

    - name: 'tcp-4009'
      protocol: TCP
      port: 4009
      targetPort: 4009
    - name: 'udp-4009'
      protocol: UDP
      port: 4009
      targetPort: 4009

    - name: 'tcp-4010'
      protocol: TCP
      port: 4010
      targetPort: 4010
    - name: 'udp-4010'
      protocol: UDP
      port: 4010
      targetPort: 4010

    - name: 'tcp-4011'
      protocol: TCP
      port: 4011
      targetPort: 4011
    - name: 'udp-4011'
      protocol: UDP
      port: 4011
      targetPort: 4011

    - name: 'tcp-4012'
      protocol: TCP
      port: 4012
      targetPort: 4012
    - name: 'udp-4012'
      protocol: UDP
      port: 4012
      targetPort: 4012

    - name: 'tcp-4013'
      protocol: TCP
      port: 4013
      targetPort: 4013
    - name: 'udp-4013'
      protocol: UDP
      port: 4013
      targetPort: 4013

    - name: 'tcp-4014'
      protocol: TCP
      port: 4014
      targetPort: 4014
    - name: 'udp-4014'
      protocol: UDP
      port: 4014
      targetPort: 4014

    - name: 'tcp-4015'
      protocol: TCP
      port: 4015
      targetPort: 4015
    - name: 'udp-4015'
      protocol: UDP
      port: 4015
      targetPort: 4015

    - name: 'tcp-4016'
      protocol: TCP
      port: 4016
      targetPort: 4016
    - name: 'udp-4016'
      protocol: UDP
      port: 4016
      targetPort: 4016
  type: LoadBalancer
