-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Mapping ExternalNames to custom ports #3231
Conversation
Actually, there is an issue with this PR. When defining the Kubernetes Service, each port must have a different name. In other words, we cannot declare: apiVersion: v1
kind: Service
metadata:
name: myservice
spec:
type: ExternalName
externalName: myserver.acme.com
ports:
- name: https
port: 8443
- name: https
port: 9090 Kubernetes will choke on the second port upon creation. How about we use the following naming convention: ports:
- name: https
port: 8443
- name: https-icws
port: 9090 The code would instead of comparing What do you guys think? |
WDYT @containous/kubernetes ? |
I can get behind checking to see if the port name has an 👍 |
It would also be very easy to change the PR from (https://github.com/gildas/traefik/blob/83629789f5a7eed8f13ff0715983efd16ce73a30/provider/kubernetes/kubernetes.go#L273): if port.Port == 443 || port.Name == "https" to: if port.Port == 443 || strings.HasPrefix(port.Name, "https") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
ping @timoreimann |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the feature! 👍
This is merged to master but still doesn't appear to be in any of the traefik releases. What is the typical path forward to get something like this included in a release? |
@billimek the milestone indicates that the PR will be part of Traefik 1.7. Thus, the next release will include the feature. |
What does this PR do?
This fixes issue #1816
Basically, if the
servicePort.Port
is not 443 or 80, we add it to the url (not the name).And if the
servicePort.name
is "https" we also use "https" as the protocol. That allows to proxy https traffic to any port.Motivation
In my deployment, I need træfik to proxy to external servers on custom ports. I do not control these servers.
More