Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release docs #6

Merged
merged 14 commits into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Docker Publish

on:
workflow_dispatch: ## on button click
schedule:
- cron: '0 1/11 * * *'
push:
paths:
- Dockerfile
Expand Down
31 changes: 30 additions & 1 deletion .github/workflows/publish-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,33 @@ jobs:
# Or use mhausenblas/mkdocs-deploy-gh-pages@nomaterial to build without the mkdocs-material theme
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GOOGLE_ANALYTICS_KEY: ${{ secrets.GOOGLE_ANALYTICS_KEY }}
GOOGLE_ANALYTICS_KEY: ${{ vars.GOOGLE_ANALYTICS_KEY }}

oss-sync:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
with:
# fetch-depth: 0
ref: 'gh-pages'
-
name: Upload to OSS
if: ${{ vars.OSS_MIRROR_ENABLED == 'true' }}
shell: bash
env:
DL_URL_OSS: "https://gosspublic.alicdn.com/ossutil/1.7.1/ossutil64"
OSS_KEY_ID: "${{ secrets.OSS_KEY_ID }}"
OSS_KEY_SECRET: "${{ secrets.OSS_KEY_SECRET }}"
OSS_EP: "${{ vars.OSS_EP }}"
OSS_BUCKET: "${{ vars.PAGES_OSS_BUCKET }}"
MIRROR_HOST: "${{ vars.MIRROR_HOST }}"
run: |
export ALIOSS="${HOME}/bin/ossutil"
mkdir -p $(dirname $ALIOSS)
curl -o $ALIOSS -L $DL_URL_OSS
chmod a+rx $ALIOSS
$ALIOSS config -e $OSS_EP -i $OSS_KEY_ID -k $OSS_KEY_SECRET
repo_name="${GITHUB_REPOSITORY#*/}"
$ALIOSS cp -rf ./ "oss://${OSS_BUCKET}/${repo_name}/"
2 changes: 1 addition & 1 deletion charts/kafka/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: kafka
description: Helm chart for Apache Kafka.
type: application

version: 13.1.2
version: 13.2.0
appVersion: v3.5.1

maintainers:
Expand Down
10 changes: 5 additions & 5 deletions docs/compose.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ services:
- kafka-data:/opt/kafka/data
environment:
- KAFKA_HEAP_OPTS=-Xmx512m -Xms512m
## 将下面 ${KAFKA_BROKER_EXTERNAL_HOST} 替换成你自己的外部主机名,可以是域名或端口
## 将下面 ${KAFKA_BROKER_EXTERNAL_HOST} 替换成你自己的外部主机名,可以是域名或IP地址
## - KAFKA_BROKER_EXTERNAL_HOST=kafka.example.com
- KAFKA_BROKER_EXTERNAL_HOST=${KAFKA_BROKER_EXTERNAL_HOST}
- KAFKA_BROKER_EXTERNAL_PORT=29092
Expand All @@ -41,11 +41,11 @@ services:

```

传入 `KAFKA_BROKER_EXTERNAL_HOST` 变量后,启动脚本会修改相关网络配置,例如 `listeners`、`advertised.listeners`、`listener.security.protocol.map`,需要自定义
传入 `KAFKA_BROKER_EXTERNAL_HOST` 变量后,启动脚本会修改相关网络配置,例如 `listeners`、`advertised.listeners`、`listener.security.protocol.map`,详情请参考[环境变量和配置](../env)

## 外部网络详细配置
## 高级网络配置

下面这个案例跟上文的案例是等效的
下面这个案例列出了详细的 Kafka 网络配置,部署后的效果与上文的案例是等效的

``` yaml
version: "3"
Expand All @@ -66,7 +66,7 @@ services:
- KAFKA_CFG_INTER_BROKER_LISTENER_NAME=INTERNAL
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT
- KAFKA_CFG_LISTENERS=CONTROLLER://:9091,INTERNAL://:9092,EXTERNAL://:29092
## 将下面 ${KAFKA_BROKER_EXTERNAL_HOST} 替换成你自己的外部主机名,可以是域名或端口
## 将下面 ${KAFKA_BROKER_EXTERNAL_HOST} 替换成你自己的外部主机名,可以是域名或IP地址
- KAFKA_CFG_ADVERTISED_LISTENERS=INTERNAL://:9092,EXTERNAL://${KAFKA_BROKER_EXTERNAL_HOST}:29092
- KAFKA_CFG_NODE_ID=1
- KAFKA_CFG_CONTROLLER_QUORUM_VOTERS=1@kafka:9091
Expand Down
6 changes: 3 additions & 3 deletions docs/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ docker run -d --name demo-kafka-server \

## 持久化

数据存储路径 `/opt/kafka/data`,像下面这个案例一样挂载一下:
数据存储路径 `/opt/kafka/data`,挂载数据卷:

``` shell
docker volume create demo-kafka-data
Expand All @@ -42,5 +42,5 @@ docker run -d --name demo-kafka-server \

## 下一步

- [环境变量和配置](/env)
- [Docker Compose 启动 Kafka](/compose)
- [Docker Compose 启动 Kafka](../compose)
- [环境变量和配置](../env)
2 changes: 1 addition & 1 deletion docs/env.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ Variable examples:

> `log.dir` 和 `log.dirs` 已经被锁定,无法使用环境变量进行覆盖。

配置案例请参考 [Docker Compose 启动 Kafka](/compose)
具体配置案例请参考 [Docker Compose 启动 Kafka](../compose)
2 changes: 1 addition & 1 deletion docs/helm.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# helm chart 部署 kafka
# Helm 部署 Kafka

## Prerequisites

Expand Down
9 changes: 2 additions & 7 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
# Welcome

[![CI](https://github.com/itboon/kafka-docker/actions/workflows/docker-publish.yml/badge.svg)](https://github.com/itboon/kafka-docker/actions/workflows/docker-publish.yml)
[![Docker pulls](https://img.shields.io/docker/pulls/kafkace/kafka)](https://hub.docker.com/r/kafkace/kafka)
![Docker Iamge](https://img.shields.io/docker/image-size/kafkace/kafka)

- [Dockerfile](https://github.com/itboon/kafka-docker/blob/main/Dockerfile)
- [GitHub](https://github.com/itboon/kafka-docker)
- [Docker Hub](https://hub.docker.com/r/kafkace/kafka)

Expand All @@ -21,5 +16,5 @@

## 下一步

- [Docker 启动 Kafka](/docker)
- [Helm 部署 kafka](/helm)
- [Docker 启动 Kafka](./docker)
- [Helm 部署 kafka](./helm)
16 changes: 16 additions & 0 deletions examples/k8s/script/helm-template.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

export template_home="../statefulset"

helm_template_output() {
local instance="$1"
local dir="$template_home/$instance"
mkdir -pv "$dir"
helm template kafka \
--namespace kafka-demo \
-f "values/${instance}.yaml" \
../../../charts/kafka/ > "$dir/all.yaml"
}

helm_template_output "single"
helm_template_output "demo-without-pvc"
5 changes: 5 additions & 0 deletions examples/k8s/script/values/demo-without-pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
broker:
combinedMode:
enabled: true
persistence:
enabled: false
Empty file.
3 changes: 3 additions & 0 deletions examples/k8s/script/values/single.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
broker:
combinedMode:
enabled: true
Loading