云容器实例 CCI-镜像:使用第三方镜像拉取用户业务镜像
时间:2025-03-21 17:10:57
使用第三方镜像拉取用户业务镜像
- 使用CCI提供的工具创建第三方镜像仓库认证secret。
imagepull-secret-generator --ak=$ak --sk=$sk --private-user=$user --private-password=$password --output-file-path=my-imagepull-secret.json --project-name=region --secret-name=my-imagepull-secret --swr-address=swr.***.com
登录CCE集群节点,为集群创建secret。kubectl apply -f my-imagepull-secret.json
- 创建负载,使用secret。
在spec.imagePullSecrets中指定第三方仓库认证secret。
apiVersion: apps/v1 kind: Deployment metadata: labels: app: test-imagepull virtual-kubelet.io/burst-to-cci: enforce name: test-imagepull spec: replicas: 1 selector: matchLabels: app: test-imagepull template: metadata: labels: app: test-imagepull spec: containers: - image: xxx/my-image:latest imagePullPolicy: Always name: nginx resources: limits: cpu: 1 memory: 2Gi requests: cpu: 1 memory: 2Gi imagePullSecrets: - name: my-imagepull-secret
support.huaweicloud.com/usermanual-cci/cci_01_0118.html