This solver can be used with desec.io DNS API. The documentation of the API can be found here
- helm >= v3.8.0 (OCI support)
- kubernetes
- cert-manager
- for development: go >= 1.26
helm install desec-webhook -n cert-manager \
oci://ghcr.io/su541/helm/cert-manager-desec-webhook --version <version>Available versions are listed on the releases page.
The image tag defaults to the chart's appVersion, so chart and image always match.
helm install desec-webhook -n cert-manager deploy/desec-webhookhelm uninstall desec-webhook -n cert-managerCreate a secret containing the credentials
apiVersion: v1
kind: Secret
metadata:
name: desec-io-token
namespace: cert-manager
type: Opaque
data:
token: your-key-base64-encodedkubectl create secret generic desec-io-token --from-literal "token=<your token>" --namespace cert-managerThe webhook may only read the secrets listed in secretName (values.yaml) in the
namespace it is installed in. With a ClusterIssuer, put the secret into that
namespace (usually cert-manager).
Create a 'ClusterIssuer' or 'Issuer' resource as the following:
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt-staging
spec:
acme:
server: https://acme-staging-v02.api.letsencrypt.org/directory
email: [email protected]
privateKeySecretRef:
name: letsencrypt-staging
solvers:
- dns01:
webhook:
config:
apiKeySecretRef:
key: token
name: desec-io-token
groupName: de.su541.acme
solverName: desecA ClusterIssuer reads the token secret from cert-manager's cluster resource
namespace (usually cert-manager), so one secret serves the whole cluster.
A namespaced Issuer reads the token secret from its own namespace. This
is intentional: whoever can create an Issuer in a namespace must not be able
to use a token stored somewhere else. The chart only grants the webhook access
to secrets in its own namespace, so for each additional namespace allow the
webhook to read that one secret:
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: desec-webhook:secret-reader
namespace: my-app
rules:
- apiGroups: [""]
resources: ["secrets"]
resourceNames: ["desec-io-token"]
verbs: ["get"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: desec-webhook:secret-reader
namespace: my-app
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: desec-webhook:secret-reader
subjects:
- kind: ServiceAccount
# kubectl -n cert-manager get serviceaccounts
name: desec-webhook-cert-manager-desec-webhook
namespace: cert-managerapiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: example-cert
namespace: cert-manager
spec:
commonName: example.com
dnsNames:
- example.com
issuerRef:
name: letsencrypt-staging
kind: ClusterIssuer
secretName: example-certapiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: bitwarden
namespace: utils
labels:
app: bitwarden
annotations:
cert-manager.io/cluster-issuer: letsencrypt-staging
kubernetes.io/ingress.class: traefik
traefik.ingress.kubernetes.io/rewrite-target: /$1
traefik.ingress.kubernetes.io/router.entrypoints: websecure
traefik.ingress.kubernetes.io/router.tls: 'true'
spec:
tls:
- hosts:
- bitwarden.acme.example.com
secretName: bitwarden-crt
rules:
- host: bitwarden.acme.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: bitwarden
port:
number: 80
make testThe unit tests run against an in-memory fake of the deSEC API and a fake Kubernetes client. They need no credentials.
All DNS providers must pass the cert-manager DNS01 conformance suite. It runs against the real deSEC API and needs a deSEC domain and an API token:
export DESEC_TOKEN=<your token>
TEST_ZONE_NAME=example.com. make test-conformanceThe token is only written to a temporary directory during the test.
Versioning follows Semantic Versioning and is derived from Conventional Commits by release-please:
| Commit / PR title | Version bump |
|---|---|
fix: ... |
patch |
feat: ... |
minor |
feat!: ... or footer BREAKING CHANGE: ... |
major |
docs:, chore:, ci:, test:, refactor: |
none |
PRs are squash-merged, so the PR title must be a Conventional Commit (checked by CI).
release-please keeps a release PR open that collects the changes. Merging it
creates the tag vX.Y.Z, the GitHub release and CHANGELOG.md, and publishes
- the image
ghcr.io/su541/cert-manager-desec-webhookwith the tagsX.Y.Z,X.Y,Xandlatest(cosign-signed) - the chart
oci://ghcr.io/su541/helm/cert-manager-desec-webhookwith versionX.Y.Z
Every push to master additionally publishes the image tags master and sha-<commit>.
