没有匹配 Digital Ocean Kubernetes 集群上的种类 ClusterIssuer

No matches for kind ClusterIssuer on a Digital Ocean Kubernetes Cluster

我一直在关注 this guide 创建一个工作正常的 nginx-ingress。

接下来我想创建一个名为 letsencrypt-staging 的 ClusterIssuer 对象,并使用 Let's Encrypt 登台服务器,但出现此错误。

kubectl create -f staging_issuer.yaml

error: unable to recognize "staging_issuer.yaml": no matches for kind "ClusterIssuer" in version "certmanager.k8s.io/v1alpha1"

我已经搜索了解决方案,但找不到任何适合我或我能理解的解决方案。我发现的主要是错误报告。

这是我用来创建 ClusterIssuer 的 yaml 文件。

apiVersion: certmanager.k8s.io/v1alpha1
kind: ClusterIssuer
metadata:
 name: letsencrypt-staging
spec:
 acme:
   # The ACME server URL
   server: https://acme-staging-v02.api.letsencrypt.org/directory
   # Email address used for ACME registration
   email: your_email_address_here
   # Name of a secret used to store the ACME account private key
   privateKeySecretRef:
     name: letsencrypt-staging
   # Enable the HTTP-01 challenge provider
   http01: {}

我通过 运行 helm del --purge cert-manager

解决了这个问题

然后是

helm install --name cert-manager --namespace kube-system stable/cert-manager --set createCustomResource=true

有时是 .yaml 文件中使用的 space 字符。确保您没有使用制表符而不是 spaces。您可以删除 "Kind" 中的行(或任何显示错误的行),然后使用 space 栏而不是制表符再次写入。

尝试遵循 this link,证书管理器 LetsEncrypt 已通知它将阻止版本 < 0.8.0 的所有流量,因此您可以使用 Jetstack 的安装步骤,然后您可以关注

link 来创建 TLS 证书,它对我有用。

如果您遇到问题,请告诉我