简体   繁体   English

是否可以在多个 K8S 集群中使用通过 cert-manager (Lets Encrypt) 生成的通配符证书

[英]Is it possible to use a wildcard certificate generated via cert-manager (Lets Encrypt) in multiple K8S clusters

I would be using different subdomains for different services, but those services would reside in different K8S clusters.我将为不同的服务使用不同的子域,但这些服务将驻留在不同的 K8S 集群中。 I would like to know if I can just copy the wildcard certificate across the clusters.我想知道是否可以跨集群复制通配符证书。 Also, if there is a similar example somewhere please link me to it.另外,如果某处有类似的例子,请将我链接到它。 Any help would be appreciated.任何帮助,将不胜感激。

So there is no native handling of multiple clusters in cert-manager.所以在 cert-manager 中没有本地处理多个集群。

That said, there is nothing to stop you copying across the resulting 'Secret' resource between clusters, either manually or automatically.也就是说,没有什么可以阻止您在集群之间手动或自动复制生成的“秘密”资源。

The 'kubed' project (by appscode) has support for syncing Secrets between clusters: https://github.com/appscode/kubed . 'kubed' 项目(通过 appscode)支持在集群之间同步 Secrets: https : //github.com/appscode/kubed Full information can be found on their website: https://appscode.com/products/kubed/0.8.0/guides/config-syncer/inter-cluster/完整信息可以在他们的网站上找到: https : //appscode.com/products/kubed/0.8.0/guides/config-syncer/inter-cluster/

I hope this helps!我希望这有帮助!

i know, i am a bit late to the party but writing an answer might be helpful to someone我知道,我参加聚会有点晚,但写一个答案可能对某人有所帮助

For wildcard cert DNS-01 method, auth is required.对于通配符证书DNS-01方法,需要 auth。 You can use any DNS as per use case or which ever you are using.您可以根据用例或正在使用的任何 DNS 使用任何 DNS。

Note : You might require to first add the CAA record in your DNS.注意:您可能需要先在 DNS 中添加 CAA 记录。

CAA record can get added into DNS zone CAA 记录可以添加到 DNS 区域

example :例子

            Type       Value

devops.in   CAA       0 issuewild "letsencrypt.org"

get your records details from : https://sslmate.com/caa/从以下位置获取您的记录详细信息: https : //sslmate.com/caa/

First we have to create the secret for storing the access key using the command首先,我们必须使用命令创建用于存储access key的秘密

kubectl create secret generic route53-secret --from-literal=secret-access-key="skjdflk4598sf/dkfj490jdfg/dlfjk59lkj"

Here sharing the example issuer.yaml这里分享示例issuer.yaml

apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
  name: letsencrypt-prod
spec:
  acme:
    email: test123@gmail.com
    server: https://acme-v02.api.letsencrypt.org/directory
    privateKeySecretRef:
      name: letsencrypt-prod
    solvers:
    - selector:
        dnsZones:
          - "devops.in"
      dns01:
        route53:
          region: us-east-1
          hostedZoneID: Z2152140EXAMPLE
          accessKeyID: AKIA5A5D7EXAMPLE
          secretAccessKeySecretRef:
            name: route53-secret
            key: secret-access-key
---
apiVersion: cert-manager.io/v1alpha2
kind: Certificate
metadata:
  name: le-crt
spec:
  secretName: tls-secret
  issuerRef: 
    kind: Issuer
    name: letsencrypt-prod
  commonName: "*.devops.in"
  dnsNames:
    - "*.devops.in" 

Also make sure your user have necesarry permission to manage the Route53还要确保您的用户具有管理Route53权限

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": "route53:GetChange",
      "Resource": "arn:aws:route53:::change/*"
    },
    {
      "Effect": "Allow",
      "Action": "route53:ChangeResourceRecordSets",
      "Resource": "arn:aws:route53:::hostedzone/*"
    },
    {
      "Effect": "Allow",
      "Action": "route53:ListHostedZonesByName",
      "Resource": "*"
    }
  ]
}

暂无
暂无

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

相关问题 k8s 无法使用 cert-manager 为 GoDaddy 域生成 Let's Encrypt 证书 - k8s Unable to generate Let's Encrypt Certificates for GoDaddy Domains using cert-manager 如何使用来自 Let's Encrypt 的通配符证书和 cert-manager - How to use Wildcard certificates from Let’s Encrypt with cert-manager aks cert-manager不会使用let-encrypt创建证书 - aks cert-manager does not create a cert with lets-encrypt Cert-manager 让加密证书在“spec.durartion”中不使用正确的持续时间(使用默认值) - Cert-manager Lets Encrypt certificate not using correct duration in 'spec.durartion' (using default) 带有证书管理器的 K8s 内部 ACME 服务器,仅用于发布内部 k8s 证书-htttp 挑战问题 - K8s Internal ACME server with cert-manager for issuing only internal k8s certs - htttp challenge issue K8S cert-manager 创建 acme challenge pod 时出错 - K8S cert-manager error creating acme challenge pods 通配符让我们使用 cert-manager、nginx 入口、kubernetes 中的 cloudflare 加密证书如何解决? - Wildcard Let's Encrypt certificates with cert-manager, nginx ingress, cloudflare in kubernetes how to fix? 如何在裸机集群上使用cert-manager自动在Kubernetes中加密证书更新? - How to automate Let's Encrypt certificate renewal in Kubernetes with cert-manager on a bare-metal cluster? SSL 证书来自 Let's Encrypt 在您的 Kubernetes Ingress via cert-manager - SSL certificates from Let’s Encrypt in your Kubernetes Ingress via cert-manager Kubernetes让加密证书管理器找不到错误密码 - Kubernetes Let's Encrypt cert-manager Error secret not found
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM