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

It is assumed that configured cluster domain is always "cluster.local" #402

Open
adrianlzt opened this issue Oct 23, 2022 · 7 comments
Open
Labels
NeedsMoreData Waiting for additional user feedback or case studies

Comments

@adrianlzt
Copy link
Contributor

adrianlzt commented Oct 23, 2022

What happened?

Under some circumstances, Pomerium could configure the destination endpoint with the format BACKEND.NAMESPACE.svc.cluster.local.

This is assuming the cluster domain is always cluster.local, that could be not the case. In Kubspray, for example, you can change that value with cluster_name.

What did you expect to happen?

cluster.local should be a parametrizable value, or, maybe, it could be removed.

If it is removed, BACKEND.NAMESPACE.svc will be tried to be resolved, appending the values in the search domains of the /etc/resolv.conf. But I am not sure if all k8s installs set the needed search values (at least it will need search DOMAIN, like search cluster.local).

The official doc shows an example of the possible /etc/resolv.conf configuration, but in the spec there is no reference about if some search values should be always be present.

I have checked in a Kubespray install and GKE cluster they are present.

Additional context

Related with PR #401

@wasaga
Copy link
Collaborator

wasaga commented Oct 24, 2022

Currently, endpoints are selected by default, one would have to apply 'use_service_proxy' annotation to the ingress in order to enable that mode.

We may probably have another annotation 'service_proxy_domain', that would default to 'svc.cluster.local'.

@adrianlzt
Copy link
Contributor Author

In fact I found this error because endpoint selection was not working (#400).

Endpoints will be used also if protocol is https, right?

} else if ic.IsSecureUpstream() && r.TlsServerName == "" {

@wasaga
Copy link
Collaborator

wasaga commented Oct 25, 2022

Endpoints will be used also if protocol is https, right?

yes

@adrianlzt
Copy link
Contributor Author

Sorry, I meant that the URL with cluster.local is used if protocol is https:

r.TlsServerName = fmt.Sprintf("%s.%s.svc.cluster.local", backend.Name, ic.Namespace)

@wasaga
Copy link
Collaborator

wasaga commented Oct 25, 2022

As endpoints are just IP addresses, we need figure out TLS server name, thus it's another place where we try to guess FQDN of a service.

Do you want to update your PR and add an (optional) annotation to customize the service FQDN suffix to be something different from 'cluster.local' (the default) ?

@adrianlzt
Copy link
Contributor Author

What about removing it completely and relaying in the search of resolv.conf?

@wasaga
Copy link
Collaborator

wasaga commented Oct 25, 2022

although this is true for Kubspray and GKE, there is no assurance from the spec this is a guaranteed.

To be on the safe side and avoiding breaking someone's installation and do an emergency release, I'd prefer it to be a config option instead.

we may also put it into the global CRD, so that it would become a global option, but that would be more involved as it would require a CRD version bump.

@desimone desimone added the NeedsMoreData Waiting for additional user feedback or case studies label Oct 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsMoreData Waiting for additional user feedback or case studies
Projects
None yet
Development

No branches or pull requests

3 participants