The OCI Connector is a platform-agnostic connector that allows you to connect to any OCI Registry, such as Docker Hub, Harbor, etc. You can use the OCI Connector to securely access private OCI repositories in CI/CD pipelines or perform OCI operations in containerized workloads without providing credentials. Additionally, you can centrally manage OCI access configurations, avoiding the need to duplicate OCI credential configurations in each namespace.
This document will describe:
The OCI Registry to be accessed must meet the following conditions:
Interface implementation requirements:
Authentication method requirements:
Use the constant value oci.
You can add descriptive information to the OCI Connector through the annotations field.
cpaas.io/description: Description of the OCI Connector.For example:
The spec.address specifies the access address of the OCI Registry, for example: https://index.docker.io.
The OCI Connector supports the following authentication types:
tokenAuth: Token-based authentication (optional)
cpaas.io/distribution-registry-token, this type of credential is used for the authentication process defined in the CNCF Distribution Token Authentication Specification, and the credential must provide username and password information.For example:
If the target OCI Registry does not require authentication, you can omit the authentication information. The configuration example is as follows:
The required permissions for the configured token depend on how you intend to use it in your Pods/Pipelines.
For example:
For security best practices, we recommend creating token with minimal required permissions. When additional privileges are needed, create separate Connectors with more privileged secret and use namespace isolation to control which users can access each Connector.
To provide clients with the ability to access OCI repositories without credentials, the OCI Connector type offers a proxy server to automatically inject authentication information.
Clients with access to the connector can use this proxy server to access OCI repositories without configuring credentials on the client side.
To simplify usage, the OCI Connector type provides configuration information that can be mounted into Pods via CSI. In the Pod, when performing OCI operations, the proxy service can be automatically used to complete OCI operations.
When a Connector is created, the system will:
status.proxy.httpAddress field.You can use this proxy address for image push and pull operations.
For example:
The OCI Connector created based on the OCI Connector type provides the following configurations:
docker-config: Configuration information required by Docker CLI.
config.json configuration file.For example:
dockerd: Configuration information for the Docker Daemon.
daemon.json configuration file.insecure-registries by default.For example:
buildkitd: Configuration information required by the BuildKit Daemon.
buildkitd.toml configuration file.insecure-registries by default.For example:
You can mount this configuration information into Pods using connectors-csi, and combined with the proxy capability, achieve image push or pull operations in a secretless manner.