首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >没有为cert-manager创建Kubernetes证书

没有为cert-manager创建Kubernetes证书
EN

Stack Overflow用户
提问于 2019-11-09 14:10:45
回答 1查看 923关注 0票数 1

我无法使用cert-manager创建证书。

我正在遵循这个指南https://docs.cert-manager.io/en/latest/getting-started/install/kubernetes.html

这是可行的:

代码语言:javascript
复制
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

但是运行测试

代码语言:javascript
复制
kubectl describe certificate -n cert-manager-test

不会产生任何结果。

你知道我该怎么解决这个问题吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-11-11 17:11:07

重新创建K8s集群,并按照上面证书管理器页面中的步骤进行操作。我犯的一个主要错误是在我的Ingress中引用了错误的名称空间。

请注意使用cert-manager.io/cluster-issuer

代码语言:javascript
复制
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    # add an annotation indicating the issuer to use.
    cert-manager.io/cluster-issuer: letsencrypt-prod

还要注意在使用证书管理器的v11时,apiVersion和求解器中的细微变化。

代码语言:javascript
复制
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需要指向有效的页面。确保正确指向您的域,并且在该域的根目录中提供页面。prod上有一个速率限制器,所以最好与临时颁发者一起工作,直到提供证书为止。如果你运行下面的代码,它应该会显示CertificateCreated。

代码语言:javascript
复制
kubectl describe ingress
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58776873

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档