mirror of https://github.com/knative/docs.git
Format markdown (#1600)
* Format markdown Produced via: `prettier --write --prose-wrap=always $(find -name '*.md' | grep -v vendor | grep -v .github)` /assign @samodell * Remove backticks The indentation and backticks are redundant, so the backticks show up in the `<pre>` block.
This commit is contained in:
parent
e850446660
commit
14cb5fb401
|
@ -35,7 +35,8 @@ to run multiple installation commands.
|
|||
|
||||
## Installing Istio
|
||||
|
||||
> Note: [Ambassador](https://www.getambassador.io/) and [Gloo](https://gloo.solo.io/) are available as an alternative to Istio.
|
||||
> Note: [Ambassador](https://www.getambassador.io/) and
|
||||
> [Gloo](https://gloo.solo.io/) are available as an alternative to Istio.
|
||||
> [Click here](./Knative-with-Ambassador.md) to install Knative with Ambassador.
|
||||
> [Click here](./Knative-with-Gloo.md) to install Knative with Gloo.
|
||||
|
||||
|
|
|
@ -133,7 +133,8 @@ recommended configuration for a cluster is:
|
|||
|
||||
## Installing Istio
|
||||
|
||||
> Note: [Ambassador](https://www.getambassador.io/) and [Gloo](https://gloo.solo.io/) are available as an alternative to Istio.
|
||||
> Note: [Ambassador](https://www.getambassador.io/) and
|
||||
> [Gloo](https://gloo.solo.io/) are available as an alternative to Istio.
|
||||
> [Click here](./Knative-with-Ambassador.md) to install Knative with Ambassador.
|
||||
> [Click here](./Knative-with-Gloo.md) to install Knative with Gloo.
|
||||
|
||||
|
|
|
@ -6,31 +6,31 @@ type: "docs"
|
|||
---
|
||||
|
||||
[Ambassador](https://www.getambassador.io/) is a popular Kubernetes-native,
|
||||
open-source API gateway built on
|
||||
[Envoy Proxy](https://www.envoyproxy.io/).
|
||||
open-source API gateway built on [Envoy Proxy](https://www.envoyproxy.io/).
|
||||
|
||||
This guide walks you through the installation of the latest version of Knative
|
||||
using pre-built images.
|
||||
using pre-built images.
|
||||
|
||||
## Before you Begin
|
||||
|
||||
Knative requires a Kubernetes cluster v1.11 or newer with the
|
||||
[MutatingAdmissionWebhook admission controller](https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#how-do-i-turn-on-an-admission-controller)
|
||||
enabled.
|
||||
Knative requires a Kubernetes cluster v1.11 or newer with the
|
||||
[MutatingAdmissionWebhook admission controller](https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#how-do-i-turn-on-an-admission-controller)
|
||||
enabled.
|
||||
|
||||
`kubectl` v1.10 is also required.
|
||||
`kubectl` v1.10 is also required.
|
||||
|
||||
This guide assumes that you have already
|
||||
This guide assumes that you have already
|
||||
[created a Kubernetes cluster](https://kubernetes.io/docs/setup/) and are using
|
||||
bash in a Mac or Linux environment.
|
||||
bash in a Mac or Linux environment.
|
||||
|
||||
## Install Ambassador
|
||||
|
||||
Knative was originally built using Istio to handle cluster networking. While
|
||||
the Istio gateway provides the functionality needed to serve requests to your
|
||||
application, installing a service mesh to handle north-south traffic carries
|
||||
some operational overhead with it. Ambassador provides a way to get traffic to
|
||||
your Knative application without the overhead or complexity of a full service mesh.
|
||||
Knative was originally built using Istio to handle cluster networking. While the
|
||||
Istio gateway provides the functionality needed to serve requests to your
|
||||
application, installing a service mesh to handle north-south traffic carries
|
||||
some operational overhead with it. Ambassador provides a way to get traffic to
|
||||
your Knative application without the overhead or complexity of a full service
|
||||
mesh.
|
||||
|
||||
You can install Ambassador with `kubectl`:
|
||||
|
||||
|
@ -39,8 +39,8 @@ kubectl apply -f https://getambassador.io/yaml/ambassador/ambassador-knative.yam
|
|||
kubectl apply -f https://getambassador.io/yaml/ambassador/ambassador-service.yaml
|
||||
```
|
||||
|
||||
Ambassador will watch for and create routes based off of Knative
|
||||
`ClusterIngress` resources. These will then be accessible over the external IP
|
||||
Ambassador will watch for and create routes based off of Knative
|
||||
`ClusterIngress` resources. These will then be accessible over the external IP
|
||||
address of the Ambassador service you just created.
|
||||
|
||||
Get this external IP address and save it in a variable named `AMBASSADOR_IP`
|
||||
|
@ -56,45 +56,43 @@ $ AMBASSADOR_IP=35.229.120.99
|
|||
|
||||
## Install Knative
|
||||
|
||||
Now that Ambassador is installed to handle ingress to your serverless
|
||||
Now that Ambassador is installed to handle ingress to your serverless
|
||||
applications, you need to install Knative to manage them.
|
||||
|
||||
The following commands install all available Knative components as well as the
|
||||
standard set of observability plugins. To customize your Knative installation,
|
||||
The following commands install all available Knative components as well as the
|
||||
standard set of observability plugins. To customize your Knative installation,
|
||||
see Performing a Custom Knative Installation.
|
||||
|
||||
1. To install Knative, first install the CRDs by running the `kubectl apply`
|
||||
command once with the `-l knative.dev/crd-install=true` flag. This prevents
|
||||
race conditions during the install, which cause intermittent errors:
|
||||
1. To install Knative, first install the CRDs by running the `kubectl apply`
|
||||
command once with the `-l knative.dev/crd-install=true` flag. This prevents
|
||||
race conditions during the install, which cause intermittent errors:
|
||||
|
||||
```
|
||||
kubectl apply -l knative.dev/crd-install=true \
|
||||
--filename https://github.com/knative/serving/releases/download/v0.7.1/serving.yaml \
|
||||
--filename https://github.com/knative/build/releases/download/v0.7.1/build.yaml \
|
||||
--filename https://github.com/knative/serving/releases/download/v0.7.1/monitoring.yaml
|
||||
```
|
||||
2. To complete the install of Knative and it's dependencies, run the
|
||||
`kubectl apply` command again, this time without the
|
||||
`-l knative.dev/crd-install=true`:
|
||||
kubectl apply -l knative.dev/crd-install=true \
|
||||
--filename https://github.com/knative/serving/releases/download/v0.7.1/serving.yaml \
|
||||
--filename https://github.com/knative/build/releases/download/v0.7.1/build.yaml \
|
||||
--filename https://github.com/knative/serving/releases/download/v0.7.1/monitoring.yaml
|
||||
|
||||
```
|
||||
kubectl apply --filename https://github.com/knative/serving/releases/download/v0.7.1 serving.yaml --selector networking.knative.dev/certificate-provider!=cert-manager \
|
||||
--filename https://github.com/knative/build/releases/download/v0.7.1/build.yaml \
|
||||
--filename https://github.com/knative/serving/releases/download/v0.7.1/monitoring.yaml
|
||||
```
|
||||
> **Notes**:
|
||||
>
|
||||
> - By default, the Knative Serving component installation (`serving.yaml`)
|
||||
> includes a controller for
|
||||
> [enabling automatic TLS certificate provisioning](../serving/using-auto-tls.md).
|
||||
> If you do intend on immediately enabling auto certificates in Knative,
|
||||
> you can remove the
|
||||
> `--selector networking.knative.dev/certificate-provider!=cert-manager`
|
||||
> statement to install the controller. Otherwise, you can choose to install
|
||||
> the auto certificates feature and controller at a later time.
|
||||
2. To complete the install of Knative and it's dependencies, run the
|
||||
`kubectl apply` command again, this time without the
|
||||
`-l knative.dev/crd-install=true`:
|
||||
|
||||
3. Monitor the Knative namespaces and wait until all of the pods come up with
|
||||
a `STATUS` of `Running`:
|
||||
kubectl apply --filename https://github.com/knative/serving/releases/download/v0.7.1 serving.yaml --selector networking.knative.dev/certificate-provider!=cert-manager \
|
||||
--filename https://github.com/knative/build/releases/download/v0.7.1/build.yaml \
|
||||
--filename https://github.com/knative/serving/releases/download/v0.7.1/monitoring.yaml
|
||||
|
||||
> **Notes**:
|
||||
>
|
||||
> - By default, the Knative Serving component installation (`serving.yaml`)
|
||||
> includes a controller for
|
||||
> [enabling automatic TLS certificate provisioning](../serving/using-auto-tls.md).
|
||||
> If you do intend on immediately enabling auto certificates in Knative,
|
||||
> you can remove the
|
||||
> `--selector networking.knative.dev/certificate-provider!=cert-manager`
|
||||
> statement to install the controller. Otherwise, you can choose to
|
||||
> install the auto certificates feature and controller at a later time.
|
||||
|
||||
3. Monitor the Knative namespaces and wait until all of the pods come up with a
|
||||
`STATUS` of `Running`:
|
||||
|
||||
```
|
||||
kubectl get pods -w --all-namespaces
|
||||
|
@ -102,60 +100,60 @@ race conditions during the install, which cause intermittent errors:
|
|||
|
||||
## Deploying an Application
|
||||
|
||||
Now that Knative and Ambassador are running, you can use them to manage and
|
||||
Now that Knative and Ambassador are running, you can use them to manage and
|
||||
route traffic to a serverless application.
|
||||
|
||||
1. Create a `Knative Service`
|
||||
|
||||
For this demo, a simple helloworld application written in go will be used.
|
||||
Copy the YAML below to a file called `helloworld-go.yaml` and apply it
|
||||
with `kubectl`
|
||||
Copy the YAML below to a file called `helloworld-go.yaml` and apply it with
|
||||
`kubectl`
|
||||
|
||||
```yaml
|
||||
apiVersion: serving.knative.dev/v1alpha1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: helloworld-go
|
||||
namespace: default
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- image: gcr.io/knative-samples/helloworld-go
|
||||
env:
|
||||
- name: TARGET
|
||||
value: Go Sample v1
|
||||
```
|
||||
```yaml
|
||||
apiVersion: serving.knative.dev/v1alpha1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: helloworld-go
|
||||
namespace: default
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- image: gcr.io/knative-samples/helloworld-go
|
||||
env:
|
||||
- name: TARGET
|
||||
value: Go Sample v1
|
||||
```
|
||||
|
||||
```
|
||||
kubectl apply -f helloworld-go.yaml
|
||||
```
|
||||
```
|
||||
kubectl apply -f helloworld-go.yaml
|
||||
```
|
||||
|
||||
2. Send a request
|
||||
|
||||
`Knative Service`s are exposed via a `Host` header assigned by Knative.
|
||||
By default, Knative will assign the
|
||||
`Host`: `{service-name}.{namespace}.example.com`. You can verify this by
|
||||
checking the `EXTERNAL-IP` of the `helloworld-go` service created above.
|
||||
`Knative Service`s are exposed via a `Host` header assigned by Knative. By
|
||||
default, Knative will assign the `Host`:
|
||||
`{service-name}.{namespace}.example.com`. You can verify this by checking the
|
||||
`EXTERNAL-IP` of the `helloworld-go` service created above.
|
||||
|
||||
```
|
||||
$ kubectl get service helloworld-go
|
||||
```
|
||||
$ kubectl get service helloworld-go
|
||||
|
||||
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
|
||||
helloworld-go ExternalName <none> helloworld-go.default.example.com <none> 32m
|
||||
```
|
||||
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
|
||||
helloworld-go ExternalName <none> helloworld-go.default.example.com <none> 32m
|
||||
```
|
||||
|
||||
Ambassador will use this `Host` header to route requests to the correct
|
||||
service. You can send a request to the `helloworld-go` service with curl
|
||||
using the `Host` and `AMBASSADOR_IP` from above:
|
||||
Ambassador will use this `Host` header to route requests to the correct
|
||||
service. You can send a request to the `helloworld-go` service with curl
|
||||
using the `Host` and `AMBASSADOR_IP` from above:
|
||||
|
||||
```
|
||||
$ curl -H "Host: helloworld-go.default.example.com" $AMBASSADOR_IP
|
||||
```
|
||||
$ curl -H "Host: helloworld-go.default.example.com" $AMBASSADOR_IP
|
||||
|
||||
Hello Go Sample v1!
|
||||
```
|
||||
Hello Go Sample v1!
|
||||
```
|
||||
|
||||
Congratulations! You have successfully installed Knative with Ambassador to
|
||||
Congratulations! You have successfully installed Knative with Ambassador to
|
||||
manage and route to serverless applications!
|
||||
|
||||
## What's next
|
||||
|
@ -163,7 +161,5 @@ manage and route to serverless applications!
|
|||
- Try the
|
||||
[Getting Started with App Deployment guide](./getting-started-knative-app/)
|
||||
for Knative serving.
|
||||
- Take a look at the rest of what
|
||||
- Take a look at the rest of what
|
||||
[Knative has to offer](https://knative.dev/docs/index.html)
|
||||
|
||||
|
||||
|
|
|
@ -118,7 +118,7 @@ the recommended configuration for a cluster is:
|
|||
1. Create a Kubernetes cluster on GKE with the required specifications:
|
||||
|
||||
> Note: If this setup is for development, or a non-Istio networking layer (e.g.
|
||||
> [Ambassador](./Knative-with-Ambassador.md) or [Gloo](./Knative-with-Gloo.md))
|
||||
> [Ambassador](./Knative-with-Ambassador.md) or [Gloo](./Knative-with-Gloo.md))
|
||||
> will be used, then you can remove the `--addons` line below.
|
||||
|
||||
> Note: If you want to use [Auto TLS feature](../serving/using-auto-tls.md), you
|
||||
|
|
|
@ -58,7 +58,8 @@ minikube start --memory=8192 --cpus=6 \
|
|||
|
||||
## Installing Istio
|
||||
|
||||
> Note: [Ambassador](https://www.getambassador.io/) and [Gloo](https://gloo.solo.io/) are available as an alternative to Istio.
|
||||
> Note: [Ambassador](https://www.getambassador.io/) and
|
||||
> [Gloo](https://gloo.solo.io/) are available as an alternative to Istio.
|
||||
> [Click here](./Knative-with-Ambassador.md) to install Knative with Ambassador.
|
||||
> [Click here](./Knative-with-Gloo.md) to install Knative with Gloo.
|
||||
|
||||
|
|
|
@ -29,9 +29,9 @@ Currently, three options exist which provide this functionality:
|
|||
## Installing Knative with Ambassador
|
||||
|
||||
[Installing with Ambassador](./Knative-with-Ambassador.md) gives us an
|
||||
alternative to installing a service mesh for routing to applications
|
||||
with the Knative Serving component. Note that Istio is required for the
|
||||
Knative Eventing component.
|
||||
alternative to installing a service mesh for routing to applications with the
|
||||
Knative Serving component. Note that Istio is required for the Knative Eventing
|
||||
component.
|
||||
|
||||
## Installing Knative with Gloo
|
||||
|
||||
|
|
Loading…
Reference in New Issue