What types of certificates are supported? | Какие виды сертификатов поддерживаются? |
The module installs the following ClusterIssuers:
| На данный момент модуль устанавливает следующие
|
If you need support for other types of certificates, you can add them yourself. | Если требуется поддержка других типов сертификатов, вы можете добавить их самостоятельно. |
How to add an additional
| Как добавить дополнительный
|
When is an additional
| В каких случаях требуется дополнительный
|
The standard delivery set includes | В стандартной поставке присутствуют |
To issue certificates for a domain name via Let’s Encrypt, the service requires that you verify domain ownership.
The
| Чтобы издать сертификаты на доменное имя через Let’s Encrypt, сервис требует осуществить подтверждение владения доменом.
|
The | Метод |
The | Поставляемые
|
| Таким образом, дополнительный
|
Added automatically when filling in the module settings associated with the cloud provider.
| Как добавить дополнительный
|
In this way, an additional
| Для подтверждения владения доменом через Let’s Encrypt с помощью метода |
How to add an additional
| У |
To verify domain ownership via Let’s Encrypt using the | Модуль автоматически создает |
| Пример использования AWS Route53 доступен в разделе Как защитить учетные данные |
The module automatically creates | Использование сторонних DNS-провайдеров реализуется через метод |
An example of using AWS Route53 is available in the section How to protect | В качестве примера рассмотрим использование сервиса |
Using third-party DNS providers is implemented via the |
|
When cert-manager makes an |
|
As an example, let’s consider using the | yaml apiVersion: cert-manager.io/v1 kind: ClusterIssuer metadata: name: yc-clusterissuer namespace: default spec: acme: Вы должны заменить этот адрес электронной почты на свой собственный. Let’s Encrypt будет использовать его, чтобы связаться с вами по поводу истекающих сертификатов и вопросов, связанных с вашей учетной записью. email: your@email.com server: https://acme-staging-v02.api.letsencrypt.org/directory privateKeySecretRef: Ресурс секретов, который будет использоваться для хранения закрытого ключа аккаунта. name: secret-ref solvers:
|
| Как добавить дополнительный
|
| Для выпуска сертификатов с помощью HashiСorp Vault, можете использовать инструкцию. |
yaml apiVersion: cert-manager.io/v1 kind: ClusterIssuer metadata: name: yc-clusterissuer namespace: default 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: your@email.com server: https://acme-staging-v02.api.letsencrypt.org/directory privateKeySecretRef: Secret resource that will be used to store the account’s private key. name: secret-ref solvers:
| После конфигурации PKI и включения авторизации в Kubernetes, нужно:
|
How to add an additional
| shell kubectl create serviceaccount issuer ISSUER_SECRET_REF=$(kubectl get serviceaccount issuer -o json | jq -r “.secrets[].name”) |
You can use this manual for configuring certificate issuance using Vault. |
|
After configuring PKI and enabling Kubernetes authorization, you have to:
| shell kubectl apply -f - «EOF apiVersion: cert-manager.io/v1 kind: Issuer metadata: name: vault-issuer namespace: default spec: vault: Если Vault разворачивался по вышеуказанной инструкции, в этом месте в инструкции опечатка. server: http://vault.default.svc.cluster.local:8200 Указывается на этапе конфигурации PKI. path: pki/sign/example-dot-com auth: kubernetes: mountPath: /v1/auth/kubernetes role: issuer secretRef: name: $ISSUER_SECRET_REF key: token EOF |
shell kubectl create serviceaccount issuer ISSUER_SECRET_REF=$(kubectl get serviceaccount issuer -o json | jq -r “.secrets[].name”) |
|
| shell kubectl apply -f - «EOF apiVersion: cert-manager.io/v1 kind: Certificate metadata: name: example-com namespace: default spec: secretName: example-com-tls issuerRef: name: vault-issuer Домены указываются на этапе конфигурации PKI в Vault. commonName: www.example.com dnsNames:
|
shell kubectl apply -f - «EOF apiVersion: cert-manager.io/v1 kind: Issuer metadata: name: vault-issuer namespace: default spec: vault: HashiCorp instruction has mistype here server: http://vault.default.svc.cluster.local:8200 path: pki/sign/example-dot-com # configure in pki setup step auth: kubernetes: mountPath: /v1/auth/kubernetes role: issuer secretRef: name: $ISSUER_SECRET_REF key: token EOF | Как добавить
|
| Для использования собственного или промежуточного CA: |
shell kubectl apply -f - «EOF apiVersion: cert-manager.io/v1 kind: Certificate metadata: name: example-com namespace: default spec: secretName: example-com-tls issuerRef: name: vault-issuer domains are set on PKI setup commonName: www.example.com dnsNames:
|
|
How to add
| shell openssl genrsa -out rootCAKey.pem 2048 openssl req -x509 -sha256 -new -nodes -key rootCAKey.pem -days 3650 -out rootCACert.pem |
Follow the steps below to use a custom or interim CA: |
|
| shell kubectl create secret tls internal-ca-key-pair -n d8-cert-manager –key=”rootCAKey.pem” –cert=”rootCACert.pem” |
shell openssl genrsa -out rootCAKey.pem 2048 openssl req -x509 -sha256 -new -nodes -key rootCAKey.pem -days 3650 -out rootCACert.pem | Пример создания секрета из YAML-файла (содержимое файлов сертификатов должно быть закодировано в Base64): |
| yaml
apiVersion: v1
data:
tls.crt: <результат команды |
An example of creating a secret with kubectl: | Имя секрета может быть любым. |
shell kubectl create secret tls internal-ca-key-pair -n d8-cert-manager –key=”rootCAKey.pem” –cert=”rootCACert.pem” |
|
An example of creating a secret from a YAML file (the contents of the certificate files must be Base64-encoded): | yaml apiVersion: cert-manager.io/v1 kind: ClusterIssuer metadata: name: inter-ca spec: ca: secretName: internal-ca-key-pair # Имя созданного секрета. |
yaml
apiVersion: v1
data:
tls.crt: <OUTPUT OF | Имя |
You can use any name you like for the secret. | Теперь можно использовать созданный |
| Например, чтобы использовать |
yaml apiVersion: cert-manager.io/v1 kind: ClusterIssuer metadata: name: inter-ca spec: ca: secretName: internal-ca-key-pair # Name of the secret you created earlier. | yaml
spec:
settings:
modules:
https:
certManager:
clusterIssuerName: inter-ca
mode: CertManager
publicDomainTemplate: ‘%s. |
You can use any name as your | Как защитить учетные данные
|
You can now use the created | Если вы не хотите хранить учетные данные конфигурации Deckhouse (например, по соображениям безопасности), можете создать
свой собственный |
For example, to issue certificates for all Deckhouse components, specify the | Пример создания собственного
|
yaml
spec:
settings:
modules:
https:
certManager:
clusterIssuerName: inter-ca
mode: CertManager
publicDomainTemplate: ‘%s. | shell kubectl apply -f - «EOF apiVersion: v1 kind: Secret type: Opaque metadata: name: route53 namespace: default data: secret-access-key: {{ “MY-AWS-ACCESS-KEY-TOKEN” | b64enc | quote }} EOF |
How to secure
|
|
If you don’t want to store credentials in the Deckhouse configuration (security reasons, for example), feel free to create
your own ClusterIssuer / Issuer.
For example, you can create your own
| shell kubectl apply -f - «EOF apiVersion: cert-manager.io/v1 kind: ClusterIssuer metadata: name: route53 namespace: default spec: acme: server: https://acme-v02.api.letsencrypt.org/directory privateKeySecretRef: name: route53-tls-key solvers:
|
shell kubectl apply -f - «EOF apiVersion: v1 kind: Secret type: Opaque metadata: name: route53 namespace: default data: secret-access-key: {{ “MY-AWS-ACCESS-KEY-TOKEN” | b64enc | quote }} EOF |
|
| shell kubectl apply -f - «EOF apiVersion: cert-manager.io/v1 kind: Certificate metadata: name: example-com namespace: default spec: secretName: example-com-tls issuerRef: name: route53 commonName: www.example.com dnsNames:
|
shell kubectl apply -f - «EOF apiVersion: cert-manager.io/v1 kind: ClusterIssuer metadata: name: route53 namespace: default spec: acme: server: https://acme-v02.api.letsencrypt.org/directory privateKeySecretRef: name: route53-tls-key solvers:
| Работает ли старая аннотация TLS-acme? |
| Да, работает. Специальный компонент |
shell kubectl apply -f - «EOF apiVersion: cert-manager.io/v1 kind: Certificate metadata: name: example-com namespace: default spec: secretName: example-com-tls issuerRef: name: route53 commonName: www.example.com dnsNames:
|
|
Does the legacy tls-acme annotation work? | yaml apiVersion: networking.k8s.io/v1 kind: Ingress metadata: annotations: kubernetes.io/tls-acme: “true” # Аннотация. name: example-com namespace: default spec: ingressClassName: nginx rules:
|
Yes, it works! The dedicated component (
| Как посмотреть состояние сертификата? |
yaml apiVersion: networking.k8s.io/v1 kind: Ingress metadata: annotations: kubernetes.io/tls-acme: “true” # The annotation. name: example-com namespace: default spec: ingressClassName: nginx rules:
| shell kubectl -n default describe certificate example-com … Status: Acme: Authorizations: Account: https://acme-v01.api.letsencrypt.org/acme/reg/22442061 Domain: example.com Uri: https://acme-v01.api.letsencrypt.org/acme/challenge/qJA9MGCZnUnVjAgxhoxONvDnKAsPatRILJ4n0lJ7MMY/4062050823 Account: https://acme-v01.api.letsencrypt.org/acme/reg/22442061 Domain: admin.example.com Uri: https://acme-v01.api.letsencrypt.org/acme/challenge/pW2tFKLBDTll2Gx8UBqmEl846x5W-YpBs8a4HqstJK8/4062050808 Account: https://acme-v01.api.letsencrypt.org/acme/reg/22442061 Domain: www.example.com Uri: https://acme-v01.api.letsencrypt.org/acme/challenge/LaZJMM9_OKcTYbEThjT3oLtwgpkNfbHVdl8Dz-yypx8/4062050792 Conditions: Last Transition Time: 2018-04-02T18:01:04Z Message: Certificate issued successfully Reason: CertIssueSuccess Status: True Type: Ready Events: Type Reason Age From Message —- —— —- —- ——- Normal PrepareCertificate 1m cert-manager-controller Preparing certificate with issuer Normal PresentChallenge 1m cert-manager-controller Presenting http-01 challenge for domain example.com Normal PresentChallenge 1m cert-manager-controller Presenting http-01 challenge for domain www.example.com Normal PresentChallenge 1m cert-manager-controller Presenting http-01 challenge for domain admin.example.com Normal SelfCheck 1m cert-manager-controller Performing self-check for domain admin.example.com Normal SelfCheck 1m cert-manager-controller Performing self-check for domain example.com Normal SelfCheck 1m cert-manager-controller Performing self-check for domain www.example.com Normal ObtainAuthorization 55s cert-manager-controller Obtained authorization for domain example.com Normal ObtainAuthorization 54s cert-manager-controller Obtained authorization for domain admin.example.com Normal ObtainAuthorization 53s cert-manager-controller Obtained authorization for domain www.example.com |
How do I check the certificate status? | Как получить список сертификатов? |
shell | shell kubectl get certificate –all-namespaces |
kubectl -n default describe certificate example-com … Status: Acme: Authorizations: Account: https://acme-v01.api.letsencrypt.org/acme/reg/22442061 Domain: example.com Uri: https://acme-v01.api.letsencrypt.org/acme/challenge/qJA9MGCZnUnVjAgxhoxONvDnKAsPatRILJ4n0lJ7MMY/4062050823 Account: https://acme-v01.api.letsencrypt.org/acme/reg/22442061 Domain: admin.example.com Uri: https://acme-v01.api.letsencrypt.org/acme/challenge/pW2tFKLBDTll2Gx8UBqmEl846x5W-YpBs8a4HqstJK8/4062050808 Account: https://acme-v01.api.letsencrypt.org/acme/reg/22442061 Domain: www.example.com Uri: https://acme-v01.api.letsencrypt.org/acme/challenge/LaZJMM9_OKcTYbEThjT3oLtwgpkNfbHVdl8Dz-yypx8/4062050792 Conditions: Last Transition Time: 2018-04-02T18:01:04Z Message: Certificate issued successfully Reason: CertIssueSuccess Status: True Type: Ready Events: Type Reason Age From Message —- —— —- —- ——- Normal PrepareCertificate 1m cert-manager-controller Preparing certificate with issuer Normal PresentChallenge 1m cert-manager-controller Presenting http-01 challenge for domain example.com Normal PresentChallenge 1m cert-manager-controller Presenting http-01 challenge for domain www.example.com Normal PresentChallenge 1m cert-manager-controller Presenting http-01 challenge for domain admin.example.com Normal SelfCheck 1m cert-manager-controller Performing self-check for domain admin.example.com Normal SelfCheck 1m cert-manager-controller Performing self-check for domain example.com Normal SelfCheck 1m cert-manager-controller Performing self-check for domain www.example.com Normal ObtainAuthorization 55s cert-manager-controller Obtained authorization for domain example.com Normal ObtainAuthorization 54s cert-manager-controller Obtained authorization for domain admin.example.com Normal ObtainAuthorization 53s cert-manager-controller Obtained authorization for domain www.example.com | NAMESPACE NAME AGE default example-com 13m |
How do I get a list of certificates? | Что делать, если появляется ошибка: CAA record does not match issuer? |
shell | Если |
kubectl get certificate –all-namespaces NAMESPACE NAME AGE default example-com 13m | text CAA record does not match issuer |
The “CAA record does not match issuer” error | то необходимо проверить |
Suppose | |
text CAA record does not match issuer | |
In this case, you have to check the |