Using Git Connector in Clone Tasks
TOC
Feature Overview
The Git Connector allows ordinary users to perform code cloning operations without directly handling credentials. With the connector, credential information is centrally managed by an administrator and is automatically injected into the cloning process when needed, enhancing security and convenience.
Use Cases
- Multiple teams share code repository access rights without sharing credentials.
- Secure access to private code repositories is needed in DevOps pipelines.
- Environments require centralized management of code repository access permissions.
- Avoid hardcoding or embedding Git credentials directly in Kubernetes workloads.
Prerequisites
Before using the feature, ensure:
- The Connectors Core component is deployed in the environment.
- The Connectors Git component is deployed in the environment.
- You have permissions to create Kubernetes resources (Namespace, Secret, Connector, etc.).
Steps
Follow these steps to use the Git Connector to complete code cloning:
-
Create a Namespace
-
Create Git Connector and its credentials
-
Create a clone job using the connector
-
View the clone job execution result
Parameter descriptions are as follows:
Operation Result
After successful configuration, the clone job will be able to complete the cloning of the code repository without directly using credentials. You can verify whether the cloning operation was successful by checking the logs.
Working Principle
To better understand the working principle of the Git Connector, we can create a long-running Pod to inspect the generated configuration:
Use the following command to view the contents of the generated configuration file:
Example of the generated configuration file:
During the Git clone process:
- The original Git repository address is automatically replaced by the
connectors-proxyservice address. - The system automatically injects authentication information for the proxy request (this information will expire after 30 minutes).
- The
connectors-proxyautomatically completes the injection of credential information on the server side to perform the clone operation.