By ratnautilman
Hi,
I am following https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nginx-ingress-with-cert-manager-on-digitalocean-kubernetes#step-5-—-enabling-pod-communication-through-the-load-balancer-(optional) to setup TLS in my cluster. I have 2 host names web.myapp.com and api.myapp.com I want to have both of these subdomains to be added in my nginx annotation.
service.beta.kubernetes.io/do-loadbalancer-hostname
I cant give comma seperated as it is throughing below warnings:
Warning SyncLoadBalancerFailed 4s (x2 over 9s) service-controller Error syncing load balancer: failed to update load balancer status: Service "ingress-nginx-controller" is invalid: status.loadBalancer.ingress[0].hostname: Invalid value: "web.myapp.co.za,api.myapp.co.za": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')
Thanks in advance
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi @ratnautilman,
Having the LB hostname annotation on a service is solely used for getting around internal routing issues as specified in our docs: Accessing by Hostname :: How to Configure Advanced Load Balancer Settings in Kubernetes Clusters
As long as your multiple hostnames resolve to the LB in question and a single hostname is set using the annotation, you will not experience the issue described in the docs link above. Other than the bug listed in the docs, there is no technical reason to need to specify this annotation for more than one hostname.
Hope this helps!
Regards,
John Kwiatkoski Senior Developer Support Engineer - Kubernetes
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.