Updated on 2024-01-12 GMT+08:00

Service Endpoints

A service endpoint is an extension of CodeArts. It enables CodeArts to connect to third-party services.

During the pipeline configuration, you can connect to a GitHub repository to obtain project source code, a third-party Jenkins service to perform some tasks, a Kubernetes cluster to perform deployment tasks, a Nexus repository to add private Maven repository information, or a Docker repository to manage Docker images, or create an IAM user endpoint to allow the IAM user to perform tasks using the AK/SK of your account.

Prerequisites

  • All roles can create service endpoints.
  • Project creators and project managers can view all service endpoints in projects and set permissions.
  • Ensure that the third-party services configured in the service extension point can be accessed through the public network without restrictions.

Creating a Docker Repository Service Endpoint

You can use a Docker repository service endpoint to connect to a Docker image repository. After the connection is successful, you can perform operations on Docker images.

  1. In a project, choose Settings > General > Service Endpoints.
  2. Click Create Endpoint and choose Docker repository from the drop-down list.
  3. In the Create Service Endpoint dialog box, set the parameters.
    Table 1 Parameter description

    Parameter

    Description

    Service Endpoint Name

    Name of the service endpoint.

    Repository Address

    Address of the Docker image repository to connect (HTTP or HTTPS address).

    Username

    Username for connecting to the Docker image repository.

    Password

    Password for connecting to the Docker image repository.

  4. Click OK.

Creating a Jenkins Service Endpoint

You can use a Jenkins service endpoint to connect to a Jenkins service. After the connection is successful, you can perform operations on the tasks contained in the Jenkins service.

Currently, only LA-Mexico City2, LA-Sao Paulo1, and AP-Singapore are supported.

  1. In a project, choose Settings > General > Service Endpoints.
  2. Click Create Endpoint and choose Jenkins from the drop-down list.
  3. In the Create Service Endpoint dialog box, set the parameters.
    Table 2 Parameter description

    Parameter

    Description

    Service Endpoint Name

    Name of the service endpoint.

    Server URL

    Address of the Jenkins service to connect. Currently, only public network addresses such as http://<IP_ address>:<port_number> and https://<IP_address>:<port_number> are supported.

    Username

    Username for logging in to the Jenkins service.

    Password

    Password for logging in to the Jenkins service.

    You can click Verify and OK to check whether the username and password can be connected to the Jenkins server.

  4. Click OK.

Creating a Kubernetes Service Endpoint

You can use a Kubernetes service endpoint to connect to a Kubernetes cluster. After the connection is successful, you can deliver deployment tasks to the Kubernetes cluster.

  1. In a project, choose Settings > General > Service Endpoints.
  2. Click Create Endpoint and choose Kubernetes from the drop-down list.
  3. In the Create Service Endpoint dialog box, set the parameters.
    Table 3 Parameter description

    Parameter

    Description

    Service Endpoint Name

    Name of the service endpoint.

    Kubernetes URL

    API server address of the Kubernetes cluster to connect (HTTP or HTTPS address).

    Kubeconfig

    The Kubeconfig file contains information about clusters, users, namespaces, and authentication mechanisms. Kubectl uses kubeconfig to select a cluster and communicate with the Kubernetes APIs. This file supports multiple clusters, users, and authentication mechanisms. For details, see Organizing Cluster Access Using kubeconfig Files.

    NOTE:

    If a CCE cluster is used, you can obtain the Kubeconfig file by referring to Connecting to a Cluster Using kubectl.

  4. Click OK.

Creating a Nexus Repository Service Endpoint

You can use a Nexus repository endpoint to add private Maven repository information.

Currently, only LA-Mexico City2, LA-Sao Paulo1, and AP-Singapore are supported.

  1. In a project, choose Settings > General > Service Endpoints.
  2. Click Create Endpoint and choose nexus repository from the drop-down list.
  3. In the Create Service Endpoint dialog box, set the parameters.
    Table 4 Parameter description

    Parameter

    Description

    Service Endpoint Name

    Name of the service endpoint.

    Repository Address

    Nexus repository public network address (HTTP or HTTPS address).

    Username

    Username for logging in to the Nexus repository.

    Password

    Password for logging in to the Nexus repository.

  4. Click OK.

Creating a GitLab Repository Service Endpoint

After connecting to a GitLab repository, you can obtain the repository and branch information.

Currently, only LA-Mexico City2, LA-Sao Paulo1, and AP-Singapore are supported.

  1. In a project, choose Settings > General > Service Endpoints.
  2. Click Create Endpoint and choose GitLab repository from the drop-down list.
  3. In the Create Service Endpoint dialog box, set the parameters.
    Table 5 Parameter description

    Parameter

    Description

    Service Endpoint Name

    Name of the service endpoint.

    GitLab URL

    Public network address (HTTP or HTTPS address) of the official or self-built GitLab repository.

    Username

    Username for logging in to the GitLab repository.

    Access Token

    Obtain an access token of the GitLab repository and enter it here for authentication.

  4. Click OK.

Creating a GitHub Service Endpoint

After connecting to a GitHub repository, you can obtain the repository and branch information.

Currently, only AP-Singapore is supported.

  1. In a project, choose Settings > General > Service Endpoints.
  2. Click Create Endpoint and choose GitHub repository from the drop-down list.
  3. In the Create Service Endpoint dialog box, select an authentication mode and set other parameters.
    • OAuth authentication
      Table 6 Parameter description

      Parameter

      Description

      Service Endpoint Name

      Name of the service endpoint.

      Authentication Mode

      In OAuth authentication mode, log in to GitHub for manual authorization.

    • Access token authentication
      Table 7 Parameter description

      Parameter

      Description

      Service Endpoint Name

      Name of the service endpoint.

      Authentication Mode

      Access token authentication is used.

      Access Token

      Obtain an access token and enter it here for authentication.

  4. Click OK.

Creating a Git Service Endpoint

After connecting to a Git repository, you can obtain the repository and branch information.

  1. In a project, choose Settings > General > Service Endpoints.
  2. Click Create Endpoint and choose Git repository from the drop-down list.
  3. In the Create Service Endpoint dialog box, set the parameters.
    Table 8 Parameter description

    Parameter

    Description

    Service Endpoint Name

    Name of the service endpoint.

    Git Repository URL

    Web URL of a Git repository (HTTPS address).

    Username

    Username used for logging in to the Git repository.

    Password or Access Token

    Password or access token used for logging in to the Git repository.

  4. Click OK.

Creating an IAM User Service Endpoint

You can use an IAM user endpoint to delegate your AK/SK to the IAM user that needs to perform tasks. The user can obtain the token of your account through the AK/SK to perform tasks required higher permissions.

  1. In a project, choose Settings > General > Service Endpoints.
  2. Click Create Endpoint and choose IAM user from the drop-down list.
  3. In the Create Service Endpoint dialog box, set the parameters.
    Table 9 Parameter description

    Parameter

    Description

    Service Endpoint Name

    Name of the service endpoint.

    Access Key Id

    Access Key ID (AK). For details, see How Do I Obtain an Access Key (AK/SK)?

    Secret Access Key

    Secret Access Key (SK). For details, see How Do I Obtain an Access Key (AK/SK)?

  4. Click OK.

Creating a CodeArts Repo HTTPS Service Endpoint

The CodeArts Repo HTTPS endpoint is used to authorize CodeArts to download code, create branches, merge branches, and commit code in the Repo repository. Currently, it is mainly used for the microservice's pipeline on changes and related extensions.

  1. In a project, choose Settings > General > Service Endpoints.
  2. Click Create Endpoint and choose CodeArts Repo HTTPS from the drop-down list.
  3. In the Create Service Endpoint dialog box that is displayed, set the parameters.
    Table 10 Parameter description

    Parameter

    Description

    Service Endpoint Name

    Name of the service endpoint.

    CodeArts Repo URL

    Prefix of the clone address of the CodeArts Repo repository. The prefix can be obtained from CodeArts Repo.

    1. Go to any code repository in the project.
    2. Obtain the HTTPS clone address of the code repository and enter https://example.com.
    NOTE:

    When creating this endpoint during the pipeline creation, you do not need to set this parameter.

    Username

    HTTPS username is used to perform operations on the CodeArts Repo repository. The format is Tenant name/IAM username. Enter a complete username without spaces at the beginning or end.

    Password

    HTTPS password credential used to operate the CodeArts Repo repository.

    Click the username in the upper right corner and choose This Account Settings > Repo > HTTPS Password to view and set the username and password.

  4. Click OK.

Editing or Deleting a Service Endpoint

On the Service Endpoints page, click a service endpoint on the list. The service endpoint details and operation buttons are displayed. Authorized users can edit and delete service endpoints.

After editing a referenced endpoint, you need to manually update the associated pipeline task.