Updated on 2024-06-27 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, the Jenkins service to execute Jenkins tasks, a Kubernetes cluster for deployment, a Nexus repository to add private Maven repository information, or a Docker repository to manage Docker images, or create an IAM user endpoint to delegate the AK/SK of your account to the desired IAM user.

Prerequisites

  • By default, the project manager and project creator have all permissions for service endpoints, and other roles have only the read permission.
  • Ensure that the third-party services configured in the service endpoint can be accessed through the public network without restrictions.

Creating a Docker Repository Service Endpoint

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

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

    Parameter

    Description

    Service Endpoint Name

    Name of the service endpoint.

    Repository Address

    Address of the Docker image repository (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 Jenkins. After the connection is successful, you can perform operations on Jenkins tasks.

Currently, this function is available in LA-Mexico City2, LA-Sao Paulo1, and AP-Singapore.

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

    Parameter

    Description

    Service Endpoint Name

    Name of the service endpoint.

    Server URL

    Address of the Jenkins service. 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. Access a project, choose Settings > General > Service Endpoints.
  2. Click Create Endpoint and select Kubernetes from the drop-down list.
  3. In the Create Service Endpoint dialog box, set parameters.
    Table 3 Parameter description

    Parameter

    Description

    Service Endpoint Name

    Name of the service endpoint.

    Kubernetes URL

    API server address of the Kubernetes cluster (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, this function is available in LA-Mexico City2, LA-Sao Paulo1, and AP-Singapore.

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

    Parameter

    Description

    Service Endpoint Name

    Name of the service endpoint.

    Repository URL

    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, this function is available in LA-Mexico City2, LA-Sao Paulo1, and AP-Singapore.

  1. Access a project, choose Settings > General > Service Endpoints.
  2. Click Create Endpoint and select GitLab repository from the drop-down list.
  3. In the Create Service Endpoint dialog box, set 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 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, this endpoint is available in LA-Mexico City2, LA-Sao Paulo1, AP-Singapore, and TR-Istanbul.

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

    Parameter

    Description

    Service Endpoint Name

    Name of the service endpoint.

    Git Repository URL

    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. The user can obtain the token of your account through the AK/SK to perform tasks with higher permissions.

  1. Access a project, choose Settings > General > Service Endpoints.
  2. Click Create Endpoint and select IAM user from the drop-down list.
  3. In the Create Service Endpoint dialog box, set 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 used for change-triggered pipelines and related extensions.

  1. Access a project, choose Settings > General > Service Endpoints.
  2. Click Create Endpoint and select CodeArts Repo HTTPS from the drop-down list.
  3. In the Create Service Endpoint dialog box, set 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. Copy the HTTPS address of the code repository and enter https://example.com.
    NOTE:

    When creating a pipeline in the Pipeline homepage, you do not need to set this parameter for the Repo endpoint.

    Username

    HTTPS username used to push code to and pull code from Repo. HTTPS username can be the tenant name or IAM username. Enter a complete username without spaces.

    Password

    HTTPS password used to push code to and pull code from Repo.

    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 name. The endpoint details and operation buttons are displayed. Authorized users can edit and delete service endpoints.

After editing an endpoint used by a pipeline, you need to manually update the pipeline.