1
0
Fork 0
Commit Graph

15 Commits (b27d10a94f2d4066396b59a1b6503b40c7a08f87)

Author SHA1 Message Date
Dustin dbbe23aaa5 cert-manager: Add role for Jenkins to access certs
Ansible playbook running as Jenkins jobs need to be able to access the
Secret resources containing certificates issued by _cert-manager_ in
order to install them on managed nodes.  Although not all jobs do this
yet, eventually, the _cert-exporter_ will no longer be necessary, as the
_certs.git_ repository will not be used anymore.
2025-07-21 12:24:00 -05:00
Dustin 4106038fe9 cert-manager: Use recursive resolver for checks
I've completely blocked all outgoing unencrypted DNS traffic at the
firewall now, which prevents _cert-manager_ from using its default
behavior of using the authoritative name servers for its managed domains
to check poll for ACME challenge DNS TXT record availability.
Fortunately, it has an option to use a recursive resolver (i.e. the
network-provided DNS server) instead.
2025-06-21 13:55:23 -05:00
Dustin 7da76d0615 cert-manager: Update to v1.16.4
Fixes for Cloudflare DNS API changes.
2025-02-14 18:27:31 -06:00
Dustin 2b6830f131 cert-manager: Configure ACME DNS.01 for dch-ca
Since transitioning to externalIPs for TCP services, it is no longer
possible to use the HTTP.01 ACME challenge to issue certificates for
services hosted in the cluster, because the ingress controller does not
listen on those addresses.  Thus, we have to switch to using the DNS.01
challenge.  I had avoided using it before because of the complexity of
managing dynamic DNS records with the Samba AD server, but this was
actually pretty to work around.  I created a new DNS zone on the
firewall specifically for ACME challenges.  Names in the AD-managed zone
have CNAME records for their corresponding *_acme-challenge* labels
pointing to this new zone.  The new zone has dynamic updates enabled,
which _cert-manager_ supports using the RFC2136 plugin.

For now, this is only enabled for _rabbitmq.pyrocufflink.blue_.  I will
transition the other names soon.
2024-12-09 17:58:43 +00:00
Dustin 4ad5518f18 cert-manager: Migrate config to configMapGenerator 2024-11-05 07:04:09 -06:00
Dustin b366532c88 cert-manager, step-ca: Bypass cluster DNS
Having name overrides for in-cluster services breaks ACME challenges,
because the server tries to connect to the Service instead of the
Ingress.  To fix this, we need to configure both _cert-manager_ and
_step-ca_ to *only* resolve names using the network-wide DNS server.
2024-07-29 20:58:18 -05:00
Dustin e56a38c034 cert-manager: Add dch-ca issuer
In-cluster services can now get certificates signed by the DCH CA via
`step-ca`.  This issuer uses ACME with the HTTP-01 challenge, so it
can only issue certificates for names in the _pyrocufflink.blue_ zone
that point to the ingress controllers.
2024-07-26 20:59:00 -05:00
Dustin 989556d458 cert-manager: Update to v1.14.5 2024-07-14 15:14:44 -05:00
Dustin 9784b90743 cert-manager: Remove unused secrets
These secrets were used by previous issuers/solvers and are no longer
needed.
2024-02-16 20:56:08 -06:00
Dustin fbf2a6864f cert-manager: cert-exporter: Static SSH host keys
The *cert-exporter* script really only needs the SSH host key for Gitea,
so the dynamic host key fetch is overkill.  Since it frequently breaks
for various reasons, it's probably better to just have a static list of
trusted keys.
2024-01-04 15:35:00 -06:00
Dustin c5d0052ed3 cert-manager: Add DNS.01 solver using Cloudflare
Using *acme-dns.io* is incredibly cumbersome.  Since each unique
subdomain requires its own set of credentials, the `acme-dns.json` file
has to be updated every time a new certificate is added.  This
effectively precludes creating certificates via Ingress annotations.

As Cloudflare's DNS service is free and anonymous as well, I thought I
would try it out as an alternative to *acme-dns.io*.  It seems to work
well so far.  One potential issue, though, is Cloudflare seems to have
several nameservers, with multiple IP addresses each.  This may require
adding quite a few exceptions to the no-outbound-DNS rule on the
firewall.  I tried using the "recursive servers only" mode of
*cert-manager*, however, as expected, the recursive servers all cache
too aggressively.  Since the negative cache TTL value in the SOA record
for Cloudflare DNS zones is set to 1 hour and cannot be configured, ACME
challenges can take at least that long in this mode.  Thus, querying the
authoritative servers directly is indeed the best option, even though it
violates the no-outbound-DNS rule.
2023-05-09 21:13:08 -05:00
Dustin a507fe1090 cert-manager: Switch to acme-dns
Using the local name server as the authoritative server for ACME
challenge records turned out to be quite problematic.  For some reason,
both Google and Cloudflare kept returning SERVFAIL responses for the
*_acme-challenge* TXT queries.  I suspect this may have had something to
do with how BIND was configured to be the authoritative server for the
*o-ak4p9kqlmt5uuc.com* while also being a recusive resolver for clients
on the local network.

Using *acme-dns.io* resolves these issues, but it does bring a few of
its own.  Notably, each unique domain and subdomain must have its own
set of credentials (specified in the `acme-dns.json`) file.  This makes
adding new certificates rather cumbersome.
2023-05-01 20:57:24 -05:00
Dustin 7a27855e51 cert-manager: Add cert-exporter CronJob
The `cert-exporter` tool fetches certificates from Kubernetes Secret
resources and commits them to a Git repository.  This allows
certificates managed by *cert-manager* to be used outside the Kubernetes
cluster, e.g. for services running on other virtual machines.
2023-05-01 20:57:22 -05:00
Dustin e3d9fc2489 cert-manager: Add Pyrocufflink wildcard cert
The wildcard certificate for the *pyrocufflink.net* and
*pyrocufflink.blue* domains is now handled by *cert-manager* and saved
to *certs.git* by `cert-exporter.
2023-05-01 20:57:01 -05:00
Dustin 5e251153c7 cert-manager: Install cert-manager
*cert-manager* manages certificates.  More specifically, it is an ACME
client, which generates certificate-signing requests, submits them to a
certificate authority, and stores the signed certificate in Kubernetes
secrets.  The certificates it manages are defined by Kubernetes
Custom Resources, either defined manually or automatically for Ingress
resources with particular annotations.

The *cert-manager* deployment consists primarily of two services:
*cert-manager* itself, which monitors Kubernetes resources and manages
certificate requests, and the *cert-manager-webhook*, which validates
Kubernetes resources for *cert-manager*.  There is also a third
component, *cainjector*, we do not need it.

The primary configuration for *cert-manager* is done through Issuer and
ClusterIssuer resources.  These define how certificates are issued: the
certificate authority to use and how to handle ACME challenges.  For our
purposes, we will be using ZeroSSL to issue certificates, verified via
the DNS.01 challenge through BIND running on the gateway firewall.
2023-05-01 20:22:35 -05:00