Skip to content

Commit 3dfd2bc

Browse files
samodelljmprusiZhimin XiangzwOvOmatzew
authored andcommitted
Release 0.12 (#2128)
* Kourier Installation guide for Knative Serving (#2006) * Adds a new guide describing how to install knative with kourier * Links the knative with kourier installation guide in the main README file * Use kourier-system instead of knative-serving when getting kourier IP * Install Kourier using the included yaml in third_party * Update the Auto TLS instruction (#2083) * initial version of auto tls instruction * Update auto-tls doc to mention namespace cert feature and http01 challenge feature * address comments * fix format * address comments * Format cmd for easy reading&copy (#2120) * Updating to LATEST for Kafka Channel/Source (#2121) * Updating to LATEST for Kafka Channel/Source * Switching the values to 1 replica, but 3 partitions Co-authored-by: Joaquim Moreno Prusi <jmprusi@keepalive.io> Co-authored-by: Zhimin Xiang <zhiminx@google.com> Co-authored-by: 赤月 <974226358@qq.com> Co-authored-by: Matthias Wessendorf <mwessend@redhat.com>
1 parent a6773bc commit 3dfd2bc

File tree

6 files changed

+418
-181
lines changed

6 files changed

+418
-181
lines changed

docs/eventing/samples/kafka/channel/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ You must also have the following tools installed:
1919

2020
Install the `KafkaChannel` sub-component on your Knative Eventing cluster:
2121
```
22-
curl -L "https://github.com/knative/eventing-contrib/releases/download/v0.10.1/kafka-channel.yaml" \
22+
curl -L "https://storage.googleapis.com/knative-releases/eventing-contrib/latest/kafka-channel.yaml" \
2323
| sed 's/REPLACE_WITH_CLUSTER_URL/my-cluster-kafka-bootstrap.kafka:9092/' \
2424
| kubectl apply --filename -
2525
```
@@ -36,8 +36,8 @@ kind: KafkaChannel
3636
metadata:
3737
name: my-kafka-channel
3838
spec:
39-
numPartitions: 1
40-
replicationFactor: 3
39+
numPartitions: 3
40+
replicationFactor: 1
4141
EOF
4242
```
4343

docs/eventing/samples/kafka/source/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ You must ensure that you meet the [prerequisites listed in the Apache Kafka over
1616

1717
1. Install the `KafkaSource` sub-component to your Knative cluster:
1818
```
19-
kubectl apply -f https://github.com/knative/eventing-contrib/releases/download/v0.10.1/kafka-source.yaml
19+
kubectl apply -f https://storage.googleapis.com/knative-releases/eventing-contrib/latest/kafka-source.yaml
2020
2121
```
2222
2. Check that the `kafka-controller-manager-0` pod is running.
@@ -188,7 +188,7 @@ You must ensure that you meet the [prerequisites listed in the Apache Kafka over
188188
```
189189
3. Remove the Apache Kafka Event Controller
190190
```
191-
$ kubectl delete -f https://github.com/knative/eventing-contrib/releases/download/v0.10.1/kafka-importer.yaml
191+
$ kubectl delete -f https://storage.googleapis.com/knative-releases/eventing-contrib/latest/kafka-source.yaml
192192
serviceaccount "kafka-controller-manager" deleted
193193
clusterrole.rbac.authorization.k8s.io "eventing-sources-kafka-controller" deleted
194194
clusterrolebinding.rbac.authorization.k8s.io "eventing-sources-kafka-controller" deleted

docs/install/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ There are several options when installing Knative:
6262
For new users, we recommend the comprehensive install to get you up and running
6363
quickly.
6464

65+
## Installing Knative with Kourier
66+
67+
[Installing Knative with Kourier](./knative-with-kourier.md): In this guide, Knative will be installed with Kourier to replace the Istio Service Mesh, providing a more lightweight and simple Ingress controller. Note that Istio is required for the Knative Eventing component.
68+
6569
### Install guides
6670

6771
Follow these step-by-step guides for setting up Kubernetes and installing
Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
---
2+
title: "Installing Knative with Kourier"
3+
linkTitle: "Kourier Ingress and Knative"
4+
weight: 15
5+
type: "docs"
6+
---
7+
8+
[Kourier](https://github.com/3scale/kourier) is an open-source lightweight Knative Ingress based on Envoy. It's been designed for Knative, without requiring any additional custom resource definitions (CRDs).
9+
10+
This guide walks you through the installation of the latest version of Knative
11+
with Kourier as the ingress.
12+
13+
## Before you Begin
14+
15+
Knative requires a Kubernetes cluster v1.14 or newer, as well as a compatible `kubectl`. This guide assumes that you have already [created a Kubernetes cluster](https://kubernetes.io/docs/setup/) and are using
16+
bash in a Mac or Linux environment.
17+
18+
## Install Knative
19+
20+
Let's do a core install of Knative Serving with the released yaml templates:
21+
22+
1. To install Knative, first install the CRDs by running the following `kubectl apply`
23+
command. This prevents race conditions during the install, which cause intermittent errors:
24+
25+
kubectl apply --filename https://github.com/knative/serving/releases/download/{{< version >}}/serving-crds.yaml
26+
27+
1. To complete the install of Knative and its dependencies, next run the
28+
following `kubectl apply` command:
29+
30+
kubectl apply --filename https://github.com/knative/serving/releases/download/{{< version >}}/serving-core.yaml
31+
32+
1. Monitor the Knative Serving namespace and wait until all of the pods come up with a
33+
`STATUS` of `Running`:
34+
35+
```
36+
kubectl get pods -w -n knative-serving
37+
```
38+
39+
40+
## Install Kourier
41+
42+
Knative default installation uses Istio to handle internal and external traffic. If you are just interested in exposing Knative applications to the external network, a service mesh adds overhead and increases the system complexity. Kourier provides a way to expose your Knative application in a more simple and lightweight way.
43+
44+
You can install Kourier with `kubectl`:
45+
46+
```
47+
kubectl apply \
48+
--filename https://raw.githubusercontent.com/knative/serving/{{< version >}}/third_party/kourier-latest/kourier.yaml
49+
```
50+
51+
## Configuring the Knative ingress class
52+
53+
Kourier only exposes ingresses that have the "kourier" ingress class. By default Knative annotates all the ingresses for Istio but you can change that by patching the "config-network" configmap as follows:
54+
55+
```
56+
kubectl patch configmap/config-network \
57+
-n knative-serving \
58+
--type merge \
59+
-p '{"data":{"ingress.class":"kourier.ingress.networking.knative.dev"}}'
60+
```
61+
62+
## Configuring DNS
63+
64+
Installing Kourier will create a Kubernetes Service with type `LoadBalancer`.
65+
This may take some time to get an IP address assigned, during this process, it
66+
will appear as `<pending>`. You must wait for this IP address to be assigned
67+
before DNS may be set up.
68+
69+
To get the external IP address, use the following command:
70+
71+
```
72+
kubectl get svc kourier -n kourier-system
73+
74+
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
75+
kourier LoadBalancer 10.43.242.100 172.22.0.2 80:31828/TCP 19m
76+
77+
```
78+
79+
This external IP can be used with your DNS provider with a wildcard `A` record;
80+
however, for a basic functioning DNS setup (not suitable for production!) this
81+
external IP address can be added to the `config-domain` ConfigMap in
82+
`knative-serving`. You can edit this with the following command:
83+
84+
```
85+
kubectl edit cm config-domain --namespace knative-serving
86+
```
87+
88+
Given the external IP above, change the content to:
89+
90+
```
91+
apiVersion: v1
92+
kind: ConfigMap
93+
metadata:
94+
name: config-domain
95+
namespace: knative-serving
96+
data:
97+
# xip.io is a "magic" DNS provider, which resolves all DNS lookups for:
98+
# *.{ip}.xip.io to {ip}.
99+
172.22.0.2.xip.io: ""
100+
```
101+
102+
## Deploying an Application
103+
104+
Now that Kourier is running and Knative is configured properly, you can go ahead and create your first Knative application:
105+
106+
1. Create a `Knative Service`
107+
108+
For this demo, a simple helloworld application written in go will be used.
109+
Copy the YAML below to a file called `helloworld-go.yaml` and apply it with
110+
`kubectl`
111+
112+
```yaml
113+
apiVersion: serving.knative.dev/v1
114+
kind: Service
115+
metadata:
116+
name: helloworld-go
117+
namespace: default
118+
spec:
119+
template:
120+
spec:
121+
containers:
122+
- image: gcr.io/knative-samples/helloworld-go
123+
env:
124+
- name: TARGET
125+
value: Go Sample v1
126+
```
127+
128+
```
129+
kubectl apply -f helloworld-go.yaml
130+
```
131+
132+
1. Send a request
133+
134+
`Knative Service`s are exposed via a `Host` header assigned by Knative. By
135+
default, Knative will assign the `Host`:
136+
`{service-name}.{namespace}.{the domain we have setup above}`. You can see this
137+
with:
138+
139+
```
140+
$ kubectl get ksvc helloworld-go
141+
NAME URL LATESTCREATED LATESTREADY READY REASON
142+
helloworld-go http://helloworld-go.default.172.22.0.2.xip.io helloworld-go-ps7lp helloworld-go-ps7lp True
143+
```
144+
145+
You can send a request to the `helloworld-go` service with curl
146+
using the `URL` given above:
147+
148+
```
149+
$ curl http://helloworld-go.default.172.22.0.2.xip.io
150+
151+
Hello Go Sample v1!
152+
```
153+
154+
Congratulations! You have successfully installed Knative with Kourier to manage and route your serverless applications!
155+
156+
## What's next
157+
158+
- Try the
159+
[Getting Started with App Deployment guide](../serving/getting-started-knative-app.md)
160+
for Knative serving.
161+
- Get started with Knative Eventing by walking through one of the
162+
[Eventing Samples](../eventing/samples/).

docs/serving/samples/hello-world/helloworld-java-spring/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ cluster. You can also download a working copy of the sample, by running the
1414
following commands:
1515

1616
```shell
17-
git clone -b "{{< branch >}}" https://github.com/knative/docs knative-docs cd
18-
knative-docs/docs/serving/samples/hello-world/helloworld-java-spring
17+
git clone -b "{{< branch >}}" https://github.com/knative/docs knative-docs
18+
cd knative-docs/docs/serving/samples/hello-world/helloworld-java-spring
1919
```
2020

2121
## Before you begin

0 commit comments

Comments
 (0)