| OIDC (recommended) | Static credentials | |
|---|---|---|
| Cluster type | TKE managed cluster only | Any Kubernetes cluster |
| Cluster version | >= v1.20.6-tke.27 or >= v1.22.5-tke.1 |
No restriction |
| OIDC enabled | Required | Not needed |
| Static keys | Not needed | Required (SecretId/SecretKey) |
TKE Console → Cluster → Basic Info → ServiceAccountIssuerDiscovery → Edit:
- Create CAM OIDC Provider
- Create webhook component
- Client ID:
sts.cloud.tencent.com
Verify:
tccli tke DescribeClusterAuthenticationOptions \
--ClusterId <CLUSTER_ID> --region <REGION> --output json
# OIDCConfig.AutoCreateOIDCConfig = true
# ServiceAccounts.Issuer is not emptycurl -sSL https://raw.githubusercontent.com/tkestack/external-dns-tencentcloud-webhook/master/scripts/setup.sh \
| bash -s -- --auth oidc --zone public --domain example.comThe script checks cluster type/version/OIDC status, creates role, attaches policy, generates Helm values.
- CAM Console → New Role → Identity Provider
- Select the OIDC provider for your cluster
- Condition:
oidc:aud=sts.cloud.tencent.com - Attach policy:
QcloudDNSPodFullAccess(public) orQcloudPrivateDNSFullAccess(private)
Role naming convention: external-dns-<cluster-id>-<zone-type>
No cluster type or version restriction. Just create a Secret:
kubectl create namespace external-dns
kubectl -n external-dns create secret generic tencentcloud-credentials \
--from-literal=TENCENTCLOUD_SECRET_ID=<ID> \
--from-literal=TENCENTCLOUD_SECRET_KEY=<KEY>