Skip to content
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: Allow specifying hostAliases for Knative Services #9415

Closed
emaildanwilson opened this issue Sep 15, 2020 · 7 comments · Fixed by #10301
Closed

Feature Request: Allow specifying hostAliases for Knative Services #9415

emaildanwilson opened this issue Sep 15, 2020 · 7 comments · Fixed by #10301
Labels
kind/feature Well-understood/specified features, ready for coding.

Comments

@emaildanwilson
Copy link
Contributor

Allow specifying hostAliases for Knative Services

In our environment we use hostAliases for a few different use cases and it would be nice to be able to provide the same functionality on knative.

use case 1 - internal routing of external services when they are also hosted locally

When an externally facing service is also hosted locally, we prefer to connect to the local service directly but still using the external address names which provide the following benefits:

  • maintains a single endpoint name for internal and external access
  • allows us to have a single tls certificate for accessing the service
  • routes traffic directly to the service instead of going out of the cluster to hit the external service endpoint

In order to make this work we use hostAliases to provide the internal address of the service, overriding the external dns entry to the running container.

use case 2 - accessing service entries which don't have dns entries.

Istio allows the creation of ServiceEntries, which represent service registry data for virtual services which are either internal to or external to the cluster. You can then create other Istio objects to control the routing behavior, destination services, load balancing, etc. to these endpoints. In some cases, we use endpoints which don't actually exist in DNS for the service entries and since Istio is providing the destination information dynamically the actual IP provided doesn't really matter but a DNS record needs to exist just so the application can initiate the network call which is intercepted by the sidecar proxy.

We use hostAliases to create valid dns records so the traffic can reach the sidecar and get routed.
Maintaining an extra DNS service for this is extra overhead and adds a potential failure point. (the issue is always dns, right?)


I propose that we add a feature gate to Knative which will allow specifying hostAliases for knative services in the container spec with a default of disabled. One question though, are there other container networking features that should be included in the same feature gate like dnsPolicy and hostNetwork?

I can contribute the PR if this change is acceptable.

@emaildanwilson emaildanwilson added the kind/feature Well-understood/specified features, ready for coding. label Sep 15, 2020
@nak3
Copy link
Contributor

nak3 commented Sep 28, 2020

hostAliases was discussed before in #6207.

tag to @dprotaso @mattmoor if any update.

@mattmoor
Copy link
Member

Is this covered by the DomainMapping work that @julz has been looking into?

@emaildanwilson
Copy link
Contributor Author

@julz - I don't have access to the Feature Proposal doc referenced in #9713.
Is this use case included in that work or not?

@julz
Copy link
Member

julz commented Oct 21, 2020

Hi @emaildanwilson, you should be able to get access to the doc by joining the knative-users@ google group. Let me know if that doesn't work or you're already a member and I'll try to figure out what's going wrong!

@emaildanwilson
Copy link
Contributor Author

thank you. I reviewed the doc and it seems to solve for ingress specific domain routing as opposed to egress. The reason we need hostAliases is to assist with egress calls from within a running pod for a knative service.

@emaildanwilson
Copy link
Contributor Author

Since this isn't covered in the domain mapping proposal is it ok to add a feature toggle for it?

@dprotaso
Copy link
Member

dprotaso commented Oct 30, 2020

Since this isn't covered in the domain mapping proposal is it ok to add a feature toggle for it?

I think so - I'll add this to next week's API WG agenda for a discussion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Well-understood/specified features, ready for coding.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants