apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: test-ingress
spec:
  rules:
  - host: foo1.bar.com
    http:
      paths:
      - backend:
          service:
            name: nginx-ingress-svc
            port:
              number: 80
        path: /
        pathType: ImplementationSpecific
---
apiVersion: v1
kind: Service
metadata:
  name: nginx-ingress-svc
  labels:
    k8s-app: nginx-app-ingress
spec:
  ports:
  - port: 80
    targetPort: 80
    protocol: TCP
    name: http
  selector:
    k8s-app: nginx-app-ingress
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: test-ingress
spec:
  replicas: 2
  selector:
    matchLabels:
      k8s-app: nginx-app-ingress
  template:
    metadata:
      labels:
        k8s-app: nginx-app-ingress
    spec:
      terminationGracePeriodSeconds: 60
      containers:
      - name: testcontainer
        image: rancher/mirrored-library-busybox:1.37.0
        args: ['sh', '-c', 'echo Welcome to nginx! > index.html; hostname > name.html; httpd -vvf']
        ports:
        - containerPort: 80
