apiVersion: v1
kind: ReplicationController
metadata:
  name: nginx-ingress-controller
  labels:
    k8s-app: nginx-ingress-lb
  namespace: elastic-job
spec:
  replicas: 1
  selector:
    k8s-app: nginx-tcp-ingress-lb
  template:
    metadata:
      labels:
        k8s-app: nginx-tcp-ingress-lb
        name: nginx-tcp-ingress-lb
    spec:
      terminationGracePeriodSeconds: 60
      containers:
        - image: quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.11.0
          name: nginx-tcp-ingress-lb
          readinessProbe:
            httpGet:
              path: /healthz
              port: 10254
              scheme: HTTP
          livenessProbe:
            httpGet:
              path: /healthz
              port: 10254
              scheme: HTTP
            initialDelaySeconds: 10
            timeoutSeconds: 1
          env:
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: POD_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
          ports:
            - containerPort: 80
              hostPort: 80
            - containerPort: 443
              hostPort: 443
            - containerPort: 9000
              hostPort: 9000
          args:
            - /nginx-ingress-controller
            - --default-backend-service=$(POD_NAMESPACE)/default-http-backend
            - --tcp-services-configmap=$(POD_NAMESPACE)/nginx-tcp-ingress-configmap