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

cluster-only service's URL might not be right #4204

Closed
duglin opened this issue May 31, 2019 · 10 comments · Fixed by #4615
Closed

cluster-only service's URL might not be right #4204

duglin opened this issue May 31, 2019 · 10 comments · Fixed by #4615
Assignees
Labels
area/networking kind/bug Categorizes issue or PR as related to a bug.
Milestone

Comments

@duglin
Copy link

duglin commented May 31, 2019

In what area(s)?

/area networking

What version of Knative?

0.6.0

Issue

I created an internal only service via:

apiVersion: serving.knative.dev/v1alpha1
kind: Service
metadata:
  name: echo-internal
  labels:
    serving.knative.dev/visibility: cluster-local
spec:
  runLatest:
    configuration:
      revisionTemplate:
        spec:
          container:
            image: duglin/echo

I also modified by domainTemplate to use - instead of . between the service name and the domain name.

When I look at the status section of this service I see this (removed the noise):

status:
  address:
    hostname: echo-internal.default.svc.cluster.local
    url: http://echo-internal.default.svc.cluster.local
  domain: echo-internal-default.svc.cluster.local
  domainInternal: echo-internal.default.svc.cluster.local
  url: http://echo-internal-default.svc.cluster.local

First, some questions:

  • why are there so many fields that appear to be duplicates? E.g. do we need address.hostname and domainInternal ?
  • url appears to be new for v0.6 - why is it needed? It seems a bit odd to assume that http is the preferred protocol. Why not just have the hostname and let the user decide if they want to use http or https?
  • can we be more consistent on the use of "domain" vs "hostname" ? Personally, I prefer "hostname" but either way we should be consistent - not just here but then in other places like our configMaps (e.g. domainTemplate).

The issue:

  • notice domain: echo-internal-default.svc.cluster.local and url: http://echo-internal-default.svc.cluster.local both use - in the url so I'm assuming these are meant to be externally facing URLs, however this is an internal only service.
  • should these fields be empty?

/cc @ZhiminXiang @tcnghia

@duglin duglin added the kind/bug Categorizes issue or PR as related to a bug. label May 31, 2019
@markusthoemmes
Copy link
Contributor

markusthoemmes commented May 31, 2019

  • Both domain and domainInternal are deprecated. I think you can just disregard them at this point. We cannot simply delete them though, for backwards compatibility.
  • address implements the Addressable interface to provide interop with for example Knative Eventing.
  • The URL contains the scheme to signify which scheme should be used to talk to the service. Not every service might support both HTTP and HTTPS. Services which have a provisioned cert for example can be assumed to support HTTPS.

@duglin
Copy link
Author

duglin commented May 31, 2019

@markusthoemmes thanks. Why do we need to include a scheme at all since it might not even support http?

@markusthoemmes
Copy link
Contributor

@duglin We require to support HTTP, don't we (today at least)? It makes it far easier for a client to decide which URL to hit.

@duglin
Copy link
Author

duglin commented May 31, 2019

Not sure - I'm assuming someone can setup their ingress to only accept https which means the http URL would be incorrect. Would be odd to mandate an insecure connection.

@markusthoemmes
Copy link
Contributor

You're talking about a non-knative managed ingress? That's certainly true, yes. I'll defer to @ZhiminXiang and @tcnghia who are far more knowledgeable on the HTTPS terrain than I am.

@mattmoor
Copy link
Member

mattmoor commented Jun 3, 2019

This seems like a bug in the application of the domain template. @duglin do you want to send a PR?

@duglin
Copy link
Author

duglin commented Jun 3, 2019

need some guidance from @ZhiminXiang @tcnghia first on how things should look

@duglin
Copy link
Author

duglin commented Jun 20, 2019

@ZhiminXiang @tcnghia WDYT?

@ZhiminXiang
Copy link

ZhiminXiang commented Jun 20, 2019

The echo-internal-default.svc.cluster.local in domain and URL field is wrong as it cannot be resolved by k8s DNS server. As a result, it is not reachable within cluster.

For private Knative service, we should not apply DomainTemplate because DomainTemplate is for external host/domain.
We can either discard domain and URL fields for private Knative service or apply the default format {Name}.{Namespace}.svc.cluster.local to them.

@mattmoor mattmoor added this to the Serving 0.8 milestone Jun 25, 2019
@mattmoor
Copy link
Member

We should just elide the DomainTemplate for cluster-local services. @duglin I'm going to assign to you in 0.8.

/assign @duglin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/networking kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants