Skip to content

Specify IP addresses the Ingress controller is listening on #137

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
cluk1 opened this issue Jan 17, 2017 · 20 comments
Open

Specify IP addresses the Ingress controller is listening on #137

cluk1 opened this issue Jan 17, 2017 · 20 comments
Labels
needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-priority needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.

Comments

@cluk1
Copy link

cluk1 commented Jan 17, 2017

We are running k8s on bare metal. It would be great to specify the IP addresses the nginx ingress controller is listening on.

This would enable us

  1. to route traffic for specific IPV4 IPs to k8s
  2. also route (http) traffic for IPV6 addresses to k8s.

AFAIK 1) can be achieved by using a service in front of the ingress ctrl with external (IPV4) addresses. But currently we do not see any possibility to achieve 2).

Might be related to #131 .

Thanks a lot!

@euank
Copy link
Contributor

euank commented Jan 18, 2017

2 is related to #34; I use a daemonset with net=host to manage ipv6 ingress

@bprashanth
Copy link
Contributor

you probably want to specify the name of the interface instead of the actual ip? eg if you just want to listen on cbr0 or docker0 with net=host, so the system is free to manage ipam. The way the nodecontroller assigns cidrs to nodes today, you don't know the range a given node will get.

@cluk1
Copy link
Author

cluk1 commented Jan 26, 2017

@euank Thanks for the pointer. But isn't nginx listening on all IPV4 and IPV6 addresses which are available on the host in that setup? We are trying to migrate one IP at a time to k8s and keep the other IPs and services working outside of k8s.

@cluk1
Copy link
Author

cluk1 commented Jan 26, 2017

@bprashanth Thanks for the suggestion. We are using a fixed /28 subnet for our incoming traffic. Therefore it would be great to specify exact listen addresses for nginx. What would also work is using the hostnames from the ingress object for the nginx listen directives. Though my attempts using a custom nginx template doing that failed utterly. ;)

@euank
Copy link
Contributor

euank commented Jan 26, 2017

@cluk33 indeed, it is for me. It's not ideal, but it's worked for me so far. Specifying only one ipv6 address would be saner.

@euank
Copy link
Contributor

euank commented Jan 26, 2017

@bprashanth on the other hand, you don't necessarily want to listen on an interface for the case of eth0 or whatever since you've potentially got multiple different ips on it.

@TattiQ
Copy link

TattiQ commented Oct 11, 2017

I also use bare metal and would be great to be able to assign an external IP for ingress
and thus use the hostnames from the ingress resource for the nginx listen directives.
Currently I am not sure how I can get this working - private docker registry (2 rc replica's, talking to the same redis deployment + the same filesystem (nfs mount to all kube nodes) ) behind a nginx controller + ingress resource points to a hostname docker-registry.bla.bla . My understanding is docker-registry.bla.bla should be pointing to the nginx external IP in DNS which in its turn redirects traffic to the endpoints in round robin. But we have no way to point it to nginx, have we ? Please correct me if I am wrong somewhere there, I am a newbie to kubernetes

@bowei
Copy link
Member

bowei commented Oct 11, 2017

This issue was moved to kubernetes/ingress-gce#24

@bowei bowei closed this as completed Oct 11, 2017
@guoshimin
Copy link

@bowei Can we reopen this one? It was moved to ingress-gce and closed there as "irrelevant to gce".

@zerthimon
Copy link

I'd also like to have the possibility to specify the IP for the controller to listen on.
I'm using a daemonset with net=host.

@mentos1386
Copy link

@bowei can this be reopned? I'm also in need of specifying on which ip it should listen on, instead of just using 0.0.0.0.

@j-mahlke
Copy link

j-mahlke commented Jul 28, 2023

Is there a solution for this issue from 6 years ago?

@W1zzardTPU
Copy link

Same problem, switched to HAProxy ingress and was up and running within 15 minutes

@Tashows
Copy link

Tashows commented Jan 27, 2025

@bowei Can you please reopen this? As more people pointed out, this was never supposed to move to another project.

@bowei
Copy link
Member

bowei commented Jan 27, 2025

/reopen

Sorry about that

@k8s-ci-robot k8s-ci-robot reopened this Jan 27, 2025
@k8s-ci-robot
Copy link
Contributor

@bowei: Reopened this issue.

In response to this:

/reopen

Sorry about that

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Jan 27, 2025
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If Ingress contributors determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-priority labels Jan 27, 2025
@longwuyuan
Copy link
Contributor

@Tashows
Copy link

Tashows commented Jan 28, 2025

ingress-nginx/charts/ingress-nginx/values.yaml

Line 508 in 01d0a20
externalIPs: []

Tried this, but it just appends the externalIPs you set to the already discovered IPs. The desired effect would be to override them.

@strongjz
Copy link
Member

Looks like it was answered in the other issue

https://github.com/kubernetes/ingress-nginx/blob/main/internal/ingress/status/status.go#L74C1-L80C59

// statusSync keeps the status IP in each Ingress rule updated executing a periodic check
// in all the defined rules. To simplify the process leader election is used so the update
// is executed only in one node (Ingress controllers can be scaled to more than one)
// If the controller is running with the flag --publish-service (with a valid service)
// the IP address behind the service is used, if it is running with the flag
// --publish-status-address, the address specified in the flag is used, if neither of the
// two flags are set, the source is the IP/s of the node/s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-priority needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.
Projects
None yet
Development

No branches or pull requests