0
votes

There are two parts to this.

  1. I am using kops v1.17.0 to standup kubernetes cluster on ec2 instances. I am followinf these docs for doing so. https://kubernetes.io/docs/setup/production-environment/tools/kops/

on of the points go as follows.

kops has a strong opinion on the cluster name: it should be a valid DNS name.

this got me confused. Can my cluster serve requests to only one DNS and its subdomains?

  1. I tried this on a domain example.com I created a hosted zone for it. created a cluster named example.com.k8s.local.

I pointed this domain to my clusters load balancer. and I can access example.com. All good till now.

now, I want one of the services in my cluster to be served on abc.com. I created another hosted zone, and a new record set within it which points to this load balancer. I am expecting to visit abc.com and see this service but all I see is nginx 404 not found

Is this happening because of the first point I mentioned or totally separate issue? If it is because of 1st point is there aa way around or one cluster is always tied to one domain in the kops world?

1
From what I see in documentation the answer here is the first point you mentioned, if you have domain example.com then instead of abc.com you should use, for example, dev.example.com as a subdomain, could you try it with your nginx and let me know if it works? About the follow up question, I don´t think there is a workaround for that, atleast I couldn´t find anything about that in documentation.Jakub
@jt97 contd. in answer.Ojas Kale

1 Answers

1
votes

As far as the first part is concerned, Yes I can serve multiple domains from same kubernetes cluster with this setup. upto certain version there was a hard requirement of matching domain name with cluster name, its not the case anymore.

Couple of things you need to consider. while issuing a certificate from ACM, make sure all your domains are listed

example

example.com
*example.com
bar.com
*.bar.com

make sure that all of the domains are validated and are not in pending or any other state.

I think reason for second issue was one of the domains in my certificate generated by ACM was invalid state and thus in pending state.

@jt97 ^^