Capability | tcr-assistant | tcr-assistant-oidc |
Credential type | Static long-term credentials (username + password) | Dynamic temporary keys, automatically rotated |
Cross-account pull | Only supports pulling from the same account. | Supports pulling from the same account and across accounts |
Security | Long-term key exposure risk | Temporary keys are rotated periodically and automatically expire. |
Term | Type | Resource Capacity | Namespace |
tcr-assistant-system | Namespace | 1 | - |
tcr-assistant-oidc-manager-role | ClusterRole | 1 | - |
tcr-assistant-oidc-manager-rolebinding | ClusterRoleBinding | 1 | - |
tcr-assistant-oidc-leader-election-role | Role | 1 | tcr-assistant-system |
tcr-assistant-oidc-leader-election-rolebinding | RoleBinding | 1 | tcr-assistant-system |
tcr-assistant-oidc-controller-manager | ServiceAccount | 1 | tcr-assistant-system |
tcr-assistant-oidc-webhook-server-cert | Secret | 1 | tcr-assistant-system |
tcr-assistant-oidc-webhook-service | Service | 1 | tcr-assistant-system |
tcr-assistant-oidc-mutating-webhook-configuration | MutatingWebhookConfiguration | 1 | - |
oidcimagepullsecrets.tcr.tencentcloudcr.com | CustomResourceDefinition | 1 | - |
tcr-oidc-* | OIDCImagePullSecret CRD | (1-N) | tcr-assistant-system |
tcr.ips.* | Secret | (1-N)*{Namespace No.} | Target Namespace |
tcr-assistant-oidc-controller-manager | Deployment | 1 | tcr-assistant-system |
Component | Resource Usage | Number of instances |
tcr-assistant-oidc-controller-manager | CPU:600m memory:512Mi | 2 (multi-replica high availability) |
imagePullSecrets field of the target ServiceAccount. When you create or update resources using YAML, you do not need to explicitly configure ImagePullSecret. The cluster will automatically use the delivered dynamic credentials to pull images.docker.mycompany.com) is bound to a TCR Enterprise Edition instance, the component can write the custom domain into the generated dockerconfigjson. This allows workloads to pull images directly via the custom domain.AssumeRoleWithWebIdentity API. Internally, the Controller periodically triggers credential rotation based on tokenExpiration to mitigate the risk of long-term credential exposure.ServiceAccountIssuerDiscovery feature to General Availability.)pod-identity-webhook component must be installed successfully.tcr:DescribeInstances, tcr:PullRepository, and so on) in CAM and grant them to the appropriate roles. It is recommended that users with TCR administrator and CAM administrator permissions complete the component initialization configuration.namespaces and serviceAccounts do not support wildcard expressions. You must explicitly specify the resource names or use * to indicate all.tokenExpiration between 3600 and 5400 seconds. This prevents the temporary credentials (with a validity period of 7200 seconds) from expiring before they are rotated in a timely manner.Function | Object Involved | Operation Permission Involved |
Requires the feature of password-free image pulling, which proactively manages image pull credentials (secret) for customers. | Secret | watch,create,update,patch,delete |
Performs leader election by creating and updating ConfigMaps/Leases to ensure high availability of components. | ConfigMap,Lease | get,list,watch,create,update,patch,delete |
Monitors the creation and update of namespaces and automatically injects image pull credentials when needed. | Namespace | get,list,watch |
Query and update service accounts. | ServiceAccount | get,list,watch,patch,update |
Manages custom resources (CRD) to achieve dynamic orchestration of credentials. | OIDCImagePullSecret | get,list,watch,create,update,patch,delete |
Admission fallback during Pod creation, checking and injecting ImagePullSecrets. | Pod (Admission) | Intercept CREATE events with MutatingWebhook |
apiVersion: rbac.authorization.k8s.io/v1kind: Rolemetadata:name: tcr-assistant-oidc-leader-election-rolenamespace: tcr-assistant-systemrules:- apiGroups: [""]resources: ["configmaps"]verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]- apiGroups: ["coordination.k8s.io"]resources: ["leases"]verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]- apiGroups: [""]resources: ["events"]verbs: ["create", "patch"]---apiVersion: rbac.authorization.k8s.io/v1kind: ClusterRolemetadata:name: tcr-assistant-oidc-manager-rolerules:- apiGroups: [""]resources: ["secrets"]verbs: ["create", "delete", "get", "list", "patch", "update", "watch"]- apiGroups: [""]resources: ["namespaces"]verbs: ["get", "list", "watch"]- apiGroups: [""]resources: ["serviceaccounts"]verbs: ["get", "list", "patch", "update", "watch"]- apiGroups: [""]resources: ["serviceaccounts/status"]verbs: ["get", "patch", "update"]- apiGroups: ["admissionregistration.k8s.io"]resources: ["mutatingwebhookconfigurations"]verbs: ["create", "get", "patch", "update"]- apiGroups: ["tcr.tencentcloudcr.com"]resources: ["oidcimagepullsecrets"]verbs: ["create", "delete", "get", "list", "patch", "update", "watch"]- apiGroups: ["tcr.tencentcloudcr.com"]resources: ["oidcimagepullsecrets/status"]verbs: ["get", "patch", "update"]
imagePullSecrets to any Namespace based on OIDC identity and associate them with the ServiceAccount in that namespace. When a user-created workload does not explicitly specify an imagePullSecret or a serviceAccount, Kubernetes attempts to find and match a suitable imagePullSecret from the ServiceAccount resource named default in the current namespace.tokenExpiration. This approach mitigates the risk of long-term credential exposure.Name | Alias | Description |
OIDCImagePullSecret | oips | A CRD defined by tcr-assistant-oidc, which declares credential sources (roleArn / registries) and distribution rules (namespaces / serviceAccounts / customDomains). |
OIDC Token | - | A JWT injected into the Controller Pod by pod-identity-webhook, issued by the TKE cluster API Server, and used as a credential for cross-account identity trust. |
STS AssumeRoleWithWebIdentity | - | A Tencent Cloud STS API that exchanges an OIDC Token for temporary SecretId / SecretKey / Token of a specified role. |
Account A / Account B | - | Account A: the account where the TCR instance resides (image provider); Account B: the account where the TKE cluster resides (image consumer). In a same-account scenario, A = B. |
oidcimagepullsecrets.tcr.tencentcloudcr.com. This CRD has a kind of OIDCImagePullSecret, a version of tcr.tencentcloudcr.com/v1, and an abbreviation of oips.Namespace and ServiceAccount resources in the Kubernetes cluster. When these resources change, it checks whether the changes match the rules defined in OIDCImagePullSecret to automatically deploy the Secret resources required for pulling images from private image repositories. The program is deployed within the Kubernetes cluster and accesses the Kubernetes master API using the in-cluster mode. It also relies on the TKE official pod-identity-webhook to inject OIDC Tokens into the Controller Pod and obtains dynamic temporary credentials through Tencent Cloud STS.tcr:DescribeInstances and tcr:PullRepository.qcs::cam::uin/{UIN}:roleName/{ROLE_NAME}. The Controller uses it to call STS and obtain temporary credentials.{registry}.tencentcloudcr.com, {registry}-vpc.tencentcloudcr.com, and the user-configured customDomains.OIDCImagePullSecret resource is automatically created. You can also create it manually using kubectl or Client Go:# Create an OIDCImagePullSecret resource$ kubectl create -f oidcimagepullsecret-sample.yamloidcimagepullsecret.tcr.tencentcloudcr.com/tcr-oidc-sample created
OIDCImagePullSecret resource sample file:apiVersion: tcr.tencentcloudcr.com/v1kind: OIDCImagePullSecretmetadata:name: tcr-oidc-samplespec:namespaces: "*"serviceAccounts: "*"roleArn: "qcs::cam::uin/100001113387:roleName/tcr-cross-account-role"registries:- "your-tcr-registry"customDomains:- "docker.mycompany.com"tokenExpiration: 3600
OIDCImagePullSecret spec fields are explained in the following table:Field | Function | Annotation |
namespaces | Namespace matching rule | * or an empty string indicates matching any Namespace. Separate multiple namespaces with ,.Note: Expressions are not supported. Specify the exact resource name. |
serviceAccounts | ServiceAccount matching rule | * or an empty string indicates matching any ServiceAccount. Separate multiple ServiceAccounts with ,.Note: Expressions are not supported. Specify the exact resource name. |
roleArn | CAM role ARN for Account A | Used for STS AssumeRoleWithWebIdentity. Format: qcs::cam::uin/{UIN}:roleName/{ROLE_NAME}. |
registries | List of TCR instance names | Enter only the instance name, without the domain suffix. The component automatically combines the public network/VPC domain. |
customDomains | List of custom domain names for TCR instances | Optional. Used for custom domain pull scenarios. It is additionally written into the auths of dockerconfigjson. |
tokenExpiration | Secret rotation interval (seconds) | Recommended range: 3600~5400. Default: 3600. Must not exceed the validity period of STS temporary credentials (7200s). |
# List OIDCImagePullSecret information$ kubectl get oipsNAME NAMESPACES SERVICE-ACCOUNTS REGISTRIES CREDENTIAL-STATUStcr-oidc-sample * * [your-tcr-registry] Ready# View detailed information$ kubectl describe oips tcr-oidc-sampleName: tcr-oidc-sampleNamespace:API Version: tcr.tencentcloudcr.com/v1Kind: OIDCImagePullSecretSpec:Namespaces: *Service Accounts: *Role Arn: qcs::cam::uin/100001113387:roleName/tcr-cross-account-roleRegistries: [your-tcr-registry]Custom Domains: [docker.mycompany.com]Token Expiration: 3600Status:Credential Status: ReadyLast Refresh Time: 2026-08-05T10:00:00ZNext Refresh Time: 2026-08-05T11:00:00ZSecrets Desired: 10Secrets Success: 10Events: <none>
Secret resource deployed by tcr-assistant-oidc, you do not need to delete and recreate the OIDCImagePullSecret resource. After the fields such as spec.roleArn, spec.registries, and spec.customDomains are modified, the Controller automatically reconciles, and the Secret content is refreshed in the next rotation cycle.Namespace resource, tcr-assistant-oidc first checks whether its name matches the namespaces field in the OIDCImagePullSecret resource. If the resource name does not match, it skips the subsequent steps. If the resource name matches, it calls STS to obtain temporary credentials, renders the dockerconfigjson, calls the Kubernetes API to create a Secret resource, and adds the Secret resource name to the imagePullSecrets field of the ServiceAccount resource in that namespace. An example is provided below:# View the automatically deployed Secret in the newns namespace$ kubectl get secrets -n newnsNAME TYPE DATA AGEtcr.ips.tcr-oidc-sample kubernetes.io/dockerconfigjson 1 7m2s# View the container registry domains contained in the dockerconfigjson$ kubectl get secret tcr.ips.tcr-oidc-sample -n newns \\-o jsonpath='{.data.\\.dockerconfigjson}' | base64 -d | jq '.auths | keys'["your-tcr-registry.tencentcloudcr.com","your-tcr-registry-vpc.tencentcloudcr.com","docker.mycompany.com"]# View the Secret that is automatically associated with the default ServiceAccount resource in the newns namespace$ kubectl get serviceaccounts default -o yaml -n newnsapiVersion: v1imagePullSecrets:- name: tcr.ips.tcr-oidc-samplekind: ServiceAccountmetadata:name: defaultnamespace: newns
ServiceAccount resource, tcr-assistant-oidc first checks whether its name matches the serviceAccounts field in the OIDCImagePullSecret resource. If the resource name does not match, it skips the subsequent steps. If the resource name matches, it calls the Kubernetes API to create or update a Secret resource and adds the Secret resource name to the imagePullSecrets field of the ServiceAccount resource. An example is provided below:# Create a ServiceAccount resource in the newns namespace$ kubectl create sa kung -n newnsserviceaccount/kung created# View the Secret that is automatically associated with the newly created ServiceAccount resource named kung in the newns namespace$ kubectl get serviceaccounts kung -o yaml -n newnsapiVersion: v1imagePullSecrets:- name: tcr.ips.tcr-oidc-samplekind: ServiceAccountmetadata:name: kungnamespace: newns
tokenExpiration. During each rotation, it re-invokes the STS AssumeRoleWithWebIdentity API to obtain new temporary credentials and updates the content of the distributed Secret. Running Pods do not require a restart and will use the new credentials during the next image pull. When the Controller version is upgraded, existing Secrets remain uninterrupted, and the Controller automatically resumes reconciliation after restarting.CheckIntervalMs to prevent Pods from failing to pull images due to timing issues.Scenario | Prerequisite | Operation Document |
Passwordless Pull Within the Same Account | The TKE cluster and the TCR Enterprise Edition instance belong to the same Tencent Cloud account. | |
Passwordless Pull Across Accounts | The TKE cluster and the TCR Enterprise Edition instance belong to different Tencent Cloud accounts. |
roleArn / registries / namespaces / serviceAccounts / customDomains / tokenExpiration) are completely identical. The only difference lies in the party responsible for configuring the OIDC identity provider and the role trust policy on the CAM side.Apakah halaman ini membantu?
Anda juga dapat Menghubungi Penjualan atau Mengirimkan Tiket untuk meminta bantuan.
masukan