From e19f7ca9872cd277d2e869514dd09719fd864ecf Mon Sep 17 00:00:00 2001 From: Monet Lee Date: Wed, 18 Dec 2024 15:58:42 +0800 Subject: [PATCH] docs: update deployment docs. --- deployments/README.md | 53 +++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/deployments/README.md b/deployments/README.md index d27d2bad..dabc8f8f 100644 --- a/deployments/README.md +++ b/deployments/README.md @@ -2,12 +2,22 @@ ## Preconditions -- Successfully deployed OpenIM Server and its dependencies(mongo, kafka, redis, minio). +- Ensure deployed OpenIM Server and its dependencies. + - Redis + - MongoDB + - Kafka + - MinIO - Expose the corresponding Services and ports of OpenIM Server. ## Deploy OpenIM Chat -Chat depends on OpenIM Server, so you need to deploy OpenIM Server first. +**Chat depends on OpenIM Server, so you need to deploy OpenIM Server first.** + +enter the target directory + +```shell +cd deployments/deploy +``` ### Modify ConfigMap @@ -15,33 +25,21 @@ You need to modify the `chat-config.yml` file to match your environment. Focus o **discovery.yml** - `kubernetes.namespace`: default is `default`, you can change it to your namespace. -- `enable`: set to `kubernetes` -- `rpcService`: Every field value need to same to the corresponding service name. Such as `chat` value in same to `openim-chat-rpc-service.yml` service name. - -**log.yml** - -- `storageLocation`: log save path in container. -- `isStdout`: output in kubectl log. -- `isJson`: log format to JSON. **mongodb.yml** - `address`: set to your already mongodb address or mongo Service name and port in your deployed. -- `username`: set to your mongodb username. - `database`: set to your mongodb database name. -- `password`: **need to set to secret use base64 encode.** -- `authSource`: set to your mongodb authSource, default is `openim_v3`. +- `authSource`: et to your mongodb authSource. (authSource is specify the database name associated with the user's credentials, user need create in this database.) **redis.yml** - `address`: set to your already redis address or redis Service name and port in your deployed. -- `password`: **need to set to secret use base64 encode.** **share.yml** - `openIM.apiURL`: modify to your already API address or use your `openim-api` service name and port - `openIM.adminUserID`: same to IM Server `imAdminUserID` field value. -- `chatAdmin`: default is `chatAdmin`. ### Set the secret @@ -49,23 +47,25 @@ A Secret is an object that contains a small amount of sensitive data. Such as pa #### Example: -create a secret for redis password. You can create new file is `redis-secret.yml` or append contents to `chat-config.yml` use `---` split it. +create a secret for redis password. You can update `redis-secret.yml`. + +you need update `redis-password` value to your redis password in base64. ```yaml apiVersion: v1 kind: Secret metadata: - name: redis-secret + name: openim-redis-secret type: Opaque data: - redis-password: b3BlbklNMTIz # "openIM123" in base64 + redis-password: b3BlbklNMTIz # you need update to your redis password in base64 ``` #### Usage: use secret in deployment file. If you apply the secret to IM Server, you need adapt the Env Name to config file and all toupper. -OpenIM Server use prefix `IMENV_`, OpenIM Chat use prefix `CHATENV_`. Next adapt is the config file name. Like `redis.yml`. Such as `CHATENV_REDIS_PASSWORD` is mapped to `redis.yml` password filed in OpenIM Server. +OpenIM Chat use prefix `CHATENV_`. Next adapt is the config file name. Like `redis.yml`. Such as `CHATENV_REDIS_PASSWORD` is mapped to `redis.yml` password filed in OpenIM Server. ```yaml apiVersion: apps/v1 @@ -78,11 +78,11 @@ spec: containers: - name: chat-rpc-server env: - - name: CHATENV_REDIS_PASSWORD # adapt to redis.yml password field + - name: CHATENV_REDIS_PASSWORD # adapt to redis.yml password field in OpenIM Server config, Don't modify it. valueFrom: secretKeyRef: - name: redis-secret - key: redis-password + name: openim-redis-secret # You deployed secret name + key: redis-password # You deployed secret key name ``` So, you need following configurations to set secret: @@ -90,16 +90,15 @@ So, you need following configurations to set secret: - `MONGODB_USERNAME` - `MONGODB_PASSWORD` - `REDIS_PASSWORD` -- `SHARE_OPENIM_SECRET` - -### Apply Config and Services -enter the target directory +Apply the secret. ```shell -cd deployments/deploy +kubectl apply -f redis-secret.yml -f mongo-secret.yml ``` +### Apply Config and Services + deploy the config and services ```shell