Skip to the content.

Read Chinese Version

K8STARS

K8STARS is a convenient solution to run TARS services in kubernetes.

Characteristics

How it works

  1. Three interfaces are added in the tarsregistry, which are used for automatic registration, heartbeat reporting and node offline. For details, please refer to interface definition

  2. A ‘tarscli’ command-line tool is provided to allocate ports, generate configuration, report heartbeat and node offline.

Deployment examples

  1. Deployment tars basic service
    curl https://raw.githubusercontent.com/TarsCloud/K8STARS/master/baseserver/install_all.sh | sh
    
  2. Deployment service example -Deploy sample simpleserver

    cd examples/simple && kubectl apply -f simpleserver.yaml

    Example description:

    • The image is created by the examples/simple/dockerfile file, and the basic image is created by cmd/tarscli/dockerfile
    • start.sh: tarscli genconf in is used to generate the tars service startup configuration
    • server_ meta.yaml The file is used to configure the metadata of the service. For field information, please refer to app/genconf/config.go structure ServerConf . Endpoint defaults to tcp -h ${local_ip} -p ${random_port} , supports automatic filling of IP and random ports. -ased on Golang HelloWorld program TestApp.HelloGo See examples/README.md
  3. Verify the deployment Login db_tars , then execute select * from t_server_conf\G The node information of simpleserver has been registered automatically.

Tars deployment directory structure

tarscli based on environment variable TARS_PATH(default/tars) to manage services. The directory functions are as follows:

About tarscli

tarscli provides a set of command tools to facilitate container deployment of TARS services. Parameters can be specified through environment variables. For details, see tarscli help.

Here are the sub commands supported by tarscli

Basic services

TARS related basic services provide rich service governance functions. Please refer to baseserver for deployment.