Is there a way to assign the ingress to a specific node?
I know that it is possible to assign a pod to a specific node using nodeSelectors
but that is not a valid option for ingress pods according to the spec.
Hard to say. Ingress only works, if any of your nodes has an ingress controller, like nginx or traefik. Defining an ingress using the Ingress
resource doesn't implicitly addresses a target node. Instead of this, you can create your ingress controller using nodeSelector
, what makes sure, that these nodes definitely are connected to the services.
If you want to exclude other ingress controllers, you should annotate your ingress controllers and match them with annotations on ingress, like
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: example-ingress-zone1
annotations:
kubernetes.io/ingress.class: "zone1"
spec:
(check out source)
Then you can match specific ingress controllers, which are in a zone to use the ingress on selected nodes
Ingress
is just a logical way to represent how to route traffic to service/pod. Regarding the question, Ingress Controller
might be the right term on which you should check instead.
Read more here: ingress controller. There's a possible chance Ingress Controller pod
can be assigned to specific node.