cert-manager-webhook-poweradmin
A cert-manager webhook for PowerAdmin DNS provider, enabling DNS-01 ACME challenges for automated certificate issuance (e.g., Let's Encrypt) in Kubernetes.
Compatibility
| Webhook Version |
Poweradmin Version |
cert-manager |
Kubernetes |
| 0.3.0+ |
4.1.0+ (v2 API only), 4.3.0+ incl. PowerDNS API backend |
>= 1.0 |
>= 1.25 |
| 0.2.0–0.2.x |
4.1.0 - 4.5.x (v2 API since 4.1.0, v1 API below 4.5.0 only), 4.3.0+ incl. PowerDNS API backend |
>= 1.0 |
>= 1.25 |
| 0.1.6+ |
4.1.0 - 4.4.x (v1 API), 4.1.0+ (v2 API), 4.3.0+ |
>= 1.0 |
>= 1.25 |
| 0.1.0–0.1.5 |
4.1.0 - 4.4.x (v1 API), 4.1.0+ (v2 API) |
>= 1.0 |
>= 1.25 |
API v1 support was removed in 0.3.0, following its removal in Poweradmin
4.5.0. Set apiVersion: "v2" (the default) or drop the field; "v1" now fails
with an error. Poweradmin has served API v2 since 4.1.0.
Prerequisites
- Kubernetes 1.25+
- cert-manager 1.0+
- Helm 3.0+
- PowerAdmin instance with API access enabled
Container Images
Multi-platform images (amd64/arm64) are published on each release:
Installation
Using Helm (OCI Registry)
helm install cert-manager-webhook-poweradmin oci://ghcr.io/poweradmin/charts/cert-manager-webhook-poweradmin \
--namespace cert-manager \
--set groupName=acme.yourdomain.com
Using Helm (Local Chart)
helm install cert-manager-webhook-poweradmin deploy/cert-manager-webhook-poweradmin \
--namespace cert-manager \
--set groupName=acme.yourdomain.com
Important: Set groupName to a unique domain you own. This value must match what you configure in your Issuer/ClusterIssuer.
Uninstall
helm uninstall cert-manager-webhook-poweradmin --namespace cert-manager
Configuration
1. Create API Key Secret
Create a Kubernetes Secret containing your PowerAdmin API key:
apiVersion: v1
kind: Secret
metadata:
name: poweradmin-api-key
namespace: cert-manager
type: Opaque
stringData:
api-key: "pwa_your_api_key_here"
Note: The webhook can only read Secrets in the cert-manager namespace by
default (certManager.namespace, covers ClusterIssuers). If a namespaced
Issuer references a Secret in another namespace, add that namespace to the
chart value rbac.secretReader.additionalNamespaces. You can further restrict
access to specific Secret names with rbac.secretReader.secretNames, or
restore the previous cluster-wide access with
rbac.secretReader.clusterScope=true (not recommended).
2. Configure ClusterIssuer
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt-prod
spec:
acme:
server: https://acme-v02.api.letsencrypt.org/directory
email: admin@example.com
privateKeySecretRef:
name: letsencrypt-account-key
solvers:
- dns01:
webhook:
groupName: acme.yourdomain.com
solverName: poweradmin
config:
serverURL: "https://poweradmin.example.com"
apiKeySecretRef:
name: poweradmin-api-key
key: api-key
apiVersion: "v2" # optional, default "v2" (the only supported value)
ttl: 120 # optional, default 120
insecure: false # optional, default false
3. Request a Certificate
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: example-cert
namespace: default
spec:
secretName: example-cert-tls
issuerRef:
name: letsencrypt-prod
kind: ClusterIssuer
dnsNames:
- example.com
- "*.example.com"
Configuration Options
| Field |
Required |
Default |
Description |
serverURL |
Yes |
- |
Base URL of the PowerAdmin instance |
apiKeySecretRef.name |
Yes |
- |
Name of the Secret containing the API key |
apiKeySecretRef.key |
Yes |
- |
Key within the Secret |
apiVersion |
No |
"v2" |
PowerAdmin API version; only "v2" is supported |
ttl |
No |
120 |
TTL for TXT records in seconds |
insecure |
No |
false |
Skip TLS verification for PowerAdmin API |
Upgrading to 0.3.x
- API v1 is no longer supported. Remove
apiVersion: "v1" from your
Issuer/ClusterIssuer solver config or set it to "v2"; with "v1" every
challenge fails with an error telling you to switch. Every supported
Poweradmin version (4.1.0+) serves API v2.
Upgrading to 0.2.x
- Secret RBAC is now namespace-scoped. The webhook previously could read
Secrets cluster-wide; it now gets a Role only in the cert-manager namespace.
If you use namespaced Issuers with Secrets in other namespaces, set
rbac.secretReader.additionalNamespaces accordingly.
- Zone resolution is stricter. If the authoritative zone for a domain (as
discovered by cert-manager) is not managed by your PowerAdmin instance, the
challenge now fails immediately with a clear error instead of silently
creating a TXT record in a parent zone where ACME validators would never
find it. Working setups are unaffected.
Development
Build
# Build the binary
go build .
# Build the Docker image
make build
Test
# Run unit tests
make test-unit
# Run conformance tests (requires envtest)
TEST_ZONE_NAME=example.com. make test
# Against a private zone, check propagation via its own DNS server
TEST_ZONE_NAME=example.com. TEST_DNS_SERVER=127.0.0.1:53 make test
The conformance suite applies every manifest in testdata/poweradmin-solver/
and reads the API key from the Secret named in config.json. Create it (the
file is gitignored) and point serverURL in config.json at your PowerAdmin:
cat > testdata/poweradmin-solver/api-key.yaml <<'YAML'
apiVersion: v1
kind: Secret
metadata:
name: poweradmin-api-key
type: Opaque
stringData:
api-key: "pwa_your_api_key_here"
YAML
Sponsors
We thank Menzel IT GmbH for their support of this project.
License
Apache License 2.0 - see LICENSE file.