1
0
Fork 0
Commit Graph

34 Commits (master)

Author SHA1 Message Date
Dustin a02dfa1dfc cert-manager: Decommission cert-exporter
The `cert-exporter` is no longer needed.  All websites manage their own
certificates with _mod_md_ now, and all internal applications that use
the wildcard certificate fetch it directly from the Kubernetes Secret.
2025-09-07 10:31:36 -05:00
Dustin b068a260e7 cert-manager: Drop HLC certificate
This site now obtains its own certificate using Apache _mod_md_.
2025-09-07 10:30:20 -05:00
Dustin 2a0fdc07df cert-manager: Drop dustinandtabitha.com certificate
This site now obtains its own certificate using Apache _mod_md_.
2025-08-11 08:59:57 -05:00
Dustin aa27579582 cert-manager: Drop dustin.hatch.name certificate
This site now obtains its own certificate using Apache _mod_md_.
2025-08-07 11:26:23 -05:00
Dustin 812b09626f cert-manager: Drop chmod777.sh certificate
This site now obtains its own certificate using Apache _mod_md_.
2025-07-28 18:59:06 -05:00
Dustin fac4b92b71 cert-manager: Drop hatch.chat certificate
The _hatch.chat_ Matrix server has been gone for quite some time.
2025-07-23 11:59:28 -05:00
Dustin 81f8c58816 cert-manager: Drop tabitha.biz certificate
This site now obtains its own certificate using Apache _mod_md_.
2025-07-23 11:41:09 -05:00
Dustin 592ff3ce9e cert-manager: Drop apps.d.x certificate
This site now obtains its own certificate using Apache _mod_md_.
2025-07-23 11:29:34 -05:00
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 e1d9833e83 cert-manager: Add cert for apps.du5t1n.xyz 2024-11-05 07:04:27 -06:00
Dustin 4ad5518f18 cert-manager: Migrate config to configMapGenerator 2024-11-05 07:04:09 -06:00
Dustin a443929c0c websites: Manage dcow cert via Ingress annotation
Now that the reverse proxy for Internet-facing sites uses TLS
passthrough, the certificate for the _darkchestofwonders.us_ Ingress
needs to be correct.  Since Ingress resources can only use either the
default certificate (_*.pyrocufflink.blue_) or a certificate from their
same namespace, we have to move the Certificate and its corresponding
Secret into the _websites_ namespace.  Fortunately, this is easy enoug
to do, by setting the appropriate annotations on the Ingress.

To keep the existing certificate (until it expires), I moved the Secret
manually:

```sh
kubectl get secret dcow-cert -o yaml | grep -v namespace | kubectl create -n websites -f -
```
2024-08-24 11:30:56 -05: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 64514e4b2a cert-manager: Drop acmeDNS solver
ACME DNS seems to have stopped working (401 Unauthorized for all
requests).  I've migrated the rest of the domains to use Cloudflare.
2023-08-28 12:00:23 -05:00
Dustin 82fdf455e5 cert-manager: Add certificate HLC
Hatch Learning Center has several domains; Tabitha couldn't decide which
she liked best :) At present, they all resolve to the same website, with
_hatchlearningcenter.org_ as the canonical name.
2023-06-22 09:49:12 -05:00
Dustin 3c1b637ddf cert-manager: Add cert for dustinandtabitha.com 2023-06-20 14:50:12 -05:00
Dustin 807c9347ef cert-manager: Add certificate for chmod777.sh 2023-05-30 09:59:01 -05:00
Dustin 41cef5a828 cert-manager: Run cert-exporter twice per day
This will reduce the delay between when a new certificate is issued and
when it is deployed.
2023-05-18 09:42:42 -05:00
Dustin dbb81fbae7 certificates: Add darkchestofwonders.us
If I remember to add the _acme-challenge CNAME record *before* applying
the Certificate resource, it takes a little under 5 minutes to issue a
new certificate.
2023-05-18 09:42:42 -05:00
Dustin 3d1f1fd611 cert-manager: Add certificate for tabitha.biz 2023-05-12 11:44:10 -05:00
Dustin 2305187bbd cert-manager: Add certificate for hatch.chat
The certificate for *hatch.chat* is used by Synapse (Matrix homeserver).
2023-05-09 21:13:08 -05: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 da211ef63c cert-manager: Add cert for dustin.hatch.name 2023-05-01 20:57:24 -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