mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-10-26 21:22:16 +08:00
docs: update deployment docs.
This commit is contained in:
parent
742a611d27
commit
c10c9d2711
@ -34,7 +34,7 @@ In `openim-config.yml`, you need modify the following configurations:
|
||||
**mongodb.yml**
|
||||
|
||||
- `address`: set to your already mongodb address or mongo Service name and port in your deployed.
|
||||
- `database`: set to your mongodb database name.
|
||||
- `database`: set to your mongodb database name.(Need have a created database.)
|
||||
- `authSource`: set to your mongodb authSource. (authSource is specify the database name associated with the user's credentials, user need create in this database.)
|
||||
|
||||
**share.yml**
|
||||
@ -59,11 +59,9 @@ In `openim-config.yml`, you need modify the following configurations:
|
||||
|
||||
A Secret is an object that contains a small amount of sensitive data. Such as password and secret. Secret is similar to ConfigMaps.
|
||||
|
||||
#### Example:
|
||||
#### Redis:
|
||||
|
||||
create a secret for redis password. You can update `redis-secret.yml`.
|
||||
|
||||
you need update `redis-password` value to your redis password in base64.
|
||||
Update the `redis-password` value in `redis-secret.yml` to your Redis password encoded in base64.
|
||||
|
||||
```yaml
|
||||
apiVersion: v1
|
||||
@ -72,65 +70,75 @@ metadata:
|
||||
name: openim-redis-secret
|
||||
type: Opaque
|
||||
data:
|
||||
redis-password: b3BlbklNMTIz # you need update to your redis password in base64
|
||||
redis-password: b3BlbklNMTIz # update to your redis password encoded in base64
|
||||
```
|
||||
|
||||
#### Usage:
|
||||
#### Mongo:
|
||||
|
||||
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 `IMENV_REDIS_PASSWORD` is mapped to `redis.yml` password filed in OpenIM Server.
|
||||
Update the `mongo_openim_username`, `mongo_openim_password` value in `mongo-secret.yml` to your Mongo username and password encoded in base64.
|
||||
|
||||
```yaml
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: rpc-user-server
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: rpc-user-server
|
||||
env:
|
||||
- name: IMENV_REDIS_PASSWORD # adapt to redis.yml password field in OpenIM Server config, Don't modify it.
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: openim-redis-secret # You deployed secret name
|
||||
key: redis-password # You deployed secret key name
|
||||
name: openim-mongo-secret
|
||||
type: Opaque
|
||||
data:
|
||||
mongo_openim_username: b3BlbklN # update to your mongo username encoded in base64, this user credentials need in authSource database.
|
||||
mongo_openim_password: b3BlbklNMTIz # update to your mongo password encoded in base64
|
||||
```
|
||||
|
||||
So, you need following configurations to set secret:
|
||||
#### Minio:
|
||||
|
||||
- `MONGODB_USERNAME`
|
||||
- `MONGODB_PASSWORD`
|
||||
- `REDIS_PASSWORD`
|
||||
- `MINIO_ACCESSKEYID`
|
||||
- `MINIO_SECRETACCESSKEY`
|
||||
Update the `minio-root-user` and `minio-root-password` value in `minio-secret.yml` to your MinIO access key and secret key encoded in base64.
|
||||
|
||||
Apply the secret.
|
||||
```yaml
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: openim-minio-secret
|
||||
type: Opaque
|
||||
data:
|
||||
minio-root-user: cm9vdA== # update to your minio accessKeyID encoded in base64
|
||||
minio-root-password: b3BlbklNMTIz # update to your minio secretAccessKey encoded in base64
|
||||
```
|
||||
|
||||
#### Kafka:
|
||||
|
||||
Update the `kafka-password` value in `kafka-secret.yml` to your Kafka password encoded in base64.
|
||||
|
||||
```yaml
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: openim-kafka-secret
|
||||
type: Opaque
|
||||
data:
|
||||
kafka-password: "" # update to your kafka password encoded in base64
|
||||
```
|
||||
|
||||
### Apply the secret.
|
||||
|
||||
```shell
|
||||
kubectl apply -f redis-secret.yml -f minio-secret.yml -f mongo-secret.yml
|
||||
kubectl apply -f redis-secret.yml -f minio-secret.yml -f mongo-secret.yml -f kafka-secret.yml
|
||||
```
|
||||
|
||||
### Apply all config and dependencies
|
||||
|
||||
`kubectl apply -f ./openim-config.yml`
|
||||
|
||||
> Attation: If you use `default` namespace, you can excute `clusterRile.yml` to create a cluster role binding for default service account.
|
||||
>
|
||||
> Namespace is modify to `discovery.yml` in `openim-config.yml`, you can change `kubernetes.namespace` to your namespace.
|
||||
|
||||
`kubectl apply -f ./openim-config.yml`
|
||||
|
||||
**Excute `clusterRole.yml`**
|
||||
|
||||
`kubectl apply -f ./clusterRole.yml`
|
||||
|
||||
**If you have already deployed the storage component, you need to update corresponding config and secret. And pass corresponding deployments and services build.**
|
||||
### run all deployments and services
|
||||
|
||||
> Note: Ensure that infrastructure services like MinIO, Redis, and Kafka are running before deploying the main applications.
|
||||
|
||||
### run all deployments and services
|
||||
|
||||
```bash
|
||||
kubectl apply \
|
||||
-f openim-api-deployment.yml \
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user