Skip to content

Commit

Permalink
feat: remove mysql and add livekit (#91)
Browse files Browse the repository at this point in the history
Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com>
  • Loading branch information
cubxxw committed Mar 12, 2024
1 parent 6523157 commit 93e958b
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 25 deletions.
21 changes: 11 additions & 10 deletions README-zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ helm install kube-prometheus-stack infra/kube-prometheus-stack/ -f infra/prometh
> **注意**
> 如果你想使用Prometheus的告警功能,请修改alertmanager.config 文件中的邮件名称和授权码成真实有效的.
>
>
### [可选]安装 loki

安装 loki-stack 组件:
Expand All @@ -66,6 +66,12 @@ helm install kube-prometheus-stack infra/kube-prometheus-stack/ -f infra/prometh
helm install loki-stack infra/loki-stack/ -n openim
```

### [可选]安装 livekit

livekit 目前还没有集成到 helm charts 中,如果有音视频的需求,那么请你参考 livekit 的 helm charts 部署:[https://github.com/livekit/livekit-helm](https://github.com/livekit/livekit-helm)。除此之外,还需要修改对应的 [config-chatserver.yaml](config-chatserver.yaml) 中关于 livekit 的配置项。



> **注意**
> 这里我们使用的是 kube-prometheus-stack组件中的grafana,所以你应该在grafana的数据源配置loki使用url= "http://loki-stack:3100"
>
Expand All @@ -74,27 +80,22 @@ helm install loki-stack infra/loki-stack/ -n openim

通过helm chart脚本部署中间件服务:

1. 安装 im-mysql,修改 infra/mysql-config.yaml 文件中global.storageClass变量成你真实的storageClass.
```
helm install im-mysql infra/mysql -f infra/mysql-config.yaml -n openim
```

2. 安装im-kafka,修改 infra/kafka-config.yaml 文件中global.storageClass变量成你真实的storageClass.
1. 安装im-kafka,修改 infra/kafka-config.yaml 文件中global.storageClass变量成你真实的storageClass.
```
helm install im-kafka infra/kafka -f infra/kafka-config.yaml -n openim
```

3. 安装im-mongodb,修改 infra/mongodb-config.yaml 文件中global.storageClass变量成你真实的storageClass.
2. 安装im-mongodb,修改 infra/mongodb-config.yaml 文件中global.storageClass变量成你真实的storageClass.
```
helm install im-mongodb infra/mongodb -f infra/mongodb-config.yaml -n openim
```

4. 安装im-redis,修改 infra/redis-config.yaml 文件中global.storageClass变量成你真实的storageClass.
3. 安装im-redis,修改 infra/redis-config.yaml 文件中global.storageClass变量成你真实的storageClass.
```
helm install im-redis infra/redis -f infra/redis-config.yaml -n openim
```

5. 安装im-minio,修改 infra/minio-config.yaml 文件中global.storageClass变量成你真实的storageClass; 并且修改域名信息成你真实的域名和tls名称.
4. 安装im-minio,修改 infra/minio-config.yaml 文件中global.storageClass变量成你真实的storageClass; 并且修改域名信息成你真实的域名和tls名称.
```
helm install im-minio infra/minio -f infra/minio-config.yaml -n openim
```
Expand Down
38 changes: 27 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ openim-web 0.1.1 preview-k8s
## Directory Structure
+ **docs/**: user-guide docs,how to use grafana and loki
+ **charts/**: Helm Charts for "openim-admin","openim-chat","openim-server","openim-web"
+ **infra**: Contains Helm Charts/configurations for middleware OpenIM relies on(e.g. kafka,minio,mongodb,mysql,redis;prometheus and loki are also included).
+ **infra**: Contains Helm Charts/configurations for middleware OpenIM relies on(e.g. kafka,minio,mongodb,redis;prometheus and loki are also included).
+ **config-imserver.yaml**: openim-server's config file,Used to generate configmap for openim-server.
+ **config-chatserver.yaml**: openim-chat's config file,Used to generate configmap for openim-chat.
+ **k8s-adminfront-config.yaml**: custom values configurations for openim-admin chart
Expand Down Expand Up @@ -73,35 +73,51 @@ helm install loki-stack infra/loki-stack/ -n openim
> in this we use grafana in kube-prometheus-stack for loki display,so you should config the datasource of loki using "http://loki-stack:3100"
>
### Install Middleware

Deploy required middleware services:
### [Optional] Installing LiveKit

1. install im-mysql,change global.storageClass in infra/mysql-config.yaml to your real storageClass.
LiveKit has not yet been integrated into Helm charts. If you require audio and video capabilities, please refer to the LiveKit Helm charts for deployment: [https://github.com/livekit/livekit-helm](https://github.com/livekit/livekit-helm). Additionally, you will need to modify the corresponding settings in [config-chatserver.yaml](config-chatserver.yaml) related to LiveKit.

```bash
helm install im-mysql infra/mysql -f infra/mysql-config.yaml -n openim
The configuration settings are as follows:
```
liveKit:
liveKitUrl: "wss://im-livekiturl:7880" # Use wss:// instead of ws:// to enable encrypted connections
key: "" # LIVEKIT_API_KEY
secret: "" # LIVEKIT_API_SECRET
```

To configure these settings, you need to:

1. **liveKitUrl**: Replace `"wss://im-livekiturl:7880"` with the WebSocket Secure (WSS) URL of your LiveKit server. The `wss://` protocol ensures that the connection to the LiveKit server is encrypted for security.

2. **key**: Fill in the `key` field with your LiveKit API key. The API key is used to authenticate your application's access to the LiveKit server.

3. **secret**: Fill in the `secret` field with your LiveKit API secret. The API secret is a critical component of your application's security, enabling secure communication between your server and the LiveKit server.

Make sure to save the changes to `config-chatserver.yaml` after updating these settings to ensure that your chat server can communicate with the LiveKit server using the correct credentials and connection details.

### Install Middleware

Deploy required middleware services:

2. install im-kafka,change global.storageClass in infra/kafka-config.yaml to your real storageClass.
1. install im-kafka,change global.storageClass in infra/kafka-config.yaml to your real storageClass.

```bash
helm install im-kafka infra/kafka -f infra/kafka-config.yaml -n openim
```

3. install im-mongodb,change global.storageClass in infra/mongodb-config.yaml to your real storageClass.
2. install im-mongodb,change global.storageClass in infra/mongodb-config.yaml to your real storageClass.

```bash
helm install im-mongodb infra/mongodb -f infra/mongodb-config.yaml -n openim
```

4. install im-redis,change global.storageClass in infra/redis-config.yaml to your real storageClass.
3. install im-redis,change global.storageClass in infra/redis-config.yaml to your real storageClass.

```bash
helm install im-redis infra/redis -f infra/redis-config.yaml -n openim
```

5. install im-minio,change global.storageClass in infra/minio-config.yaml to your real storageClass; and change domain, tls name to your real configuration.
4. install im-minio,change global.storageClass in infra/minio-config.yaml to your real storageClass; and change domain, tls name to your real configuration.

```bash
helm install im-minio infra/minio -f infra/minio-config.yaml -n openim
Expand Down
8 changes: 4 additions & 4 deletions config-chatserver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ config:
username:
password: openIM123

# liveKit:
# liveKitUrl: "ws://172.28.0.1:7880" # LIVEKIT_URL, LiveKit server address and port
# key: "APIDXJxJeCL8haY" # LIVEKIT_API_KEY
# secret: "ak1qulJ3nfXeflQHWBdmQDc4js4ueMc5OnxoORVJC2xA" # LIVEKIT_API_SECRET
liveKit:
liveKitUrl: "wss://im-livekiturl:7880" # 使用wss://代替ws://以启用加密连接
key: "" # LIVEKIT_API_KEY
secret: "" # LIVEKIT_API_SECRET

mongo:
uri: ''
Expand Down

0 comments on commit 93e958b

Please sign in to comment.