Bboysoul's Blog

首页 公告 RSS

使用cert-manager为DNSPod的域名签发免费证书

August 1, 2023 本文有 410 个字 需要花费 1 分钟阅读

简介

详细的可以看

https://cloud.tencent.com/document/product/457/60225

其实就是多安装了cert-manager-webhook-dnspod

不懂cert-manager的可以看

使用cert-manager管理你k8s的证书

操作

首先部署cert-manager

kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.12.0/cert-manager.yaml

之后部署

https://github.com/qqshfox/cert-manager-webhook-dnspod

cd deploy/cert-manager-webhook-dnspod/

修改values.yaml最主要是下面这些参数,记得看注释

groupName: acme.xxx.com # 推荐直接使用你的域名

certManager:
  namespace: cert-manager
  serviceAccountName: cert-manager

# 记住创建的是dnspod token 不是腾讯云 api 密钥
secrets:
 apiID:  xxxx
 apiToken: xxxxxx


clusterIssuer:
  enabled: true # 如果配置为 true 会自动创建一个clusterIssuer
  staging: false
  email: [email protected] # 你的邮箱

之后部署

helm upgrade --install -n cert-manager -f values.yaml cert-manager-webhook-dnspod .

最后就是创建证书测试下

kind: Certificate
metadata:
  name: xxxx-xxxx-com # 推荐直接使用域名
  namespace: default
spec:
  secretName: xxxx-xxxx-com-secret # 证书保存在这个 secret 中推荐直接使用域名
  issuerRef:
    name: cert-manager-webhook-dnspod-cluster-issuer # 这里使用自动生成出来的 ClusterIssuer
    kind: ClusterIssuer
    group: cert-manager.io
  dnsNames: # 填入需要签发证书的域名列表,确保域名是使用 dnspod 管理的
  - xxxx.xxxx.com

如果碰到问题了,直接去看cert-manager pod 的日志,一般碰到的就是因为网络问题导致的不能签发证书

欢迎关注我的博客www.bboy.app

Have Fun


Tags:

本站总访问量 本站总访客数