apiVersion: v1
kind: ReplicationController
metadata:
  namespace: kube-system
  name: nginx-ingress
  labels:
    app: nginx-ingress
spec:
  replicas: 3
  selector:
    app: nginx-ingress
  template:
    metadata:
      labels:
        app: nginx-ingress
    spec:
      containers:
      - image: devlm/nginx-ingress:dev
        imagePullPolicy: Always
        name: nginx-ingress
        env:
          - name: POD_NAME
            valueFrom:
              fieldRef:
                apiVersion: v1
                fieldPath: metadata.name
          - name: POD_NAMESPACE
            valueFrom:
              fieldRef:
                apiVersion: v1
                fieldPath: metadata.namespace
          - name: "VAULT_ADDR"
            value: "http://vault.kube-system.svc.cluster.local:8243"
          - name: "VAULT_SKIP_VERIFY"
            value: "false"
        ports:
        - containerPort: 80
          hostPort: 80
        - containerPort: 443
          hostPort: 443
        volumeMounts:
          - name: vault-volume
            mountPath: /etc/vault-token
      volumes:
        - name: vault-volume
          secret:
              secretName: ingress-token
      nodeSelector:
        role: loadbalancer
