Format markdown (#1647)

Produced via:
  `prettier --write --prose-wrap=always $(find -name '*.md' | grep -v vendor | grep -v .github)`
/assign @samodell
This commit is contained in:
mattmoor-sockpuppet 2019-08-05 07:15:55 -07:00 committed by Knative Prow Robot
parent f8670df188
commit 772552dbb7
8 changed files with 449 additions and 350 deletions

View File

@ -16,24 +16,26 @@ Choice creates `Channel`s and `Subscription`s under the hood.
Choice has three parts for the Spec: Choice has three parts for the Spec:
1. `cases` defines the list of `filter` and `subscriber` pairs, one per 1. `cases` defines the list of `filter` and `subscriber` pairs, one per branch,
branch, and optionally a `reply` object. For each branch: and optionally a `reply` object. For each branch:
1. the `filter` is evaluated and when it returns an event the `subscriber` is executed. 1. the `filter` is evaluated and when it returns an event the `subscriber` is
Both `filter` and `subscriber` must be `Callable`. executed. Both `filter` and `subscriber` must be `Callable`.
1. the event returned by the `subscriber` is sent to the branch `reply` object. When 1. the event returned by the `subscriber` is sent to the branch `reply`
the `reply` is empty, the event is sent to the `spec.reply` object (see below). object. When the `reply` is empty, the event is sent to the `spec.reply`
1. (optional) `channelTemplate` defines the Template which will be used to create object (see below).
`Channel`s. 1. (optional) `channelTemplate` defines the Template which will be used to
1. (optional) `reply` defines where the result of each branch is sent to when the branch does create `Channel`s.
not have its own `reply` object. 1. (optional) `reply` defines where the result of each branch is sent to when
the branch does not have its own `reply` object.
### Choice Status ### Choice Status
Choice has three parts for the Status: Choice has three parts for the Status:
1. Conditions which detail the overall Status of the Choice object 1. Conditions which detail the overall Status of the Choice object
1. IngressChannelStatus and CaseStatuses which convey the Status 1. IngressChannelStatus and CaseStatuses which convey the Status of underlying
of underlying `Channel` and `Subscription` resource that are created as part of this Choice. `Channel` and `Subscription` resource that are created as part of this
Choice.
1. AddressStatus which is exposed so that Choice can be used where Addressable 1. AddressStatus which is exposed so that Choice can be used where Addressable
can be used. Sending to this address will target the `Channel` which is can be used. Sending to this address will target the `Channel` which is
fronting this Choice (same as `IngressChannelStatus`). fronting this Choice (same as `IngressChannelStatus`).

View File

@ -1,14 +1,16 @@
The following examples will help you understand how to use Choice The following examples will help you understand how to use Choice to describe
to describe various flows. various flows.
## Prerequisites ## Prerequisites
All examples require: All examples require:
- A Kubernetes cluster with - A Kubernetes cluster with
- Knative Eventing v0.8+ - Knative Eventing v0.8+
- Knative Service v0.8+ - Knative Service v0.8+
All examples are using the [default channel template](../../channels/default-channels.md). All examples are using the
[default channel template](../../channels/default-channels.md).
## Examples ## Examples
@ -16,10 +18,10 @@ For each of these examples below, we'll use
[`CronJobSource`](../cronjob-source/README.md) as the source of events. [`CronJobSource`](../cronjob-source/README.md) as the source of events.
We also use simple We also use simple
[functions](https://github.com/lionelvillard/knative-functions) to perform trivial filtering, transformation and routing of the incoming events. [functions](https://github.com/lionelvillard/knative-functions) to perform
trivial filtering, transformation and routing of the incoming events.
The examples are: The examples are:
- [Choice with multiple cases and global reply](./multiple-cases/README.md) - [Choice with multiple cases and global reply](./multiple-cases/README.md)
- [Choice with mutually exclusive cases](./mutual-exclusivity/README.md) - [Choice with mutually exclusive cases](./mutual-exclusivity/README.md)

View File

@ -1,4 +1,5 @@
We are going to create a Choice with two cases: We are going to create a Choice with two cases:
- the first case accepts events with a time that is is even - the first case accepts events with a time that is is even
- the second case accepts events with a time that is is odd - the second case accepts events with a time that is is odd
@ -10,7 +11,8 @@ Please refer to the sample overview for the [prerequisites](../README.md).
### Create the Knative Services ### Create the Knative Services
Let's first create the filter and transformer services that we will use in our Choice. Let's first create the filter and transformer services that we will use in our
Choice.
```yaml ```yaml
apiVersion: serving.knative.dev/v1alpha1 apiVersion: serving.knative.dev/v1alpha1
@ -146,8 +148,8 @@ kubectl create -f ./cron-source.yaml
### Inspecting the results ### Inspecting the results
You can now see the final output by inspecting the logs of the event-display You can now see the final output by inspecting the logs of the event-display
pods. Note that since we set the `CronJobSource` to emit every minute, it pods. Note that since we set the `CronJobSource` to emit every minute, it might
might take some time for the events to show up in the logs. take some time for the events to show up in the logs.
Let's look at the `event-display` log: Let's look at the `event-display` log:

View File

@ -1,8 +1,11 @@
In this example, we are going to see how we can create a Choice In this example, we are going to see how we can create a Choice with mutually
with mutually exclusive cases. exclusive cases.
This example is the same as the [multiple cases example](../multiple-cases/README.md) except This example is the same as the
that we are now going to rely on the Knative [switcher](https://github.com/lionelvillard/knative-functions#switcher) function to provide a soft mutual exclusivity guarantee. [multiple cases example](../multiple-cases/README.md) except that we are now
going to rely on the Knative
[switcher](https://github.com/lionelvillard/knative-functions#switcher) function
to provide a soft mutual exclusivity guarantee.
NOTE: this example has to be deployed in the default namespace. NOTE: this example has to be deployed in the default namespace.
@ -12,7 +15,8 @@ Please refer to the sample overview for the [prerequisites](../README.md).
### Create the Knative Services ### Create the Knative Services
Let's first create the switcher and transformer services that we will use in our Choice. Let's first create the switcher and transformer services that we will use in our
Choice.
```yaml ```yaml
apiVersion: serving.knative.dev/v1alpha1 apiVersion: serving.knative.dev/v1alpha1
@ -128,9 +132,9 @@ kubectl create -f ./cron-source.yaml
### Inspecting the results ### Inspecting the results
You can now see the final output by inspecting the logs of the `me-event-display` You can now see the final output by inspecting the logs of the
pods. Note that since we set the `CronJobSource` to emit every minute, it `me-event-display` pods. Note that since we set the `CronJobSource` to emit
might take some time for the events to show up in the logs. every minute, it might take some time for the events to show up in the logs.
Let's look at the `me-event-display` log: Let's look at the `me-event-display` log:
@ -168,4 +172,3 @@ Data,
"message": "this is odd!" "message": "this is odd!"
} }
``` ```

View File

@ -72,6 +72,7 @@ spec:
value: "2" value: "2"
--- ---
``` ```
```shell ```shell

View File

@ -48,8 +48,8 @@ Kubernetes cluster has access to. See
[Setting Up A Logging Plugin](./setting-up-a-logging-plugin.md) for details. [Setting Up A Logging Plugin](./setting-up-a-logging-plugin.md) for details.
> **NOTE**: Operators must add the credentials file the Stackdriver agent needs > **NOTE**: Operators must add the credentials file the Stackdriver agent needs
> to the Docker image if their Knative Serving is not built on a > to the Docker image if their Knative Serving is not built on a Google Cloud
> Google Cloud Platform-based cluster or if they want to send logs to another > Platform-based cluster or if they want to send logs to another Google Cloud
> Google Cloud Platform project. See > Platform project. See
> [here](https://cloud.google.com/logging/docs/agent/authorization) for more > [here](https://cloud.google.com/logging/docs/agent/authorization) for more
> information. > information.

File diff suppressed because it is too large Load Diff

View File

@ -78,7 +78,8 @@ If you need a new TLS certificate, you can choose to use one of the following
tools to obtain a certificate from Let's Encrypt: tools to obtain a certificate from Let's Encrypt:
- Setup Certbot to manually obtain Let's Encrypt certificates - Setup Certbot to manually obtain Let's Encrypt certificates
- Setup cert-manager to either manually obtain a certificate, or to automatically provision certificates - Setup cert-manager to either manually obtain a certificate, or to
automatically provision certificates
This page covers details for both of the above options. This page covers details for both of the above options.