Component Creation Process

This document introduces the basic process of creating components in Kato.

Prerequisites

  1. The planning and creation of the team has been completed.
  2. The cluster resources are sufficient.

There are currently two entrances for component creation, namely Team View/Entry to Create Component and Application View/Entry to Add Component. The creation process is the same.

Create Components from Source Code

The following will take the Java source code creation component as an example to introduce the process of creating a component using source code on Kato.

  1. Provide the name of the component and the application to which it belongs. The most important thing is to provide the source information of the build. The source code build provides the code repository address, authorization and other information.

  2. Wait for Kato to detect the source code. In this process, Kato will obtain the source code according to the code source information and perform language type, language specification and other tests, and download from Katofile Read the component properties from the file.

  3. If the test result is passed, the component will be created based on the component properties detected. If it is not passed, the user needs to change the relevant information according to the prompts.

  4. After the detection is completed, the user can choose to build and start or perform advanced settings to set more component properties. If you choose to build and start Kato, you will get the source code again to build the source code according to the language type of the code detection. Please note that the source code type will only be read in the source code inspection, so if the language type is changed in the subsequent development process, a re-code inspection needs to be triggered.

  5. After the component is built, it can be accessed through the default domain name bound to the port. For subsequent management and maintenance procedures, please refer to Component Development Component Operation and Maintenance

Source code address: https://github.com/gridworkz/java-maven-demo.git

Detailed reference documents for various languages ​​are as follows:

Use of Git and Svn

When creating components, select Git or SVN according to the type of code repository, and fill in the code repository address of the application and the code branch or tag to be used correctly. The default branch of Git is master, the default tag of SVN It is trunk.

The default parameters of svn checkout code include:

--username --password --non-interactive --trust-server-cert

git supports account authentication, key authentication and Oauth2.0 authentication when obtaining code.

Account and password to connect to the code repository

If you need to use the account password to connect to the code repository, click to fill in the repository account password, and fill in your login user name and password correctly.

SSH connection code repository

If you need to use an SSH key to connect to the code repository, click the Configure Authorization Key below, and a secret key will be generated for you, and then add this secret key to the deployment key of your code repository.

Create from Docker Image

The following will take the official image of Nginx as an example to introduce and demonstrate the process of creating components with Docker images on Kato. The same as the source code creation process, the difference is that the provided build source information and types are different, the process is as follows:

  1. Provide the name of the component and the application to which it belongs. The most important thing is to provide information about the source of the build. The image build provides the name and authorization information of the image.

  2. Kato will obtain the mirror image according to the provided mirror information. Kato can obtain the specified mirror image is the basis for successful creation. At present, Kato is more flexible in the detection specifications of mirrors, so it must be noted that the mirrors that pass the detection may not be able to run normally, such as the types of mirrors mentioned above that Kato cannot run. Kato will parse the metadata of the mirror to obtain the attribute information needed to create the component if it successfully obtains the mirror.

    • If you want to add environment variables in batches, it is best to define them in the image metadata (that is, defined in the Dockerfile). When Kato recognizes it, it will automatically recognize it.
  3. After the application passes the test, the component can be created.

  4. After the build is complete, you can access the component. For the subsequent management and maintenance process, please refer to Component Development Component Operation and Maintenance

The component created by the Docker image is complete. If you create components from the image of a private mirror repository, you need to pay attention to the following types of issues:

  • The private repository Https is properly configured, and the mirror can be pulled directly.
  • If the private repository uses a self-signed certificate, the node where the Kato Chaos component is located needs to configure the private repository trust, refer to the operation and maintenance document.
  • If the mirror repository is private, please provide the correct account and password information.

Example Deployment of the Image with Startup Command

Deploy through the docker run command: docker run -p 8490:8490 gridworkz/test -s "ws://192.168.1.1:8490"

By specifying the mirroring method:

  • Mirror address: gridworkz/test and build
  • Modify the startup command at the application build source to -s "ws://192.168.1.1:8490"

gridworkz/test please replace with your own mirror

Install from Shared Library

The application template (model) in the shared library is a standard Kato application specification. The installation process from the shared library only requires one-click operation. Find the application to be installed, click Install directly, and select the application to be installed.

In this way, an application installed by a shared library is completed. Installing from the shared library will be the key process of application delivery. The application of the shared library supports one-click installation and continuous upgrade.