Using Alauda Container Platform Registry in Kubernetes Clusters
The Alauda Container Platform (ACP) Registry provides secure container image management for Kubernetes workloads.
TOC
Registry Access Guidelines
- Internal Address Recommended: For images stored in the cluster's registry, always prioritize using the internal service address
image-registry.cpaas-system.svcwhen deploying within the cluster. This ensures optimal network performance and avoids unnecessary external routing. - External Address Usage: The external ingress domain (e.g.
registry.cluster.local) is primarily intended for:- Image pushes/pulls from outside the cluster (e.g., developer machines, CI/CD systems)
- Cluster-external operations requiring registry access
Deploy Sample Application
- Create an application named
my-appin themy-nsnamespace. - Store the application image in the registry at
image-registry.cpaas-system.svc/my-ns/my-app:v1. - The default ServiceAccount in each namespace is automatically configured with an imagePullSecret for accessing images from
image-registry.cpaas-system.svc.
Example Deployment:
Cross-Namespace Access
To allow users from my-ns to pull images from shared-ns, the administrator of shared-ns can create a role binding to grant the necessary permissions.
Example Role Binding
Best Practices
- Registry Usage: Always use
image-registry.cpaas-system.svcfor deployments to ensure security and performance. - Namespace Isolation: Leverage namespace isolation for better security and management of images.
- Use namespace-based image paths:
image-registry.cpaas-system.svc/<namespace>/<image>:<tag>.
- Use namespace-based image paths:
- Access Control: Use role bindings to manage cross-namespace access for users and service accounts.
Verification Checklist
- Validate image accessibility for the default ServiceAccount in
my-ns: - Validate image accessibility for a user in
my-ns:
Troubleshooting
- Image Pull Errors: Check the imagePullSecrets in the pod spec and ensure they are correctly configured.
- Permission Denied: Ensure the user or ServiceAccount has the necessary role bindings in the target namespace.
- Network Issues: Verify network policies and service configurations to ensure connectivity to the internal registry.
- DNS Failures: Check the content of
/etc/hostsfile on the node, ensure DNS resolution for theimage-registry.cpaas-system.svcis correctly configured.- Verify node's /etc/hosts configuration to ensure correct DNS resolution of
image-registry.cpaas-system.svc - Example showing registry service mapping (ClusterIP of image-registry service):
- How to get
image-registrycurrent ClusterIP:
- Verify node's /etc/hosts configuration to ensure correct DNS resolution of