简体   繁体   English

kubernetes - 证书经理证书链

[英]kubernetes - cert-manager certificate chains

I want to setup a wildcard domain certificate on a kubernetes cluster. 我想在kubernetes集群上设置通配符域证书。

I got a crt/key pair, and an intermediate crt from my CA 我有一个crt /密钥对,以及来自我的CA的中间crt

I've created a Secret referencing the crt/key pair (I've tried with and without the intermediate crt) 我创建了一个引用crt / key对的Secret(我尝试过使用和不使用中间crt)

apiVersion: v1
data:
  tls.crt: LS0tLS1CRUd...
  tls.key: LS0tLS1CRUd...
kind: Secret
metadata:
  name: wildcard-key-pair
type: kubernetes.io/tls

Then I've created a Certificate and the related Issuer, using cert-manager and following their documentation from https://docs.cert-manager.io/en/latest/tasks/issuers/setup-ca.html 然后我使用cert-manager创建了证书和相关的Issuer,并按照https://docs.cert-manager.io/en/latest/tasks/issuers/setup-ca.html中的文档进行操作

apiVersion: certmanager.k8s.io/v1alpha1
kind: Issuer
metadata:
  name: wildcard-issuer
  namespace: default
spec:
  ca:
    secretName: wildcard-key-pair
---
apiVersion: certmanager.k8s.io/v1alpha1
kind: Certificate
metadata:
  name: wildcard
  namespace: default
spec:
  secretName: wildcard-tls-secret
  dnsNames:
    - '*.example.com'
    - example.com
  commonName: '*.example.com'
  organization:
    - example
  issuerRef:
    name: wildcard-issuer
    kind: Issuer

But when I describe my certificate, using kubectl, I get the following error : 但是当我使用kubectl描述我的证书时,我收到以下错误:

Error getting keypair for CA issuer: certificate is not a CA

I'm kind of confused about the whole process of getting my wildcard dns working on my kubernetes cluster, so if you have any idea that could point me in the right direction don't hesitate to share your thoughts. 我对让我的通配符dns在我的kubernetes集群上工作的整个过程感到困惑,所以如果你有任何想法可以指出我正确的方向,请不要犹豫,分享你的想法。

as @johnharris85 mentioned, make sure your certificate has CA flag as true if you are using yours. 正如@ johnharris85所提到的那样,如果你使用你的证书,请确保你的证书有CA标志为真。 You can check it via 你可以通过检查

$ openssl x509 -text -noout -in ca.crt |grep "CA:"

Output should be CA:TRUE . 输出应为CA:TRUE

Hope it helps! 希望能帮助到你!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM