Skip to content

Commit 81e68c8

Browse files
authored
Merge pull request #99 from hzxuzhonghu/update-quickstart
Update waypoint install
2 parents 69c2779 + bfd07c8 commit 81e68c8

File tree

3 files changed

+86
-73
lines changed

3 files changed

+86
-73
lines changed

content/en/docs/architecture/architecture.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ type: docs
1414
![image](/docs/architecture/kmesh-arch.svg)
1515
The software architecture of Kmesh consists of the following components:
1616

17-
- Kmesh-daemon: The management program responsible for Kmesh lifecycle management, XDS protocol integration, observability, and other functions.
18-
- Ebpf orchestiation: The traffic orchestration implemented based on eBPF, including routing, canary deployments, load balancing, and more.
19-
- waypoint: Modify istio's waypoint to adapt to Kmesh protocols, responsible for L7 traffic governance.
17+
- Kmesh-daemon: The daemon responsible for eBPF Orchestration lifecycle management, xDS protocol integration, observability, and other functions.
18+
- eBPF Orchestration: The traffic orchestration implemented with eBPF, including dynamic routing, canary deployments, load balancing, etc.
19+
- Waypoint: Based on istio's waypoint to adapt to Kmesh protocols, responsible for L7 traffic management.

content/en/docs/userguide/install_waypoint.md

Lines changed: 30 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ type: docs
1111

1212
---
1313

14-
To try capabilities of Kmesh L7, this is the basic doc to install waypoint.
14+
If you want to make use of Kmesh L7 features, this is the prerequisites to install waypoint.
1515

1616
### Preparation
1717

@@ -57,7 +57,7 @@ reviews-v3-5c5cc7b6d-q4r5h 1/1 Running 0 72s
5757
sleep-9454cc476-86vgb 1/1 Running 0 62s
5858
```
5959

60-
5. Test boofinfo works as expected:
60+
5. Test bookinfo works as expected:
6161

6262
```bash
6363
[root@ ~]# kubectl exec deploy/sleep -- curl -s http://productpage:9080/ | grep -o "<title>.*</title>"
@@ -66,39 +66,31 @@ sleep-9454cc476-86vgb 1/1 Running 0 62s
6666

6767
### Install waypoint
6868

69-
Waypoints can be used at three granularities: namespace, service and pod. Also you could install multiple waypoints with different granularities under the same namespace.
69+
Waypoints can be used at three granularity: namespace, service and pod. And you could also install multiple waypoints at different granularity within a namespace.
70+
Below we will learn how to deploy different waypoints for different granularity. We can use `kmeshctl waypoint` subcommands to generate or apply waypoint.
7071

71-
#### Install waypoint in service granularity:
72+
To enable a namespace, service or pod to use a waypoint, add the `istio.io/use-waypoint` label with a value of the waypoint name.
73+
We can also specify a customized waypoint image with `--image`, by default this default to `ghcr.io/kmesh-net/waypoint:{VERSION}`
7274

73-
Deploy a waypoint for service `reviews`, so any traffic to that service will be mediated by that waypoint proxy
75+
#### Configure a waypoint for a specific service:
7476

75-
***NOTE: There are breaking changes in waypoint capture mode between istio 1.22 and istio 1.21, so the following commands need to be run on at least istio 1.22.***
77+
Deploy a waypoint `reviews-svc-waypoint` for service `reviews`, so any traffic to `reviews` from a client managed by Kmesh will be mediated by the waypoint proxy
7678

7779
```bash
78-
[root@ ~]# istioctl x waypoint apply -n default --name reviews-svc-waypoint
79-
```
80-
81-
Label the `reviews` service to use the `reviews-svc-waypoint` waypoint:
80+
[root@ ~]# kmeshctl waypoint apply --for service -n default --name=reviews-svc-waypoint
8281

83-
```bash
84-
[root@ ~]# kubectl label service reviews istio.io/use-waypoint=reviews-svc-waypoint
82+
waypoint default/reviews-svc-waypoint applied
8583
```
8684

87-
You can use `kubectl get pods` to see all the pods except waypoint are ready. **Then replace the waypoint image with the Kmesh customized image.** Based on istio-proxy, Kmesh adds an customized listener filter called [Kmesh_tlv](https://github.com/kmesh-net/waypoint/tree/master/source/extensions/filters/listener/kmesh_tlv), which will parse the custom TLV protocol encoded by Kmesh and obtain the target address and metadata to connect L4 and L7.
85+
Label the `reviews` service to use `reviews-svc-waypoint` waypoint:
8886

8987
```bash
90-
[root@ ~]# kubectl get gateways.gateway.networking.k8s.io
91-
NAME CLASS ADDRESS PROGRAMMED AGE
92-
reviews-svc-waypoint istio-waypoint 10.96.198.98 True 30m
93-
```
88+
[root@ ~]# $ kubectl label service reviews istio.io/use-waypoint=reviews-svc-waypoint
9489

95-
**image replacement**: Add annotation "sidecar.istio.io/proxyImage: ghcr.io/kmesh-net/waypoint:latest" to the `reviews-svc-waypoint` gateway.
96-
97-
```bash
98-
[root@ ~]# kubectl annotate gateway reviews-svc-waypoint sidecar.istio.io/proxyImage=ghcr.io/kmesh-net/waypoint:latest
90+
service/reviews labeled
9991
```
10092

101-
Then gateway pod will restart. Now Kmesh is L7 enabled!
93+
After the waypoint is up and running, Kmesh L7 is enabled!
10294

10395
```bash
10496
[root@ ~]# kubectl get pods
@@ -114,40 +106,29 @@ sleep-5577c64d7c-n7rxp 1/1 Running 0 30m
114106
```
115107

116108

117-
#### Install waypoint in namespace granularity:
109+
#### Configure waypoint for a specific namespace:
118110

119-
```bash
120-
[root@ ~]# istioctl x waypoint apply -n default --name default-ns-waypoint
121-
waypoint default/default-ns-waypoint applied
122-
123-
[root@ ~]# kubectl label namespace default istio.io/use-waypoint=default-ns-waypoint
124-
namespace/default labeled
125-
```
126-
127-
***NOTE: Also need to replace the original image of waypoint with the Kmesh customized image.***
111+
Deploy a waypoint for the `default` namespace with default name `waypoint`. By specifying `--enroll-namespace`, the namespace will be labeled with `istio.io/use-waypoint=waypoint`
128112

129113
```bash
130-
[root@ ~]# kubectl annotate gateway default-ns-waypoint sidecar.istio.io/proxyImage=ghcr.io/kmesh-net/waypoint:latest
114+
[root@ ~]# kmeshctl waypoint apply -n default --enroll-namespace
115+
waypoint default/waypoint applied
116+
namespace default labels with "istio.io/use-waypoint: waypoint"
131117
```
132118

133-
Then any requests from any pods using the Kmesh, to any service running in `default` namespace, will be routed through that waypoint for L7 processing and policy enforcement.
119+
#### Configure waypoint for a specific pod:
120+
121+
Deploy a waypoint called reviews-v2-pod-waypoint for the `reviews-v2-5979c6fc9c-72bst` pod.
134122

135-
#### Install waypoint in pod granularity:
136123

137124
```bash
138-
[root@ ~]# istioctl x waypoint apply -n default --name reviews-v2-pod-waypoint --for workload
125+
[root@ ~]# kmeshctl waypoint apply -n default --name reviews-v2-pod-waypoint --for workload
139126
waypoint default/reviews-v2-pod-waypoint applied
140127
# Label the `reviews-v2` pod to use `reviews-v2-pod-waypoint` waypoint.
141-
[root@ ~]# kubectl label pod -l version=v2,app=reviews istio.io/use-waypoint=reviews-v2-pod-waypoint
128+
[root@ ~]# kubectl label pod reviews-v2-5979c6fc9c-72bst istio.io/use-waypoint=reviews-v2-pod-waypoint
142129
pod/reviews-v2-5b667bcbf8-spnnh labeled
143130
```
144131

145-
***NOTE: Also need to replace the original image of waypoint with the Kmesh customized image.***
146-
147-
```bash
148-
[root@ ~]# kubectl annotate gateway reviews-v2-pod-waypoint sidecar.istio.io/proxyImage=ghcr.io/kmesh-net/waypoint:latest
149-
```
150-
151132
Now any requests from pods in the Kmesh to the `reviews-v2` pod IP will be routed through `reviews-v2-pod-waypoint` waypoint for L7 processing and policy enforcement.
152133

153134
### Cleanup
@@ -156,22 +137,22 @@ If you are **not** planning to explore any follow-on tasks, go on with the clean
156137

157138
1. Remove waypoint:
158139

159-
#### Remove waypoint in service granularity
140+
#### Remove waypoint for service
160141
```bash
161-
[root@ ~]# istioctl x waypoint delete reviews-svc-waypoint
142+
[root@ ~]# kmeshctl waypoint delete reviews-svc-waypoint
162143
[root@ ~]# kubectl label service reviews istio.io/use-waypoint-
163144
```
164-
#### Remove waypoint in namespace granularity
145+
#### Remove waypoint for namespace
165146

166147
```bash
167-
[root@ ~]# istioctl x waypoint delete default-ns-waypoint
148+
[root@ ~]# kmeshctl waypoint delete waypoint
168149
[root@ ~]# kubectl label namespace default istio.io/use-waypoint-
169150
```
170151

171-
#### Remove waypoint in pod granularity
152+
#### Remove waypoint for pod
172153

173154
```bash
174-
[root@ ~]# istioctl x waypoint delete reviews-v2-pod-waypoint
155+
[root@ ~]# kmeshctl waypoint delete reviews-v2-pod-waypoint
175156
[root@ ~]# kubectl label pod -l version=v2,app=reviews istio.io/use-waypoint-
176157
```
177158

content/zh/docs/userguide/try_waypoint.md

Lines changed: 53 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ type: docs
1111

1212
---
1313

14+
如果想使用Kmesh双引擎模式的七层治理功能,请参考本文档安装waypoint。
15+
1416
### 准备
1517

1618
1. 部署Kmesh:
@@ -64,31 +66,61 @@ sleep-9454cc476-86vgb 1/1 Running 0 62s
6466

6567
6. 部署waypoint:
6668

67-
为service account `bookinfo-reviews` 部署一个waypoint,这样所有发往service `reviews` 的流量都将被这个waypoint proxy接管
69+
Waypoint可以在三个粒度级别使用:命名空间、服务和Pod。您还可以在一个命名空间内以不同粒度安装多个waypoint。 以下是我们将学习如何为不同粒度部署不同waypoint的方法。我们可以使用`kmeshctl waypoint`子命令生成waypoint。
6870

69-
```bash
70-
[root@ ~]# istioctl x waypoint apply --service-account bookinfo-reviews
71-
[root@ ~]# kubectl get pods
72-
NAME READY STATUS RESTARTS AGE
73-
bookinfo-reviews-istio-waypoint-5d544b6d54-v5tc9 1/1 Running 0 4s
74-
details-v1-5f4d584748-bz42z 1/1 Running 0 4m35s
75-
productpage-v1-564d4686f-2rjqc 1/1 Running 0 4m35s
76-
ratings-v1-686ccfb5d8-dnzkf 1/1 Running 0 4m35s
77-
reviews-v1-86896b7648-fqm4z 1/1 Running 0 4m35s
78-
reviews-v2-b7dcd98fb-nn42q 1/1 Running 0 4m35s
79-
reviews-v3-5c5cc7b6d-q4r5h 1/1 Running 0 4m35s
80-
sleep-9454cc476-86vgb 1/1 Running 0 4m25s
81-
```
71+
要配置命名空间、服务或Pod waypoint,请添加带有waypoint名称的`istio.io/use-waypoint`标签。 我们还可以使用`--image`指定自定义的waypoint镜像,默认情况下,这个镜像为ghcr.io/kmesh-net/waypoint:{VERSION}。
8272

83-
用Kmesh自定义的镜像替换waypoint的原生镜像。基于istio-proxy,Kmesh增加了一个名为[Kmesh_tlv](https://github.com/kmesh-net/waypoint/tree/master/source/extensions/filters/listener/kmesh_tlv)的自定义listener filter,它会解析Kmesh编码的自定义TLV协议,从中获取目标地址以及元数据,从而能够连接L4和L7
73+
- 为特定服务配置waypoint:
8474

85-
```bash
86-
[root@ ~]# kubectl get gateways.gateway.networking.k8s.io
87-
NAME CLASS ADDRESS PROGRAMMED AGE
88-
bookinfo-reviews istio-waypoint 10.96.207.125 True 8m36s
89-
```
75+
为服务reviews部署waypoint reviews-svc-waypoint,这样任何由Kmesh管理的客户端访问reviews的流量都会通过waypoint代理进行处理。
76+
77+
```bash
78+
[root@ ~]# kmeshctl waypoint apply --for service -n default --name=reviews-svc-waypoint
79+
80+
waypoint default/reviews-svc-waypoint applied
81+
```
82+
83+
为服务打上标签,使用刚创建的waypoint
84+
85+
```bash
86+
[root@ ~]# $ kubectl label service reviews istio.io/use-waypoint=reviews-svc-waypoint
87+
88+
service/reviews labeled
89+
```
90+
Waypoint 运行后, Kmesh 七层治理就绪!
91+
92+
```bash
93+
[root@ ~]# kubectl get pods
94+
NAME READY STATUS RESTARTS AGE
95+
details-v1-cdd874bc9-xcdnj 1/1 Running 0 30m
96+
productpage-v1-5bb9985d4d-z8cws 1/1 Running 0 30m
97+
ratings-v1-6484d64bbc-pkv6h 1/1 Running 0 30m
98+
reviews-svc-waypoint-8cb4bdbf-9d5mj 1/1 Running 0 30m
99+
reviews-v1-598f9b58fc-2rw7r 1/1 Running 0 30m
100+
reviews-v2-5979c6fc9c-72bst 1/1 Running 0 30m
101+
reviews-v3-7bbb5b9cf7-952d8 1/1 Running 0 30m
102+
sleep-5577c64d7c-n7rxp 1/1 Running 0 30m
103+
```
104+
- 为特定命名空间配置waypoint:
105+
106+
为default命名空间部署一个名为`waypoint`的waypoint。通过指定`--enroll-namespace`,该命名空间将被打上标签`istio.io/use-waypoint=waypoint`
107+
```bash
108+
[root@ ~]# kmeshctl waypoint apply -n default --enroll-namespace
109+
waypoint default/waypoint applied
110+
namespace default labels with "istio.io/use-waypoint: waypoint"
111+
```
112+
113+
- 为特定pod配置waypoint:
114+
115+
为reviews-v2-5979c6fc9c-72bst Pod部署一个名为reviews-v2-pod-waypoint的waypoint。
90116

91-
`bookinfo-reviews` gateway的annotations当中添加sidecar.istio.io/proxyImage: ghcr.io/kmesh-net/waypoint-{arch}:v0.3.0,将{arch}转换为所在宿主机的架构,当前可选的取值为x86和arm。在gateway pod重启之后,Kmesh就具备L7能力了!
117+
```bash
118+
[root@ ~]# kmeshctl waypoint apply -n default --name reviews-v2-pod-waypoint --for workload
119+
waypoint default/reviews-v2-pod-waypoint applied
120+
# Label the `reviews-v2` pod to use `reviews-v2-pod-waypoint` waypoint.
121+
[root@ ~]# kubectl label pod reviews-v2-5979c6fc9c-72bst istio.io/use-waypoint=reviews-v2-pod-waypoint
122+
pod/reviews-v2-5b667bcbf8-spnnh labeled
123+
```
92124

93125
### 应用基于权重的路由
94126

0 commit comments

Comments
 (0)