第80节 OpenIM Helm Charts 设计


❤️💕💕新时代拥抱云原生,云原生具有环境统一、按需付费、即开即用、稳定性强特点。Myblog:http://nsddd.topopen in new window


[TOC]

OpenIM Helm Charts

OpenIM Helm Charts 用于在 Kubernetes 集群上轻松部署和管理 OpenIM 即时消息通信平台及其相关中间件。

前提条件

  • 已安装并配置好的 Kubernetes(K8s)环境。
  • 至少有两个可用的域名:一个用于 MinIO API 访问,另一个用于 OpenIM Server API 访问。
  • 已配置的 StorageClass(此示例使用 NFS-Client)。
  • (可选)如果您的 K8s 系统的 Ingress Controller 节点配置了 LoadBalancer,所有 -config.yaml 文件中的域名信息无需配置 TLS 项。

注意:下个版本将推出基于单一域名访问和基于 IP 的 URL 访问功能。

用户指南

要使用这些 Helm Charts,您需要先安装 Helmopen in new window。请参考 Helm 的 文档open in new window 来开始使用 Helm。

一旦 Helm 安装完毕,请按如下方式添加 Helm 仓库:

helm repo add openim https://openim.github.io/helm-charts

接下来,您可以运行 helm search repo openim 来查看可用的 Charts。

安装 Chart

helm install [RELEASE_NAME] openim/openim-server

查看下面的配置open in new window信息。

有关命令文档,请参考 helm installopen in new window

卸载 Chart

helm uninstall [RELEASE_NAME]

这将删除与 Chart 相关的所有 Kubernetes 组件并卸载发布。

有关命令文档,请参考 helm uninstallopen in new window

升级 Chart

helm upgrade [RELEASE_NAME] [CHART] --install

有关命令文档,请参考 helm upgradeopen in new window

列出发布

helm list

目录结构

adminfront

这个目录包含了 "adminfront" 服务的 Helm Chart。

  • Chart.yaml: 包含了 Chart 的基本信息和版本。
  • templates/: 包含了 Kubernetes 模板文件。
  • values.yaml: 默认配置文件。

adminfront-config.yaml

包含了 "adminfront" 服务的自定义配置信息。

chat-server

这个目录包含了 "chat-server" 服务的 Helm Chart。

  • Chart.yaml: 包含了 Chart 的基本信息和版本。
  • charts/: (可选) 如果 Chart 依赖其他 Chart,可以将它们放在这个目录下。
  • templates/: 包含了 Kubernetes 模板文件。
  • values.yaml: 默认配置文件。

infra

这个目录包含了 OpenIM 所依赖的所有中间件的 Helm Charts 或相关配置。

  • ingress-nginx, kafka, minio, mongodb, mysql, nfs-subdir-external-provisioner, redis: 这些目录可能包含了对应中间件的 Helm Charts。
  • kafka-config.yaml, minio-config.yaml, mongodb-config.yaml, mysql-config.yaml, redis-config.yaml: 这些文件包含了对应中间件的自定义配置。

前提条件

  • 已安装并配置好的 Kubernetes(K8s)环境。
  • 至少有两个可用的域名:一个用于 MinIO API 访问,另一个用于 OpenIM Server API 访问。
  • 已配置的 StorageClass(此示例使用 NFS-Client)。
  • (可选)如果您的 K8s 系统的 Ingress Controller 节点配置了 LoadBalancer,所有 -config.yaml 文件中的域名信息无需配置 TLS 项。

注意:下个版本将推出基于单一域名访问和基于 IP 的 URL 访问功能。

安装中间件

在部署 OpenIM 服务之前,我们需要部署一些依赖的中间件服务。

为了方便部署和管理,我们为这些中间件提供了一套 Helm Charts,它们位于 infra 目录下。

以下命令将分别安装 MySQL、Kafka、MinIO、MongoDB 和 Redis 中间件:

helm repo add openim-infra https://xxxxx.xxx
helm install im-mysql im-infra/mysql -f mysql-config.yaml
helm install im-kafka im-infra/kafka -f kafka-config.yaml
helm install im-minio im-infra/minio -f minio-config.yaml
helm install im-mongodb im-infra/mongodb -f mongodb-config.yaml
helm install im-redis im-infra/redis -f redis-config.yaml

注意

如果 OpenIM 集群部署在 openim 命名空间中,则需要使用 -n 参数指定命名空间。如果命名空间不存在,可以使用 --create-namespace 创建一个新的命名空间。

这些配置文件包括账户信息,例如 minio-config.yaml 还包括域名信息。

安装 OpenIM Server 服务

helm install openim-server -f open-im-server-config.yaml -f notification.yaml ./openim/open-im-server/

请确保在 open-im-server-config.yaml 中配置域名信息。账户信息默认与中间件(infra/)的 -config.yaml 文件同步。如果在安装中间件时修改了 config.yaml,请同步修改 open-im-server-config.yaml

安装 OpenIM Chat 服务

bashCopy code
helm install openim-chat -f chat-server-config.yaml ./openim/openim-chat

请确保在 chat-server-config.yaml 中配置域名信息。账户信息默认与中间件的 -config.yaml 文件同步。如果在安装中间件时修改了 config.yaml,请同步修改 chat-server-config.yaml

安装 Webfront

helm install imwebfront -f webfront-config.yaml ./webfront/

请确保在 webfront-config.yaml 中配置了域名信息。

安装 Adminfront

helm install imadminfront -f adminfront-config.yaml ./adminfront/

请确保在 adminfront-config.yaml 中配置了域名信息。

卸载方法

如果您需要卸载 OpenIM 及其相关组件,可以使用以下 Helm 命令:

helm uninstall [RELEASE_NAME]

其中 [RELEASE_NAME] 是您在安装时指定的名称,例如 openimserver

调试 Helm Charts

如果您需要调试 Helm Charts,可以使用以下命令:

helm install [RELEASE_NAME] [CHART] --dry-run --debug

或者使用 helm template 命令:

helm template [CHART] --name [RELEASE_NAME] --debug

更多信息

要了解有关 OpenIM 和各个组件的配置和使用的详细信息,请访问OpenIM官方文档open in new window

Response and Translation into English:

OpenIM Helm Charts

OpenIM Helm Charts are utilized for easy deployment and management of the OpenIM instant messaging platform and its related middleware on Kubernetes clusters.

Prerequisites

  • Installed and configured Kubernetes (K8s) environment.
  • At least two available domain names: one for MinIO API access, and another for OpenIM Server API access.
  • Configured StorageClass (this example uses NFS-Client).
  • (Optional) If your K8s system’s Ingress Controller nodes are configured with LoadBalancer, all domain information in -config.yaml files do not need to configure TLS items.

Note: The next version will introduce single domain access and IP-based URL access features.

User Guide

To use these Helm Charts, you first need to install Helmopen in new window. Please refer to Helm's documentationopen in new window to get started with Helm.

Once Helm is installed, add the Helm repository as follows:

helm repo add openim https://openim.github.io/helm-charts

Next, you can run helm search repo openim to view the available Charts.

Install Chart

helm install [RELEASE_NAME] openim/openim-server

See the configurationopen in new window information below.

For command documentation, refer to helm installopen in new window.

Uninstall Chart

helm uninstall [RELEASE_NAME]

This will delete all Kubernetes components related to the Chart and uninstall the release.

For command documentation, refer to helm uninstallopen in new window.

Upgrade Chart

helm upgrade [RELEASE_NAME] [CHART] --install

For command documentation, refer to helm upgradeopen in new window.

List Releases

helm list

Directory Structure

adminfront

This directory contains the Helm Chart for the "adminfront" service.

  • Chart.yaml: Contains basic information and version of the Chart.
  • templates/: Contains Kubernetes template files.
  • values.yaml: Default configuration file.

adminfront-config.yaml

Contains custom configuration information for the "adminfront" service.

chat-server

This directory contains the Helm Chart for the "chat-server" service.

  • Chart.yaml: Contains basic information and version of the Chart.
  • charts/: (Optional) If the Chart depends on other Charts, they can be placed in this directory.
  • templates/: Contains Kubernetes template files.
  • values.yaml: Default configuration file.

infra

This directory contains all Helm Charts or related configurations for the middleware that OpenIM depends on.

  • ingress-nginx, kafka, minio, mongodb, mysql, nfs-subdir-external-provisioner, redis: These directories may contain Helm Charts for the corresponding middleware.
  • kafka-config.yaml, minio-config.yaml, mongodb-config.yaml, mysql-config.yaml, redis-config.yaml: These files contain custom configurations for the corresponding middleware.

Prerequisites

  • Installed and configured Kubernetes (K8s) environment.
  • At least two available domain names: one for MinIO API access, and another for OpenIM Server API access.
  • Configured StorageClass (this example uses NFS-Client).
  • (Optional) If your K8s system’s Ingress Controller nodes are configured with LoadBalancer, all domain information in -config.yaml files do not need to configure TLS items.

Note: The next version will introduce single domain access and IP-based URL access features.

Install Middleware

Before deploying the OpenIM services, we need to deploy some dependent middleware services.

For easy deployment and management, we provide a set of Helm Charts for these middleware, located in the infra directory.

The following commands will respectively install MySQL, Kafka, MinIO, MongoDB, and Redis middleware:

helm repo add openim-infra https://xxxxx.xxx
helm install im-mysql im-infra/mysql -f mysql-config.yaml
helm install im-kafka im-infra/kafka -f kafka-config.yaml
helm install im-minio im-infra/minio -f minio-config.yaml
helm install im-mongodb im-infra/mongodb -f mongodb-config.yaml
helm install im-redis im-infra/redis -f redis-config.yaml

Note

If the OpenIM cluster is deployed in the openim namespace, use the -n argument to specify the namespace. If the namespace does not exist, you can use --create-namespace to create a new namespace.

These configuration files include account information, for example, minio-config.yaml also includes domain information.

Install OpenIM Server Service

helm install openim-server -f open-im-server-config.yaml -f notification.yaml ./openim/open-im-server/

Ensure that the domain information is configured in open-im-server-config.yaml. Account information defaults to sync with the middleware (infra/) -config.yaml files. If config.yaml was modified when installing the middleware, please sync modify open-im-server-config.yaml.

Install OpenIM Chat Service

helm install openim-chat -f chat-server-config.yaml ./openim/openim-chat

Ensure that the domain information is configured in chat-server-config.yaml. Account information defaults to sync with the middleware -config.yaml files. If config.yaml was modified when installing the middleware, please sync modify chat-server-config.yaml.

END 链接