Fix the format of applying certmanager related yaml (#2556)

* fix the format of cert-manager related yaml

* fix format

* fix empty string
This commit is contained in:
Zhimin Xiang 2020-06-09 10:50:32 -07:00 committed by GitHub
parent 119f463487
commit accae21840
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 42 additions and 41 deletions

View File

@ -105,31 +105,31 @@ TLS certificates and how the requests are validated with Cloud DNS.
provider info, including your `cert-manager-cloud-dns-admin` service account. provider info, including your `cert-manager-cloud-dns-admin` service account.
```shell ```shell
kubectl apply --filename - <<EOF kubectl apply --filename - <<EOF
apiVersion: cert-manager.io/v1alpha2 apiVersion: cert-manager.io/v1alpha2
kind: ClusterIssuer kind: ClusterIssuer
metadata: metadata:
name: letsencrypt-issuer name: letsencrypt-issuer
spec: spec:
acme: acme:
server: https://acme-v02.api.letsencrypt.org/directory server: https://acme-v02.api.letsencrypt.org/directory
# This will register an issuer with LetsEncrypt. Replace # This will register an issuer with LetsEncrypt. Replace
# with your admin email address. # with your admin email address.
email: myemail@gmail.com email: myemail@gmail.com
privateKeySecretRef: privateKeySecretRef:
# Set privateKeySecretRef to any unused secret name. # Set privateKeySecretRef to any unused secret name.
name: letsencrypt-issuer name: letsencrypt-issuer
solvers: solvers:
- dns01: - dns01:
clouddns: clouddns:
# Set this to your GCP project-id # Set this to your GCP project-id
project: $PROJECT_ID project: $PROJECT_ID
# Set this to the secret that we publish our service account key # Set this to the secret that we publish our service account key
# in the previous step. # in the previous step.
serviceAccountSecretRef: serviceAccountSecretRef:
name: cloud-dns-key name: cloud-dns-key
key: key.json key: key.json
EOF EOF
``` ```
1. Ensure that `letsencrypt-issuer` is created successfully by running the 1. Ensure that `letsencrypt-issuer` is created successfully by running the
@ -165,23 +165,24 @@ exists.
where `<your-domain.com>` is your domain: where `<your-domain.com>` is your domain:
```shell ```shell
# Change this value to the domain you want to use. # Change this value to the domain you want to use.
export DOMAIN=<your-domain.com> export DOMAIN=<your-domain.com>
kubectl apply --filename - <<EOF kubectl apply --filename - <<EOF
apiVersion: cert-manager.io/v1alpha2 apiVersion: cert-manager.io/v1alpha2
kind: Certificate kind: Certificate
metadata: metadata:
name: my-certificate name: my-certificate
namespace: istio-system namespace: istio-system
spec: spec:
secretName: istio-ingressgateway-certs secretName: istio-ingressgateway-certs
issuerRef: issuerRef:
name: letsencrypt-issuer name: letsencrypt-issuer
dnsNames: kind: ClusterIssuer
- "*.default.$DOMAIN" dnsNames:
- "*.other-namespace.$DOMAIN" - "*.default.$DOMAIN"
EOF - "*.other-namespace.$DOMAIN"
EOF
``` ```
1. Ensure that `my-certificate` is created successfully by running the following 1. Ensure that `my-certificate` is created successfully by running the following