apiVersion: v1
kind: Pod
metadata:
  name: apple-app
  labels:
    app: apple
spec:
  containers:
  - name: apple-app
    image: hashicorp/http-echo
    args:
      - "-text=apple"
---
apiVersion: v1
kind: Service
metadata:
  name: apple-service
spec:
  selector:    
    app: apple
  ports:  
    - port: 5678
---
apiVersion: v1
kind: Pod
metadata:
  name: banana-app
  labels:
    app: banana
spec:
  containers:
  - name: banana-app
    image: hashicorp/http-echo
    args:
      - "-text=banana"
---
apiVersion: v1
kind: Service
metadata:
  name: banana-service
spec:
  selector:    
    app: banana
  ports:  
    - port: 5678
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: example-ingress
  annotations:
    ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
  - http:
      paths:
      - path: /apple
        backend:
          serviceName: apple-service
          servicePort: 5678
      - path: /banana
        backend:
          serviceName: banana-service
          servicePort: 5678
