Open Just-Insane opened 4 years ago
One way to do this already now:
ingress.tls.source
to secret
tls-rancher-ingress
in the cattle-system
namespaceapiVersion: cert-manager.io/v1alpha2
kind: Certificate
metadata:
name: tls-rancher-ingress
namespace: cattle-system
spec:
secretName: tls-rancher-ingress
commonName: rancher.example.com
dnsNames:
- rancher.example.com
issuerRef:
name: letsencrypt-prod
kind: ClusterIssuer
---
apiVersion: cert-manager.io/v1alpha2
kind: ClusterIssuer
metadata:
name: letsencrypt-prod
spec:
acme:
server: https://acme-v02.api.letsencrypt.org/directory
email: mail@example.com
privateKeySecretRef:
name: letsencrypt-prod
solvers:
- dns01:
digitalocean:
tokenSecretRef:
key: access-token
name: digitalocean-credentials-secret
---
apiVersion: v1
data:
access-token: <base64 encoded token>
kind: Secret
metadata:
name: digitalocean-credentials-secret
namespace: cert-manager
type: Opaque
Will this automatically renew the certificate using very-manager?
Yes, cert-manager will handle the renewal.
So...is this supported now?
In the case that you already have cert-manager and a working DNS-01 ClusterIssuer, --set ingress.extraAnnotations.cert-manager\.io/cluster-issuer=yourClusterIssuerName
works fine (at least for me):
helm install rancher rancher-latest/rancher \
--namespace cattle-system \
--set hostname=rancher.example.com \
--set bootstrapPassword=admin \
--set ingress.tls.source=secret \
--set ingress.extraAnnotations.cert-manager\.io/cluster-issuer=yourClusterIssuerName
In the case that you already have cert-manager and a working DNS-01 ClusterIssuer,
--set ingress.extraAnnotations.cert-manager\.io/cluster-issuer=yourClusterIssuerName
works fine (at least for me):helm install rancher rancher-latest/rancher \ --namespace cattle-system \ --set hostname=rancher.example.com \ --set bootstrapPassword=admin \ --set ingress.tls.source=secret \ --set ingress.extraAnnotations.cert-manager\.io/cluster-issuer=yourClusterIssuerName
This works, though maybe it should be documented or even better be flagged out from secret in the chart.
Make sure to set ingress parameter with quotation marks like --set ingress.extraAnnotations.'cert-manager\.io/cluster-issuer'=issuer-name
What kind of request is this (question/bug/enhancement/feature request): Feature Request
It would be nice to have support for DNS-01 challenge requests for LetsEncrypt during Rancher install.
Use Case:
1) Security - Would not have to expose Rancher to the internet directly in order to get a valid certificate, this increases overall security and limits the attack surface.
2) Security - Using wildcard certificates obscures the names of (potentially) internal services from showing up in certificate transparency logs, which is mostly security through obscurity, but could be useful in some cases.
3) Convenience - DNS-01 is more convenient to use since it doesn't require changing firewall rules, something which can be an issue for businesses.
Alternatively, provide documentation on changing cert-manager and rancher to use a certificate from DNS-01 issuer.
gz#13082