# A Service and corresponding endpoints object.
# Endpoint on the local node, expect this route.
kind: Service
apiVersion: v1
metadata:
  name: service-1
spec:
  type: LoadBalancer
  externalTrafficPolicy: Local
  clusterIP: 10.101.0.101
  ports:
  - port: 80
    protocol: TCP
    targetPort: 80

---

kind: Endpoints
apiVersion: v1
metadata:
  name: service-1
subsets:
- addresses:
  - ip: 192.168.2.1
    nodeName: kube-master
    targetRef:
      kind: Pod
      name: nginx-1
      namespace: default
  ports:
  - port: 80
    protocol: TCP

---

# A Service and corresponding endpoints object.
# Endpoint NOT on the local node, don't expect this route.
kind: Service
apiVersion: v1
metadata:
  name: service-2
spec:
  type: LoadBalancer
  externalTrafficPolicy: Local
  clusterIP: 10.101.0.102
  ports:
  - port: 80
    protocol: TCP
    targetPort: 80

---

kind: Endpoints
apiVersion: v1
metadata:
  name: service-2
subsets:
- addresses:
  - ip: 192.168.2.2
    nodeName: kube-node-1
    targetRef:
      kind: Pod
      name: nginx-2
      namespace: default
  ports:
  - port: 80
    protocol: TCP
