Open ibotty opened 8 years ago
I am thinking about the following plan.
at least until PalmStoneGames/kube-cert-manager#20 is implemented.
Perhaps use dns challenge instead? This would remove the need of proxy'ing the standard acme-challenge.
Have you considered using a modified router image to handle the /.well-known/acme-challenge path globally? It should be possible to use a custom haproxy-config.template to route challenge requests to a handler running in the default namespace either for every route, or limited to routes with a particular label.
The template can actually be replaced without modifying the image too afaik:
I was considering having a hack at it, but thought I'd check in case you'd considered it already and discounted it for good reasons.
I did consider it, but dismissed it. My main argument is that it makes it non-standard and that it's not possible to compose changes to the router template (most of my clients already run a modified template). If you would like to have a go, please do. But keep the following in mind:
The namespace check can be disabled. (At least for Openshift Origin 1.5) Of course you should only do that if you trust all your users or make sure they can't create routes on there own.
Simple set ROUTER_DISABLE_NAMESPACE_OWNERSHIP_CHECK=true on your router deployment or create your create with the --disable-namespace-ownership-check flag.
https://docs.openshift.org/latest/architecture/core_concepts/routes.html#disable-namespace-ownership-check https://github.com/openshift/origin/commit/d2dd4668c37281f5b12caf6edfa10c4ec8933693
I meant, that you could circumvent that check when deploying a template including explicit .well-known/acme-challenge.
There can't be routes with the same hostname in different namespaces. That leaves two options for serving the well-known routes (
webserver
).Integrated Webserver
It has the following big downside: It can't work with multiple namespaces. You'll have to deploy one instance, one service account, one acme credential and set the service account's permissions for every namespace.
It does only use one pod with three containers per namespace though and is conceptional easy.
Separated Webserver
I can think of the following options.
cron
does use one per namespace, that is feasible.Both will slow down certificate deployments considerable (scheduling, pulling, starting the webserver pod).
I tend to favor a separated webserver and on-demand spawning. Opinions welcome!