apiVersion: v1
kind: ReplicationController
metadata:
  name: bitunnel-jobq-handler-${CIRCLE_BUILD_NUM}
spec:
  replicas: 1
  selector:
    app: bitunnel-jobq-handler
    buildVersion: "build-${CIRCLE_BUILD_NUM}"
  template:
    metadata:
      labels:
        app: bitunnel-jobq-handler
        buildVersion: "build-${CIRCLE_BUILD_NUM}"
    spec:
      containers:
      - name: bitunnel-jobq-handler
        image: ${EXTERNAL_REGISTRY_ENDPOINT}/bitunnel-jobq-handler:build-${CIRCLE_BUILD_NUM}
        ports:
        - containerPort: 8080
          name: http
        env:
        - name: KUBERNETES_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: "metadata.namespace"
        - name: REDIS_MASTER
          value: "${PROD_REDIS_MASTER}"
        - name: REDIS_PORT
          value: "${PROD_REDIS_PORT}"
        - name: MIDDLEWARE_EVENT_URL
          value: "${PROD_MIDDLEWARE_EVENT_URL}"
        - name: ODATA_JOBQ_URL
          value: "${PROD_ODATA_JOBQ_URL}"
        - name: ODATA_JOBQ_USER
          value: "${PROD_PNG_NAV_USER}"
        - name: ODATA_JOBQ_PASS
          value: "${PROD_PNG_NAV_PASS}"
        - name: ODATA_JOBQ_DOMAIN
          value: "${PROD_ODATA_JOBQ_DOMAIN}"
        - name: TENANT_ID
          value: "${PROD_PNG_TDC_TENANT_ID}"
        - name: BATCH_SIZE
          value: "${PROD_BATCH_SIZE}"
        - name: DISPATCH_DELAY
          value: "${PROD_DISPATCH_DELAY}"
        - name: DISPATCH_INTERVAL
          value: "${PROD_DISPATCH_INTERVAL}"
        - name: MAIL_URL  
          value: "${PROD_MAIL_URL}"
