-
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
IngressRouteTCP object not created when the route is a Service of type ExternalName #6390
Comments
Hi @mazzy89, Could you explain your use case with the ExternalName Service ? |
Sure. The idea here is to expose a resource specifically an Elasticache cluster that is reachable only from the k8s cluster where Traefik runs. The k8s |
There is anything I can help here? This is blocking us to adopt Traefik v2. I'm open to hearing different approaches |
You can specify a port on the Just a comment on your sample, the name of the service referenced in the WDYT ? |
I'm going to try by specifying the port in the I like your idea to use the port of the
Yeah, that is a typo due to a work of removal of real references from the manifests. 🤓 |
Just tried here. Added to the apiVersion: traefik.containo.us/v1alpha1
kind: IngressRouteTCP
metadata:
name: external-tcp-service
spec:
entryPoints:
- redis
routes:
- match: HostSNI(`my-external-service.domain.com`)
services:
- name: external-tcp-service
port: 6379
tls: {}
---
apiVersion: v1
kind: Service
metadata:
name: external-tcp-service
spec:
externalName: internaltcpsrv.domain.local
type: ExternalName
ports:
- port: 6379 The result from Traefik logs
|
@jbdoumenjou I was able to replicate the issue and actually the last one the error is just temporary and due to the order that objects are created. Once swapped the order in the manifest, the errors are not reported anymore and the resources look green in the Traefik dashboard. Need to tests the connection though but at least now Traefik does not complain anymore. It would be nice to have the feature in place. Do you need help here? Will you go ahead or should I give a try? |
Thank you, we are working on it. 😄 |
Thank you for the fast reaction here. |
Closed by #6428. |
Do you want to request a feature or report a bug?
Bug
What did you do?
I've created an object of
kind: IngressRouteTCP
and configured in such way:What did you expect to see?
I would expect that the object
external-tcp-service
would be created.What did you see instead?
level=error msg="Cannot create service: service port not found"
Output of
traefik version
: (What version of Traefik are you using?)What is your environment & configuration (arguments, toml, provider, platform, ...)?
Kubernetes 1.15.9
I believe that the reason is of a bug here https://github.com/containous/traefik/blob/master/pkg/provider/kubernetes/crd/kubernetes_tcp.go#L165
There is an immediate lookup of the port in the
Service
and only after there is a check of the type to verify if theService
istype: ExternalName
.I believe that the logic must be rearranged a bit. I can wire a PR if is needed.
The text was updated successfully, but these errors were encountered: