Hi Team, We need to add multiple hostnames for on...
# gooddata-cn
p
Hi Team, We need to add multiple hostnames for one organization. However, the current setup for ingress only allows a single hostname entry. Is there a way to add multiple hostname entries? For ref: https://www.gooddata.com/developers/cloud-native/doc/1.7/administration/organization/setup-organizations/ If yes, please provide the steps to follow. Regards, Prashant
j
Hi Prashant, may I kindly ask you for explanation of use case behind? Why you need to access the same organization "through" multiple DNSes?
p
Hi @Jan Soubusta, We are managing our domains through CNAME records in Cloudflare. There we need to map the external domain with an internal domain. And both these domains should be mapped in ingress as hosts. Regards, Prashant
j
@Robert Moucha any thoughts/recommendations regarding this requirement?
r
GoodData.CN supports only one hostname per organization. Maybe I don't understand your setup correctly, but I assume the "external domain" is actually the organization hostname, as entered by users to web browser. I don't know how what is the "internal domain" and how is involved in the process. Do you want to allow people to access GoodData by "internal" and "external" domains?
p
Hi @Robert Moucha, Yes, the External domain will be the organization hostname that will be used by users. However, for that to work we need to set-up CNAME record in our Cloudflare. And in that CNAME record, that external domain needs to have an alias (which we mentioned earlier as the internal domain). Now both these (external domain and its alias) should be mapped as hosts in the organization ingress. So our requirement is that we should be able to map two routes in one organization ingress. Is there a way we can achieve that?
r
As I wrote, GoodData supports only one hostname per organization. If the external domain is a CNAME pointing to other "internal domain" (or alias), this alias must also be resolvable to IP address (so it must have its
A
record in your DNS). If the internal domain is resolvable to IP by users and the IP address is accessible, then accessing external domain will seamlessly translate the request to internal domain and then to its IP address. Web browser will pass the original external domain to Ingress controller within the
Host:
header and GoodData.CN will recognize the Organization by this hostname. There's no need to explicitly enable the internal domain within Gooddata, unless you need your users to access it using the internal domain. Example:
Copy code
<http://external.domain.com|external.domain.com>.      CNAME   <http://internal.cloudflare.net|internal.cloudflare.net>.
<http://internal.cloudflare.net|internal.cloudflare.net>.  A       10.20.30.40
Access to
<https://external.domain.com/>
will work (assuming that this domain is defined as Organization's hostname) because browser will translate it to IP 10.20.30.40. On the other hand, accessing
<https://internal.cloudflare.net/>
will NOT work despite the fact the browser will access the very same IP address, but this hostname is not defined (and can not be defined) as a second hostname of the same organization.
p
Hi @Robert Moucha, 1. Should we set external.domain.com as a route in the ingress i.e. spec.hostname in the organization controller? 2. We tried doing the same. Our domain is getting resolved as well. However we are getting the error: {"title":"Not Found","status":404,"detail":"404 NOT_FOUND \"No Organization found for hostname 'external.domain.com'\"; nested exception is errorType=com.gooddata.tiger.common.exception.NotFoundException, message=No organization found for hostname external.domain.com","traceId":"12b70ba8e6a069eb"} Kindly help on the same. Regards,
r
Yes, this is exactly as it is supposed to work - create
Organization
custom resource with spec.hostname set to external.domain.com, load it to kubernetes. Internal component called organization-controller will process the incoming Organization resource and creates its respective organization and Ingress (called
managed-<<organization-id>>
, where organization-id is value from metadata.name. Ingress controller is responsible for routing requests for this hostname to internal services. Based of the error message you sent, the Ingress routing works fine but the the organization's hostname is wrong in metadata-api component. It probably happened when you tried to change spec.hostname after creation of the Organization custom resource. This operation is not supported in version 1.7.2 and below, but will be supported in the upcoming 2.0.0 release. A workaround exists - delete Organization resource (
kubectl delete org organization-id
), make sure the
managed-<<organization-id>>
was removed, and create Organization again with a proper hostname (
kubectl apply -f file-with-org-resource.yaml
). Please let me know if it helped.
n
Thanks @Robert Moucha for your response. We did try to change the spec.hostname. We could see host changed in ingress controller also. So that is not supported? We will try the delete and create as well and revert here.
r
Right, this is not supported in in 1.7.2. The next major version 2.0.0 will resolve this limitation.
👍 1