小编Eme*_*en1的帖子

如何用通配符证书替换“Kubernetes 假证书”(在裸机私有云上)Nginx Ingress 和证书管理器

我们在裸机服务器上设置了一个 Kubernetes 集群。

我们部署应用程序,其中每个命名空间都是最终客户的应用程序。即 customer1.mydomain.com -> 命名空间:cust1

我们不断获得 Kubernetes Ingress Controller 假证书。

我们购买了自己的通配符证书 *.mydomain.com

#kubectl create secret tls OUR-SECRET --key /path/private.key --cert /path/chain.crt -n ingress-nginx
#kubectl create secret tls OUR-SECRET --key /path/private.key --cert /path/chain.crt -n kube-system
Run Code Online (Sandbox Code Playgroud)

入口.yaml

apiVersion: certmanager.k8s.io/v1alpha1  
kind: Certificate  
metadata:  
  name: ourcloud
  namespace: cert-manager
spec:  
  secretName: oursecret
  issuerRef:
    name: letsencrypt-prod
  commonName: '*.mydomain.com'
  acme:
    config:
    - dns01:
        provider: cf-dns-prod
      domains:
      - '*.mydomain.com'

kubectl apply -f ingress.yaml
certificate.certmanager.k8s.io/ourcloud created
Run Code Online (Sandbox Code Playgroud)

https://cust1.mydomain.com使用 Kubernetes Ingress Controller 假证书连接

certificate kubernetes-ingress nginx-ingress bare-metal-server

6
推荐指数
1
解决办法
1万
查看次数