apiVersion: v1
kind: ReplicationController
metadata:
  name: rancher-ingress-controller
  labels:
    k8s-app: rancher-ingress-lb
spec:
  replicas: 1
  selector:
    k8s-app: rancher-ingress-lb
  template:
    metadata:
      labels:
        k8s-app: rancher-ingress-lb
        name: rancher-ingress-lb
    spec:
      containers:
      - image: rancher/ingress-controller:dev
        name: rancher-ingress-lb
        # use downward API
        env:
          - name: POD_NAME
            valueFrom:
              fieldRef:
                fieldPath: metadata.name
          - name: POD_NAMESPACE
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace
          - name: KUBERNETES_URL
            value: "http://master"
          - name: HAPROXY_CONFIG
            value: "/etc/haproxy/haproxy.cfg"
        ports:
        - containerPort: 80
          hostPort: 80
        - containerPort: 443
          hostPort: 443
        args:
        - ingress-controller
        - --lb-controller=kubernetes
        - --lb-provider=haproxy