Hello Chris,
thanks a lot. I solved the issue in a less elegant way by defining a second ingress resource for the www.domain as it was not clear to me that I could simply specify multiple rules:host
I was playing around with nginx.ingress.kubernetes.io/from-to-www-redirect: āātrueāā and added both hosts to the tls:hosts section unfortunately without success, as for the host not given under rules:host a wrong certificate was supplied instead of the one from letsencrypt.
I now assume your option is smarter as it solves the same issue with a single ingress and a common letsencrypt certificate.
Anyway, I am now wondering about how things work in Rancher internally and what my approach really costs my means of processing overhead. Did I understand correctly, that the ingress resources are not more than just configurations which are merged together as a configuration for the system/nginx-ingress-controller which is the actual pod responsible for routing/programming of a single load balancer per node? Or is each ingress to be understood as a separate workload running in the background? Hence, would my previous approach mean that two ingresses denote two running pods and with it additional overhead?
And there is a further topic I am wondering about. The yaml for the ingress you define looks quite comprehensible. If I compare it with the yaml, which is generated for the ingress when using the Rancher UI, I see lots of other stuff in there like
field.cattle.io/creatorId: user-r5b72
field.cattle.io/ingressState: '{"bXkuZGUtY3J0":"default:my-diary.de-crt","bmd5LmRlLy8vODA=":""}'
field.cattle.io/publicEndpoints: '[{"addresses":["185.163.100.11"],"port":443,"protocol":"HTTPS","serviceName":"default:nginx","ingressName":"default:nginx-ingress","hostname":"my-diary.de","path":"/","allNodes":true}]'
kubernetes.io/tls-acme: '"true"'
creationTimestamp: ā2019-10-21T17:23:24Zā
generation: 4
labels:
cattle.io/creator: norman
name: nginx-ingress
namespace: default
resourceVersion: ā396564ā
selfLink: /apis/extensions/v1beta1/namespaces/default/ingresses/nginx-ingress
uid: 732fd20c-dc06-4264-ae0d-dc0f65249fbc
Now I am wondering if I do not need all the other stuff that is generated, hence if it is better to work with the rancher ui to get these additional annotations in.
From a repeatability point of view and by means of understandability I would prefer to use sleek yaml files like the one you provided. I think that way I might also be able to use those charts to automate creation of a cluster. So can you comment on what way I should prefer to use, go with RancherUI as I would miss out a lot of preset configuration, or go with manual made charts as the other stuff is not needed or created in the background anyway?
Thanks for the explanation!
Best regards,
Christoph