What keywords did you search in NGINX Ingress controller issues before filing this one? (If you have found any duplicates, you should instead reply there.):
Is this a BUG REPORT or FEATURE REQUEST? (choose one):
FEATURE REQUEST
NGINX Ingress controller version:
all the version
Kubernetes version (use kubectl version):
N/A
What happened:
In our environment, ingress controller is deployed as a daemonset in a host group and using host port. A VIP manager or loadbalancer is sitting in front of the host group as the HA solution for user to access the ingress controller externally.
It is expected to show the IP address or domain name of the VIP manager or boadbalancer as the ADDRESS in ingress resource.
However the current ingress controller only support
What you expected to happen:
Introduce a new command line parameter to allow user customizing the ADDRESS, so that ingress controller just use the ADDRESSuser specified.
/cc @aledbf
@luckyfengyong you can achieve this using the flag --update-status=false in the deployment and updating the ingress status with the IP of your VIP manager.
Please keep in mind that this will be only informative and is not going to reflect where the Ingress controller pod it is running.
Closing. Please reopen if you have more questions
@aledbf Thanks for the suggestion. Just try to understand, do you mean that user could manually update the IngressStatus, after ingress resource is created?
If that is the case, creating an ingress resource involves two steps 1) create the resource 2) update the IngressStatus.
It will be much more convenient, if we could leverage the update-status of ingress controller to configure it automatically.
@aledbf so if I set --update-status=false, how can I update the ADDRESS with my vip manager? I need to write some plug-in for ingress to do this?
@aledbf Thanks for the suggestion. Just try to understand, do you mean that user could manually update the IngressStatus, after ingress resource is created?
Yes
If that is the case, creating an ingress resource involves two steps 1) create the resource 2) update the IngressStatus.
You don't need an update, just create the ingress with the status field populated.
@aledbf so if I set --update-status=false, how can I update the ADDRESS with my vip manager? I need to write some plug-in for ingress to do this?
You can use kubectl patch, no need to write a controller for that.
@aledbf I tried the solution. After running ingress controller with --update-status=false. I create an ingress resources as follows.
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: test-ingress
namespace: default
spec:
backend:
serviceName: open-liberty
servicePort: 9080
status:
loadBalancer:
ingress:
- ip: 1.1.1.1
The ingress resource does not have ADDRESS associated
NAME HOSTS ADDRESS PORTS AGE
test-ingress * 80 3s
It seems user cannot create ingress resource with ADDRESS/HOSTS specified.
/cc @aledbf ^^^
@luckyfengyong ok, it seems is not possible to do this using kubectl https://github.com/kubernetes/kubernetes/blob/master/pkg/registry/extensions/ingress/strategy.go#L45
Thanks for the info. @aledbf
For that case, do you think it is a valid requirement to allow ingress controller retrieve its endpoint from user specified parameter?
@luckyfengyong no because that is not part of the Ingress spec and the ingress controller "just" reads Ingress rules. When you create the rules the status is removed in the api server
@aledbf But ingress controller also has the responsibility to update the endpoint of the ingress resource into the status. For nginx ingress controller, the endpoint of the ingress resource is actually the endpoint of the nginx ingress controller.
Currently the nginx ingress controller try to figure out its endpoint based on the hints provided by admin, for example the service of ingress controller deployed in kubernetes cluster.
The user specified endpoint of ingress controller is also a kind of hints.
Can we enhance runningAddresses() to return the endpoint admin specified?
@aledbf Is it OK to reopen the ticket?
Thanks @aledbf What about the proposal in https://github.com/kubernetes/ingress-nginx/issues/2067#issuecomment-365108709? We could submit a PR for it.
The runningAddresses() was only called when sync up, and it still depends on status, how about adding an annotation for this?
If we add this feature it must be behind a flag. If we add an annotation then we are allowing multiple IPs.
Yes, the proposal is to add a flag just like --publish-service. The flag could be --publish-address
What you expected to happen:
Introduce a new command line parameter to allow user customizing the ADDRESS, so that ingress controller just use the ADDRESSuser specified.
@aledbf any comment on above proposal?
@luckyfengyong to avoid confusion please use --publish-status-address
I will work on this.