第82节 OpenIM Application Containerization Deployment Guide


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


[TOC]

OpenIM Application Containerization Deployment Guide

OpenIM supports a variety of cluster deployment methods, including but not limited to helm, sealos, kustomize

Various contributors, as well as previous official releases, have provided some referenceable solutions:

Dependency Check

Kubernetes: >= 1.16.0-0
Helm: >= 3.0

Minimum Configuration

The recommended minimum configuration for a production environment is as follows:

CPU: 4
Memory: 8G
Disk: 100G

Configuration File Generation

We have automated all the files, making the generation of configuration files optional for OpenIM. However, if you desire custom configurations, you can follow the steps below:

$ make init
# Alternatively, use script:
# ./scripts/init-config.sh

At this point, configuration files will be generated under deployments/openim/config, which you can modify as per your requirements.

Cluster Setup

If you already have a kubernetes cluster, or if you wish to build a kubernetes cluster from scratch, you can skip this step.

For a quick start, I used sealosopen in new window to rapidly set up the cluster, with sealos also being a wrapper for kubeadm at its core:

$ SEALOS_VERSION=`curl -s https://api.github.com/repos/labring/sealos/releases/latest | grep -oE '"tag_name": "[^"]+"' | head -n1 | cut -d'"' -f4` && \
  curl -sfL https://raw.githubusercontent.com/labring/sealos/${SEALOS_VERSION}/scripts/install.sh |
  sh -s ${SEALOS_VERSION} labring/sealos

Supported Versions:

  • docker: labring/kubernetes-docker:(v1.24.0~v1.27.0)
  • containerd: labring/kubernetes:(v1.24.0~v1.27.0)

Cluster Installation:

Cluster details are as follows:

HostnameIP AddressSystem Info
master0110.0.0.9Linux VM-0-9-ubuntu 5.15.0-76-generic #83-Ubuntu SMP Thu Jun 15 19:16:32 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
node0110.0.0.4Similar to master01
node0210.0.0.10Similar to master01
$ export CLUSTER_USERNAME=ubuntu
$ export CLUSTER_PASSWORD=123456
$ sudo sealos run labring/kubernetes:v1.25.0 labring/helm:v3.8.2 labring/calico:v3.24.1 \
    --masters 10.0.0.9 \
    --nodes 10.0.0.4,10.0.0.10 \
    -u "$CLUSTER_USERNAME" \
    -p "$CLUSTER_PASSWORD"

Node Uninstallation method: using kubeadm for uninstallation does not remove etcd and cni related configurations. Manual clearance or using sealos for uninstallation is needed.

$ sealos reset

Installing helm

Helm simplifies the deployment and management of Kubernetes applications to a large extent by offering version control and release management through packaging.

Using Script:

$ curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash

Adding Repository:

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

OpenIM Image Strategy

Automated offerings include aliyun, ghcr, docker hub: Image Documentationopen in new window

Local Test Build Method:

$ make image

This command assists in quickly building the required images locally. For a detailed build strategy, refer to the Build Documentationopen in new window.

Installation

Explore our Helm-Charts repository and read through: Helm-Charts Repositoryopen in new window

END 链接