Fix formatting and a few tweaks (#4232)

This commit is contained in:
Samia Nneji 2021-09-16 14:35:40 +01:00 committed by GitHub
parent a601b8ccce
commit aa04a5b5ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 52 additions and 40 deletions

View File

@ -48,16 +48,16 @@ DomainMappings in that namespace to use the domain name.
``` ```
Where `<filename>` is the name of the file you created in the previous step. Where `<filename>` is the name of the file you created in the previous step.
* To create ClusterDomainClaims automatically, set the `autocreateClusterDomainClaims` property * To create ClusterDomainClaims automatically: set the `autocreateClusterDomainClaims` property
to `true` in the `config-network` ConfigMap in the `knative-serving` namespace. to `true` in the `config-network` ConfigMap in the `knative-serving` namespace.
This allows any user, in any namespace, to map any domain name, including ones in other This allows any user, in any namespace, to map any domain name, including ones in other
namespaces or for domain names that they do not own. namespaces or for domain names that they do not own.
<!-- insert example snippet --> <!-- insert example snippet -->
=== "Apply YAML"
1. Create a DomainMapping object: 1. Create a DomainMapping object:
=== "YAML"
1. Create a YAML file using the following template: 1. Create a YAML file using the following template:
```yaml ```yaml
@ -75,6 +75,7 @@ DomainMappings in that namespace to use the domain name.
secret: <cert-secret> secret: <cert-secret>
``` ```
Where: Where:
- `<domain-name>` is the domain name that you want to map a Service to. - `<domain-name>` is the domain name that you want to map a Service to.
- `<namespace>` is the namespace that contains both the `DomainMapping` and `Service` objects. - `<namespace>` is the namespace that contains both the `DomainMapping` and `Service` objects.
- `<service-name>` is the name of the Service that is mapped to the domain. - `<service-name>` is the name of the Service that is mapped to the domain.
@ -91,19 +92,30 @@ DomainMappings in that namespace to use the domain name.
``` ```
Where `<filename>` is the name of the file you created in the previous step. Where `<filename>` is the name of the file you created in the previous step.
=== "kn CLI" === "kn"
Run the command:
``` ```bash
kn domain create <domain-name> --ref <target> --tls <tls-secret> --namespace <namespace> kn domain create <domain-name> --ref <target> --tls <tls-secret> --namespace <namespace>
``` ```
Where: Where:
- `<domain-name>` is the domain name that you want to map a Service or Route to.
- `<target>` is the name of the Service or Route that is mapped to the domain. You can use a prefix `ksvc:` or `kroute:` to specify whether to map the domain to a Knative Service or Route. If no prefix is given, `ksvc:` is assumed. Additionally, you can use a `:namespace` suffix to point to a Service or Route in a different namespace than this Domain mapping. E.g. `mysvc` maps to a Service `mysvc` in the same namespace as this mapping, while `kroute:myroute:othernamespace` maps to a Route `myroute` in namespace `othernamespace`.
- `<tls-secret>` is optional and if provided enables the TLS protocol. The value specifies the secret that holds the server certificate.
- `<namespace>` is the namespace where the DomainMapping should be created. By default the DomainMapping is created in the current namespace.
In addition to creating DomainMappings, `kn domain` can be used to list, describe, update and delete existing DomainMappings. See `kn domain --help` for more information. - `<domain-name>` is the domain name that you want to map a Service or Route to.
- `<target>` is the name of the Service or Route that is mapped to the domain.
You can use the prefix `ksvc:` or `kroute:` to specify whether to map the domain to a Knative Service or Route.
If no prefix is given, `ksvc:` is assumed.
Additionally, you can use a `:namespace` suffix to point to a Service or Route in a different namespace.
Examples:
- `mysvc` maps to a Service `mysvc` in the same namespace as this mapping.
- `kroute:myroute:othernamespace` maps to a Route `myroute` in namespace `othernamespace`.
- `<tls-secret>` is optional and if provided enables the TLS protocol. The value specifies the secret that holds the server certificate.
- `<namespace>` is the namespace where you want to create the DomainMapping. By default the DomainMapping is created in the current namespace.
!!! note
In addition to creating DomainMappings, you can use the `kn domain`
command to list, describe, update, and delete existing DomainMappings.
For more information about the command, run `kn domain --help`.
1. Point the domain name to the IP address of your Knative cluster. Details of this step differ 1. Point the domain name to the IP address of your Knative cluster. Details of this step differ
depending on your domain registrar. depending on your domain registrar.