Skip to content

Commit 04cf328

Browse files
committed
update README.md
1 parent 03a913e commit 04cf328

File tree

3 files changed

+49
-48
lines changed

3 files changed

+49
-48
lines changed

README-zh.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,4 +183,4 @@ helm upgrade --install kafka \
183183
# Multi-language `README.md`
184184

185185
- [English](README.md)
186-
- [简体中文](README_ZH.md)
186+
- [简体中文](README-zh.md)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,4 +191,4 @@ Add domain name resolution to complete this deployment
191191
# Multi-language `README.md`
192192

193193
- [English](README.md)
194-
- [简体中文](README_ZH.md)
194+
- [简体中文](README-zh.md)

charts/kafka/README.md

Lines changed: 47 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -3,82 +3,89 @@
33
## Prerequisites
44

55
- Kubernetes 1.18+
6-
- Helm 3.3.0+
6+
- Helm 3.3+
77

8-
## 部署案例
8+
## Get Repository Info
99

1010
``` shell
11-
## 添加 helm 仓库
12-
helm repo add kafka-repo https://helm-charts.itboon.top/kafka
11+
helm repo add kafka-repo https://sir5kong.github.io/kafka-docker
1312
helm repo update kafka-repo
1413
```
1514

15+
## Deploy Kafka
16+
17+
### Deploy a single-node cluster
18+
19+
- Turn off persistent storage here, only demonstrate the deployment operation
20+
1621
``` shell
17-
## 部署单节点集群, 仅启动一个 Pod
18-
## 这里关闭持久化存储,仅演示部署效果
1922
helm upgrade --install kafka \
2023
--namespace kafka-demo \
2124
--create-namespace \
2225
--set broker.combinedMode.enabled="true" \
2326
--set broker.persistence.enabled="false" \
2427
kafka-repo/kafka
28+
```
29+
30+
### One broker and one controller cluster
2531

26-
## 部署 1 controller + 1 broker 集群, 并使用持久化存储
32+
``` shell
2733
helm upgrade --install kafka \
2834
--namespace kafka-demo \
2935
--create-namespace \
3036
--set broker.persistence.size="20Gi" \
3137
kafka-repo/kafka
38+
```
39+
40+
> Persistence storage is used by default.
41+
42+
### Deploy a highly available cluster
3243

33-
## 部署高可用集群, 3 controller + 3 broker
44+
``` shell
3445
helm upgrade --install kafka \
3546
--namespace kafka-demo \
3647
--create-namespace \
3748
--set controller.replicaCount="3" \
3849
--set broker.replicaCount="3" \
3950
--set broker.heapOpts="-Xms4096m -Xmx4096m" \
40-
--set broker.resources.requests.memory="6Gi" \
51+
--set broker.resources.requests.memory="8Gi" \
52+
--set broker.resources.limits.memory="16Gi" \
4153
kafka-repo/kafka
54+
```
55+
56+
> More values please refer to [examples/values-production.yml](https://github.com/sir5kong/kafka-docker/raw/main/examples/values-production.yml)
4257
43-
## 生产集群详细 alues 请参考 https://github.com/sir5kong/kafka-docker/raw/main/examples/values-production.yml
58+
### Using LoadBalancer
4459

60+
Enable Kubernetes external cluster access to Kafka brokers.
4561

46-
## 以 LoadBalancer 对集群外暴露
62+
``` shell
4763
helm upgrade --install kafka \
4864
--namespace kafka-demo \
4965
--create-namespace \
5066
--set broker.external.enabled="true" \
5167
--set broker.external.service.type="LoadBalancer" \
5268
--set broker.external.domainSuffix="kafka.example.com" \
5369
kafka-repo/kafka
54-
55-
## 以 NodePort 对集群外暴露
56-
helm upgrade --install kafka \
57-
--namespace kafka-demo \
58-
--create-namespace \
59-
-f https://github.com/sir5kong/kafka-docker/raw/main/examples/values-nodeport.yml \
60-
kafka-repo/kafka
61-
6270
```
6371

64-
## 混部模式 `combined mode`
65-
66-
`process.roles` 可以设置为 `broker` `controller` `broker,controller`, 设为 `broker,controller` 即混部模式。
72+
Add domain name resolution to complete this deployment
6773

68-
混部的服务器部署和运维管理都更加方便,缺点是不方便扩容。例如部署一个高可用集群 3 个 controller 和 3 个 broker,后续如果需要扩容 broker 可以在线操作,不影响业务。如果是混部模式扩容操作会相对复杂,而且会造成业务中断。
74+
## combined mode
6975

70-
以下是官网原文:
76+
- If process.roles is set to broker, the server acts as a broker.
77+
- If process.roles is set to controller, the server acts as a controller.
78+
- If process.roles is set to broker,controller, the server acts as both a broker and a controller.
7179

7280
> Kafka servers that act as both brokers and controllers are referred to as "combined" servers. Combined servers are simpler to operate for small use cases like a development environment. The key disadvantage is that the controller will be less isolated from the rest of the system. For example, it is not possible to roll or scale the controllers separately from the brokers in combined mode. Combined mode is not recommended in critical deployment environments.
7381
7482
### Chart Values
7583

76-
| Key | 类型 | 默认值 | 描述 |
84+
| Key | Type | Default | Description |
7785
|-----|------|---------|-------------|
78-
| broker.combinedMode.enabled | bool | `false` | 是否开启混部模式 |
86+
| broker.combinedMode.enabled | bool | `false` | Whether to enable the combined mode |
7987

8088
``` yaml
81-
## 混部案例
8289
broker:
8390
combinedMode:
8491
enabled: true
@@ -91,39 +98,33 @@ broker:
9198
9299
## Cluster ID
93100
94-
早期版本中,Kafka 会自动初始化数据目录,目前的版本需要提供一个 `Cluster ID` 并手动初始化数据目录:
101+
In earlier versions, Kafka will automatically initialize the data directory, the current version needs to provide a `Cluster ID` and manually initialize the data directory:
95102

96103
``` shell
97104
KAFKA_CLUSTER_ID="$(bin/kafka-storage.sh random-uuid)"
98105
bin/kafka-storage.sh format -t $KAFKA_CLUSTER_ID -c config/kraft/server.properties
99106
```
100107

101-
一个集群所有的节点都需要使用同一个 `Cluster ID`,本项目为了解决这个问题会在首次部署时自动生成一个 `Cluster ID` 并保存到 `Secret`。
102-
103-
## node.id
104-
105-
`Cluster ID` 是集群内所有节点共享,而 `node.id` 是每个节点必须唯一。
106-
107-
例如在 `3 controller 3 broker` 的集群里,controller 的 `node.id` 分别是 `0` `1` `2`,跟 StatefulSet Pod 序号一致,但 broker 就不能再使用同样的 id 了。因此本项目引入 `KAFKA_NODE_ID_OFFSET` 这个变量,默认是 `1000`,所以 broker 的 `node.id` 分别是 `1000` `1001` `1002`。
108+
All nodes in a cluster need to use the same `Cluster ID`. In order to solve this problem, this project will automatically generate a `Cluster ID` and save it to `Secret` when it is deployed for the first time.
108109

109-
## 外部暴露
110+
## External Access
110111

111-
想要在集群外连接 Kafka 服务器,必须把每个 Broker 暴露出去,并且正确配置 `advertised.listeners`
112+
In order to connect to the Kafka server outside the cluster, each Broker must be exposed and `advertised.listeners` must be correctly configured.
112113

113-
这里支持 2 种暴露方式,`NodePort` `LoadBalancer`,有几个 broker 节点就需要对应数量的 `NodePort` `LoadBalancer`
114+
There are two ways to expose, `NodePort` and `LoadBalancer`, each broker node needs a `NodePort` or `LoadBalancer`.
114115

115116
### Chart Values
116117

117-
| Key | 类型 | 默认值 | 描述 |
118+
| Key | Type | Default | Description |
118119
|-----|------|---------|-------------|
119-
| broker.external.enabled | bool | `false` | 是否开启外部暴露 |
120-
| broker.external.service.type | string | `NodePort` | 外部暴露类型,支持 `NodePort` `LoadBalancer` |
121-
| broker.external.service.annotations | object | `{}` | 外部暴露的 service 注解 |
122-
| broker.external.nodePorts | list | `[]` | `NodePort` 端口号,至少提供一个端口号,如果端口数量少于 broker 节点数,则自动递增 |
123-
| broker.external.domainSuffix | string | `kafka.example.com` | 使用 `LoadBalancer` 对外暴露则必须使用域名,broker 对应的外部域名是 `POD_NAME` + `域名后缀`,例如 `kafka-broker-0.kafka.example.com`,部署结束后需要完成域名解析配置 |
120+
| broker.external.enabled | bool | `false` | Whether to enable external access |
121+
| broker.external.service.type | string | `NodePort` | `NodePort` or `LoadBalancer` |
122+
| broker.external.service.annotations | object | `{}` | External serivce annotations |
123+
| broker.external.nodePorts | list | `[]` | Provide at least one port number, if the count of ports is less than the count of broker nodes, it will be automatically incremented |
124+
| broker.external.domainSuffix | string | `kafka.example.com` | If you use `LoadBalancer` for external access, you must use a domain name. The external domain name corresponding to the broker is `POD_NAME` + `domain name suffix`, such as `kafka-broker-0.kafka.example.com`. After the deployment, you need to complete the domain name resolution operation |
124125

125126
``` yaml
126-
## NodePort 案例
127+
## NodePort example
127128
broker:
128129
replicaCount: 3
129130
external:
@@ -138,7 +139,7 @@ broker:
138139
```
139140

140141
``` yaml
141-
## LoadBalancer 案例
142+
## LoadBalancer example
142143
broker:
143144
replicaCount: 3
144145
external:

0 commit comments

Comments
 (0)