This is a cert-manager webhook solver for DNSPod.
- cert-manager >= 1.13.0
First, generate SecretId and SecretKey in Cloud API
You can install chart from git repo:
# Firstly add cert-manager-webhook-dnspod charts repository if you haven't do this
helm repo add cert-manager-webhook-dnspod https://imroc.github.io/cert-manager-webhook-dnspod
# Install the latest version.
helm upgrade --install --namespace cert-manager \
cert-manager-webhook-dnspod cert-manager-webhook-dnspod/cert-manager-webhook-dnspodUse kubectl apply to install:
kubectl apply -f https://raw.githubusercontent.com/imroc/cert-manager-webhook-dnspod/master/bundle.yamlFirstly, create a secret that contains TencentCloud account's SecretId and SecretKey:
apiVersion: v1
kind: Secret
metadata:
name: dnspod-secret
namespace: cert-manager
type: Opaque
stringData:
secretId: xxx
secretKey: xxxBase64 is not needed in
stringData.
Before you can issue a certificate, you need to create a Issuer or ClusterIssuer.
If you use helm and only need a global
ClusterIssuer, you can add--set clusterIssuer.enabled=true --set clusterIssuer.secretId=xxx --set clusterIssuer.secretKey=xxxto create theClusterIssuer.
Create a ClusterIssuer referring the secret:
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: dnspod
spec:
acme:
email: [email protected]
privateKeySecretRef:
name: dnspod-letsencrypt
server: https://acme-v02.api.letsencrypt.org/directory
solvers:
- dns01:
webhook:
config:
secretIdRef:
key: secretId
name: dnspod-secret
secretKeyRef:
key: secretKey
name: dnspod-secret
ttl: 600
recordLine: ""
groupName: acme.dnspod.com
solverName: dnspodsecretIdandsecretKeyis the SecretId and SecretKey of your TencentCloud account.groupNameis the the groupName that specified in your cert-manager-webhook-dnspod installation, defaults toacme.dnspod.com.solverNamemust bednspod.ttlis the optional ttl of dns TXT record that created by webhook.recordLineis the optional recordLine parameter of the dnspod.emailis the optional email address. When the domain is about to expire, a notification will be sent to this email address.
You can issue the certificate by creating Certificate that referring the dnspod ClusterIssuer or Issuer:
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: example-crt
spec:
secretName: example-crt
issuerRef:
name: dnspod
kind: ClusterIssuer
group: cert-manager.io
dnsNames:
- "example.com"
- "*.example.com"Version 1.5.x has the following changes
- Enhanced logging capabilities: Added JSON-structured logging with richer context for easier troubleshooting, and supports custom log levels (default:
info). - Improved security: Store
secretIdin Secrets instead of Helm values (consistent withsecretKeyhandling). - Enhanced code maintainability: Refactored codebase by splitting logic into multiple Go files for better organization.
- Optimized
Presentimplementation:- Removed redundant DNS SOA queries to resolve zones (The
ResolvedZonesent by cert-manager is the zone already queried through SOA). - Eliminated domain lookup via DNSPod API (DNSPod API
CreateRecordcan acceptsDomaindirectly without requiringDomainID).
- Removed redundant DNS SOA queries to resolve zones (The
- Changed default
groupNamefromacme.imroc.cctoacme.dnspod.com. - Added support for gitHub pages as helm repository.
- Added optional
recordLinein Issuer's webhook config for custom DNS record lines.
If you upgrade from 1.4.0 to 1.5.x, and created Issuer or ClusterIssuer manually (clusterIssuer.enabled=false), you need to add secretIdRef to Issuer's webhook config, also add secretId in your corresponding Secret.