Development Validation and Deployment

Koupleless Base and Module Development Validation and Deployment

This document mainly introduces the dynamic merge deployment mode, which is used to save resources and improve development efficiency. If you only want to save resources, you can use static merge deployment

img.png

A video tutorial is also available here

Base Integration

Refer here for reference

Module Integration

Refer here for reference

Module Development Verification

There can be two ways for development verification:

  1. Local Environment Development Verification
  2. K8S Cluster Environment Development Verification

Local Environment Development Verification

Installation Way: Using golang tool chain

  1. Download the corresponding Golang version from the Golang official website: https://go.dev/. The version needs to be above 1.21.
  2. Execute the command go install github.com/koupleless/arkctl@v0.2.1 to install the arkctl tool.

Installation Way: From binary

  1. Download arkctl according to the actual operating system.
  2. Unzip the corresponding binary and place it in the appropriate system variable PATH.
  3. After the base and module are refactored, and the base is started, arkctl can be used to quickly build and deploy, deploying the module to the base.

How to find the value of PATH?

In Linux/Mac, execute the following command in the terminal:

echo $PATH
# Choose a directory and place arkctl in that directory

In Windows:

  1. Right-click on My Computer.
  2. Click on Properties.
  3. Click on Advanced System Settings.
  4. Click on Environment Variables.
  5. Double-click on the Path variable.
  6. In the popped dialog box, you can see the current Path variable value.
  7. Find the corresponding directory and place arkctl.exe in that directory.

Usage

Quickly deploy the built module jar package.

arkctl deploy ${path to the module jar package}

Build the pom project in the current directory and deploy the biz jar package in the target directory to the base.

arkctl deploy 

K8S Cluster Environment Development Verification, using minikube cluster as an example

Base Deployment

  1. Build the base into an image and push it to the image center.
  2. Deploy the base to the k8s cluster, create a service for the base, expose the port, can refer here
  3. Execute minikube service base-web-single-host-service to access the base service.

Module Deployment

  1. Deploy the module to the k8s cluster
arkctl deploy ${path to the module jar package} --pod ${namespace}/${podname}

Module Deployment and Online

  1. Use helm to deploy ModuleController to the k8s cluster.
  2. Use the module deployment capability provided by ModuleController to publish the module to the cluster machines, with gray, traceable, and traffic-free capabilities. For details, please refer here

For more experiments, please refer to the samples directory

Refer here for reference