我无法使用cert-manager创建证书。
我正在遵循本指南 https://docs.cert-manager.io/en/latest/getting-started/install/kubernetes.html
这有效:
antonswanevelder$ kubectl get pods --namespace cert-manager
NAME READY STATUS RESTARTS AGE
cert-manager-69b4f77ffc-4296b 1/1 Running 0 9m5s
cert-manager-cainjector-576978ffc8-2mxz6 1/1 Running 0 2d13h
cert-manager-webhook-c67fbc858-sdjff 1/1 Running 1 2d13h
但是要运行测试
kubectl describe certificate -n cert-manager-test
什么也没产生。
有什么办法可以解决此问题吗?
答案 0 :(得分:1)
重新创建K8s集群并按照上面的cert-manager页面中的步骤进行操作。我犯的一个主要错误是在Ingress中引用了错误的命名空间。
请注意使用cert-manager.io/cluster-issuer
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
# add an annotation indicating the issuer to use.
cert-manager.io/cluster-issuer: letsencrypt-prod
还请注意,使用cert-manager v11时,apiVersion和求解器会略有不同。
apiVersion: cert-manager.io/v1alpha2
kind: ClusterIssuer
metadata:
name: letsencrypt-prod
spec:
acme:
# You must replace this email address with your own.
# Let's Encrypt will use this to contact you about expiring
# certificates, and issues related to your account.
email: youremail@domain.com
server: https://acme-v02.api.letsencrypt.org/directory
privateKeySecretRef:
# Secret resource used to store the account's private key.
name: letsencrypt-prod
# Add a single challenge solver, HTTP01 using nginx
solvers:
- http01:
ingress:
class: nginx
最后,值得注意的是,Lets-encrypt需要指向有效页面才能提供证书。确保正确指向您的域,并且该域的根目录下有一个页面。产品上有一个速率限制器,因此最好与分段发行者合作,直到提供证书为止。如果运行以下代码,则应显示CertificateCreated。
kubectl describe ingress