-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Feature Request: Update Kubernetes Ingress Status #2173
Comments
Hi @micahhausler, thank you for your feature request. Do I understand correctly that the field should be populated based on a static custom configuration option? Or, to put it differently, it should not be computed dynamically somehow? |
The Nginx ingress controller elects a leader and only routes traffic through the leader, so it updates any managed Ingress rules With Traefik on K8s, you could do that, but my implementation is to use multiple traefik pods and route them behind a kubernetes Load Balancer (AWS ELB) service. The traefik pods don't inherently know which kubernetes service they are behind, so the solution above is to just set a manual configuration of the IP or Hostname (AWS ELB uses The best option would probably be to have default behavior like the Nginx ingress controller where the master updates the status fields of all its managed ingress routes to the node's IP, with a configurable override. The MVP that solves my use case would just be a static configuration option. |
@micahhausler appreciate the clarification. The static (MVP) approach should be fairly easy to implement. @dtomcej @errm any thoughts / objections? |
After digging into the nginx ingress controller, it actually has a |
I'm not really sure what the purpose of this would be. Is it to update the ingress status to show which ingress controller has satisfied the ingress? If so, we would run into issues. In traefik, all nodes satisfy requests, and all nodes forward traffic to backend pods. This would be constantly overwritten as each ingress controller would feel "responsible". I suppose we could have the master node (which is responsible for running jobs etc) handle this annotation, but again, it would not be accurate... |
@dtomcej The purpose was stated in the original issue, for use with other kubernetes components (like external-dns) and to conform to the way other ingress controllers behave. I'm not advocating just putting one node IP (though thats what the nginx ingress controller does), I'm advocating setting it to the kubernetes service that fronts traefik (a loadbalancer DNS on AWS, or a VIP for GCP) in which case, all nodes would still answer requests. It wouldn't have to be set, but the option would be very nice. The master node would still be responsible for setting the Does that make sense? |
Nginx simply sets the external IP for the load balanced service fronting nginx in my case, which is a fantastic solution that plays well with e.g. external-dns. |
|
#2173 (comment) sounds reasonable to me. @dtomcej WDYT? |
No real objections here. It does seem very environment dependant, and potentially unreliable for new users to detect automatically with different use cases, as @errm mentioned, but they should be able to fall back to static configuration. I would say give it a go! |
Any updates to this issue? I see that as of v1.5.0 Traefik is still not setting status.loadBalancer on our Kubernetes cluster. Manually defining external-dns.alpha.kubernetes.io/target in our manifests is starting to become unmanageable as an ongoing workaround. |
Nobody is currently working on this, presumably due to bandwidth constraints only. Whoever feels like picking up the task and submitting a PR is absolutely welcome. :-) |
I would if I knew Go well enough :| |
For people that want to use traefik with externalDNS and are considering to use Please note that you will have to change your changing see also kubernetes-sigs/external-dns#262 simple prefixer to ease migration - https://sourcegraph.com/github.com/honestbee/devops-tools@2b1006a7d55f1dd0a439f48f4fbc763b15822832/-/blob/r53-txtprefix/main.go#L56 |
@micahhausler @so0k @jcardoso-bv Is this still an issue? Please let us know! Thanks! |
Very much so. The current workaround of declaring the desired DNS hostname via an externaldns annotation is not sustainable longterm. So much so we've stopped using Traefik entirely on our clusters and moved to NGINX and ALB ingress controllers where the status.loadBalancer field is populated correctly. |
Hi @dtomcej. Yes, it is still an issue, unfortunately. Agree with @jcardoso-bv. Manually managing |
Same story as @jcardoso-bv, I’ve switched to other controllers for the same reason (among other traefik pain points with Kubernetes) |
I've added some tooling around my deployments that pick out the IP associated with traefik and updates DNS names, but it would be much better to be able to go back to having external-dns (or similar) handle this dynamically by having the data available in the ingress status. |
We also abandoned Traefik due to this issue |
We also have this issue. |
Looking good :) |
Enjoy, in the next version (1.7) the issue was resolved 🎉 |
Updating ingress is more of cloud provider nature but Traefik is a generally a cluster-wide reverse proxy which is a subset of full-functioned ingress controller. So configuring a static hostname/ip land patching that config into ingresses looks like a fake to me, frankly speaking. At least until someday Traefik provides interfaces for cloud providers 😄AFAICT |
@ldez @dtomcej 1.7 doesn't seem to work for me I'm using stable/traefik helm chart for deployment, just updated imageTag to 1.7. However, status is still not updated in ingress:
Traefik version I'm using:
|
@ms-choudhary you have to instruct Traefik to update Ingress status. Please check the docs - https://docs.traefik.io/v1.7/configuration/backends/kubernetes/#ingressendpoint and the last section of https://docs.traefik.io/v1.7/configuration/backends/kubernetes/#configuration |
Using
[kubernetes]
[kubernetes.ingressEndpoint]
publishedService = "{{ .Release.Namespace }}
/{{ template "traefik.fullname" . }}"
- apiGroups:
- extensions
resources:
- ingresses/status
verbs:
- update
I can also open a PR with those changes to the official chart, not sure if this is planned to be added. |
i tried @amalucelli solution as well as all the google results i could find but the status is not populated and therefore the ingress status stays at initializing. i think the problem is, that the services do not have a public ip (this is a test setup, no cloud provider, no external dns, all private ips). the ip address of the node the load balancer is running on is 10.2.2.20, but it is not set anywhere in the ingress object or traefik. |
same problem as alex-s-team |
We tried @amalucelli solution as well, but are still facing the same problem
|
This issue has been closed for almost 6 months. If you are encountering issues, please open a new issue instead of bumping a long-closed feature request. Thanks! |
Actually I'm using the image: traefik
imageTag: v1.7.2
rbac:
enabled: true
metrics:
prometheus:
enabled: true
kubernetes:
ingressEndpoint:
publishedService: "traefik/traefik"
ssl:
enabled: true |
wondering if anyone has this working without helm. like the op, i am using a daemonset yaml to get traefik going. hoping to get the config to add and get this going. |
Same here, using the DaemonSet YAML example with NET_BIND_SERVICE on a single node bare-metal installation and would really like to see that status populated. |
helm chart only generates the proper configuration, see |
Same issue, anyone discover something new ? |
@reymonlu For me it was just the missing RBAC permissions when using the provided DaemonSet. |
@rbq Thanks for your answer. I updated RBAC permisssions too but ingress rules still on "initializing"... |
@reymonlu Not using a config file, just arguments in the container spec of my DaemonSet: - image: traefik
name: traefik-ingress-lb
ports: [...]
securityContext: [...]
args:
- --api
- --kubernetes
- --kubernetes.ingressendpoint.hostname=www.my-domain.com
- --logLevel=INFO |
@rbq Thank you for that. I have some difficulties to understand this point of [KubernetesIngressEndPoint]. |
@reymonlu I'm actually not sure about the exact purpose of this field. Maybe it's a fallback for a default Ingress w/o host configuration? |
Currently (as of
v1.4.0-rc3
) traefik does not update the ingressstatus.loadBalancer
field to anything. This makes it difficult to auto-assign DNS (such as kubernetes external-dns). Other Kubernetes ingress controllers update this field (see theupdate-status
flag on the nginx controller)The Kuberentes
LoadBalancerIngress
displays either ahostname
or anip
field consisting of a single string value. It would be fantastic to have a Configuration option to specify the value to update managed ingress rules with. A user-configurable flag like--kubernetes.ingressEndpoint.ip
or--kubernetes.ingressEndpoint.hostname
.Do you want to request a feature or report a bug?
Feature
What did you do?
my-ingress.yaml
What did you expect to see?
What did you see instead?
Output of
traefik version
: (What version of Traefik are you using?)What is your environment & configuration (arguments, toml, provider, platform, ...)?
Deployed in Kubernetes via daemonset
# No config file used
If applicable, please paste the log output in debug mode (
--debug
switch)The text was updated successfully, but these errors were encountered: