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 Kubernetes cluster to perform deployment tasks, 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.
- In a project, choose Settings > General > Service Endpoints.
- Click Create Endpoint and choose Docker repository from the drop-down list.
- 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.
- 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.
- In a project, choose Settings > General > Service Endpoints.
- Click Create Endpoint and choose Kubernetes from the drop-down list.
- In the Create Service Endpoint dialog box, set the parameters.
Table 2 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.
- Click OK.
Creating a Git Service Endpoint
After connecting to a Git repository, you can obtain the repository and branch information.
- In a project, choose Settings > General > Service Endpoints.
- Click Create Endpoint and choose Git repository from the drop-down list.
- In the Create Service Endpoint dialog box, set the parameters.
Table 3 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.
- 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.
- In a project, choose Settings > General > Service Endpoints.
- Click Create Endpoint and choose IAM user from the drop-down list.
- In the Create Service Endpoint dialog box, set the parameters.
Table 4 Parameter description Parameter
Description
Service Endpoint Name
Name of the service endpoint.
Access Key Id
Access Key ID (AK).How Do I Obtain an Access Key (AK/SK)?
Secret Access Key
Secret Access Key (SK). SeeHow Do I Obtain an Access Key (AK/SK)?
- 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.
- In a project, choose Settings > General > Service Endpoints.
- Click Create Endpoint and choose CodeArts Repo HTTPS from the drop-down list.
- In the Create Service Endpoint dialog box that is displayed, set the parameters.
Table 5 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.
- Go to any code repository in the project.
- Obtain the HTTPS clone address of the code repository and enter https://xxx.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.
- 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.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.