apiVersion: v1
kind: ReplicationController
metadata:
  name: nginx-ingress-controller
  namespace: nginx-ingress
  labels:
    k8s-app: nginx-ingress-lb
spec:
  replicas: 1
  selector:
    k8s-app: nginx-ingress-lb
  template:
    metadata:
      labels:
        k8s-app: nginx-ingress-lb
        name: nginx-ingress-lb
    spec:
      nodeSelector:
        role: loadbalancer
      hostNetwork: true
      terminationGracePeriodSeconds: 60
      containers:
      - image: gcr.io/google_containers/nginx-ingress-controller:0.8.3
        name: nginx-ingress-lb
        imagePullPolicy: Always
        readinessProbe:
          httpGet:
            path: /healthz
            port: 10254
            scheme: HTTP
        livenessProbe:
          httpGet:
            path: /healthz
            port: 10254
            scheme: HTTP
          initialDelaySeconds: 10
          timeoutSeconds: 1
        # use downward API
        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
        args:
        - /nginx-ingress-controller
        - --default-backend-service=nginx-ingress/default-http-backend
        volumeMounts:
        - name: kubernetes-conf
          mountPath: /root/.kube/config
        - name: kubernetes-ssl
          mountPath: /etc/kubernetes/ssl/
      volumes:
      - name: kubernetes-conf
        hostPath:
          path: /opt/kubernetes/ssl/kube.conf
      - name: kubernetes-ssl
        hostPath:
          path: /opt/kubernetes/ssl/
