# https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/provider/baremetal/service-nodeport.yaml
# NOTE: This is a fix for -
#   - Services "ingress-nginx" not found
#   - Flood of ingress-nginx service error in controller
# https://github.com/kubernetes/ingress-nginx/issues/2599
# https://github.com/kubernetes-sigs/kubespray/issues/3005

---
apiVersion: v1
kind: Service
metadata:
  name: ingress-nginx
  # namespace: ingress-nginx
  namespace: kube-system
  labels:
    # app.kubernetes.io/name: ingress-nginx
    # app.kubernetes.io/part-of: ingress-nginx
    app.kubernetes.io/name: nginx-ingress
    app.kubernetes.io/part-of: nginx-ingress
spec:
  type: NodePort
  ports:
    - name: http
      port: 80
      targetPort: 80
      protocol: TCP
    - name: https
      port: 443
      targetPort: 443
      protocol: TCP
  selector:
    # app.kubernetes.io/name: ingress-nginx
    # app.kubernetes.io/part-of: ingress-nginx
    app.kubernetes.io/name: nginx-ingress
    app.kubernetes.io/part-of: nginx-ingress
