apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-ingress-test
  labels:
    example: ingress
spec:
  selector:
    matchLabels:
      app: nginx-test
  replicas: 1 # Not much meaningful to have 2 pods if the content will be the same ...
  template:
    metadata:
      labels:
        example: ingress
        app: nginx-test
    spec:
      containers:
        - name: nginx-cont
          image: nginx
          ports:
            - containerPort: 80
              name: http
---
apiVersion: v1
kind: Service
metadata:
  name: ingress-service
  labels:
    example: ingress
spec:
  selector:
    app: nginx-test
  ports:
    - port: 80
      targetPort: http
  externalTrafficPolicy: Local
  type: NodePort

---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress-test
#  annotations:
#    nginx.ingress.kubernetes.io/rewrite-target: /
  labels:
    example: ingress
spec:
  ingressClassName: ingress-example
  rules:
    - http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: ingress-service
                port:
                  number: 80
#---
#apiVersion: networking.k8s.io/v1
#kind: Ingress
#metadata:
#  annotations:
#    kubernetes.io/ingress.class: istio
#  name: istio-ingress
#spec:
#  rules:
#    #- host: *
#    -  http:
#        paths:
#          - path: /
#            pathType: Prefix
#            backend:
#              service:
#                name: ingress-service
#                port:
#                  number: 80
#  type: LoadBalancer