头图

Rainbond is mainly composed of the following three projects, refer to the official website for details Architecture

Service end

Rainbond-UI and Rainbond-Console together form the business layer. The business layer is a front-end and back-end separation model. UI is the front-end code of the business layer, and Console is the back-end code of the business layer.

Rainbond-UI https://github.com/goodrain/rainbond-ui

Rainbond-Console https://github.com/goodrain/rainbond-console

Cluster side

Rainbond is the implementation of the platform cluster side and mainly interacts with the Kubernetes cluster.

Rainbond https://github.com/goodrain/rainbond

Compile the project

Note: Docker environment needs to be installed

Business layer source code compilation

Compile the front-end Rainbond-UI image

  1. First clone the Rainbond-UI project to the local
git clone https://github.com/goodrain/rainbond-ui.git
  1. Build the image using the build.sh script in the project root directory:
VERSION=v5.5.0-release ./build.sh

VERSION specifies the tag of the built image, and the image packaged by the front-end will be used as the base image of the back-end code.

compile backend Rainbond-console mirror

  1. First clone the Rainbond-console project to the local
git clone https://github.com/goodrain/rainbond-console.git
  1. Build the image using the release.sh script in the project root directory:
VERSION=v5.5.0-release ./release.sh allinone

VERSION specifies the tag of the built image. Since the image of the front-end code is the base image, this place should be consistent with the tag of the front-end project. Please use the following commands to compile the front-end and back-end code together to form the final allinone image that can be run directly.

runs the business layer image

After compiling the allinone image, you can refer to the following command, replace the image name in the last line with the image name you packaged, and run the image.

docker run -d -p 7070:7070 \

--name=rainbond-allinone --restart=always \

-v ~/.ssh:/root/.ssh \

-v ~/rainbonddata:/app/data \

rainbond/rainbond:v5.5.0-release-allinone

After the image is running, access the 7070 port of the machine to enter the Rainbond console.

Cluster-side source code compilation

The cluster side is deployed on the Kubernetes cluster, and there are many components at the same time, so you can compile a single component as needed.

single component compilation

Single-component compilation is very important in the actual development process. Usually, after we modify a component in the secondary development process, we can compile a component separately and use the latest component image to directly replace it in the installed development and test environment. mirror.

  1. First clone the Rainbond project locally
git clone https://github.com/goodrain/rainbond.git
  1. Use the release.sh script in the project root directory to build the image, take the chaos component as an example, and execute it in the main directory of the rainbond code
./release.sh chaos

single-component compilation supports the following components:

rbd-chaos

The chaos component corresponds to the Rainbond application construction service, which mainly deals with the CI process. The input source includes source code or Docker image or application market application for parsing, compiling, packaging, and finally generating the version medium of the application (component).

rbd-api

The api component corresponds to the Rainbond data center API service. As the abstract core control service of the data center, the API service provides Restful-style API services to the outside world, and is the only entry for data center control requests.

rbd-gateway

The gateway component corresponds to the Rainbond application gateway service. The application gateway is the only entry for external traffic to enter the internal components of the Rainbond tenant, providing HTTP, HTTPs routing, TCP/UDP services, load balancer, advanced routing (A/B testing, grayscale publishing), Features such as virtual IP support.

rbd-monitor

The monitor component corresponds to the Rainbond monitoring service. Rainbond encapsulates the Monitor component based on Prometheus. It automatically discovers various monitoring objects of applications, clusters, and cluster node services from etcd and Kubernetes clusters and completes the configuration of Prometheus monitoring targets. The monitoring target is included in the scope of Prometheus monitoring. .

rbd-mq

The mq component corresponds to the Rainbond message middleware service. The MQ component is a lightweight distributed message middleware with message persistence and global consistency based on Etcd. This component maintains asynchronous task messages and provides multi-topic message publishing and subscription capabilities.

rbd-webcli

The webcli component corresponds to the Rainbond application web terminal control service, which implements the function of connecting to the container console through the web. This component communicates with the UI through WebSocket. Users can send various shell commands by simulating the web terminal. The webcli executes commands in the container through the exec method provided by kube-apiserver and returns the results to the web terminal.

rbd-worker

The worker component corresponds to the Rainbond application runtime control service. The application runtime control service instantiates the Rainbond-Application Model and converts it into a Kubernetes resource model. It is associated with various resources required for application running, and completes the running state part of the application life cycle. It is understandable For the CD control service, the design of the service is to support the life cycle supervision of a large number of applications.

rbd-eventlog

The eventlog component corresponds to the Rainbond event and log processing service, and mainly handles user asynchronous operation logs, application construction logs and application running logs.

rbd-mesh-data-panel

The mesh-data-panel component handles dependencies between components.

rbd-grctl

The grctl component provides command-line tools for querying information about components in the cluster.

rbd-node

The node component corresponds to the Rainbond cluster and node management service. The Node component is the basic service of the Rainbond cluster. All nodes in the cluster need to run this component. Provides key capabilities such as node information collection, cluster service maintenance, application log collection, and application runtime support.

complete installation package package and compile

Compiling the complete installation package is suitable for regenerating the installation package after changing a lot of source code. Execute in the main directory of the rainbond code

./release.sh all

Run cluster-side mirroring

Since the data center side is deployed on the Kubernetes cluster, the following prerequisites must be met to run the compiled component image.

Prerequisites

  1. Rainbond's test environment has been installed
  2. Kubectl command, please refer to document to install Kubectl

running image

The components on the data center side of Rainbond are all defined by the CRD resource rbdcomponent. When you compile the image of a component and need to run it, you need to modify the rbdcomponent resource.

Take the chaos component as an example, assuming your compiled chaos image is named

rainbond/rbd-chaos:v5.5.0-release

Do the following in sequence to replace the component images in the cluster.

  1. Edit the corresponding rbdcomponent file
kubectl edit rbdcomponent rbd-chaos -n rbd-system
  1. Find the mirror address column, modify the mirror, such as
spec:
  image: rainbond/rbd-chaos:v5.5.0-release
  1. Save and exit, execute the following command at this time, you should see that the corresponding component is being updated. Just wait for the pod to update.
kubectl get pod -n rbd-system

Rainbond
764 声望56 粉丝

不用懂 Kubernetes 的云原生应用管理平台