简体   繁体   English

回退拉取镜像“XYZ/customer-management/dev/72-kubernetes-setup:XYZ”

[英]Back-off pulling image "XYZ/customer-management/dev/72-kubernetes-setup:XYZ"

I am trying to automate build and deployment using gitlab CI.我正在尝试使用 gitlab CI 自动化构建和部署。 for this,i have added few steps like build, test, quality checks, review&deployment.为此,我添加了一些步骤,如构建、测试、质量检查、审查和部署。 Currently i am facing an issue on deployment, i am creating the docker image and pushing those images into the azure container registry and from there i'm trying to deploy on azure kubernetes by using helm.目前我面临部署问题,我正在创建 docker 映像并将这些映像推送到 azure 容器注册表中,然后我尝试使用 helm 在 azure kubernetes 上进行部署。 also i added ingress on the same.我也添加了入口。 but due to some issue docker image is not able to pull the image on kubernetes and throwing below error-但由于某些问题,docker image 无法在 kubernetes 上拉取图像并抛出以下错误- 在此处输入图片说明 and my gitlab ci pipeline getting success.和我的 gitlab ci 管道获得成功。 在此处输入图片说明 This is my deployment function which is written in .gitlab-ci.yml file-这是我的部署函数,它写在 .gitlab-ci.yml 文件中- 在此处输入图片说明

you need to grant AKS service principal ACRPull permission.您需要授予 AKS 服务主体ACRPull权限。 that will allow it to silently auth to the ACR without you doing anything (you dont even need to create a docker secret in kubernetes).这将允许它在您不做任何事情的情况下静默地对 ACR 进行身份验证(您甚至不需要在 kubernetes 中创建 docker secret)。

AKS_RESOURCE_GROUP=myAKSResourceGroup
AKS_CLUSTER_NAME=myAKSCluster
ACR_RESOURCE_GROUP=myACRResourceGroup
ACR_NAME=myACRRegistry

# Get the id of the service principal configured for AKS
CLIENT_ID=$(az aks show --resource-group $AKS_RESOURCE_GROUP --name $AKS_CLUSTER_NAME --query "servicePrincipalProfile.clientId" --output tsv)

# Get the ACR registry resource id
ACR_ID=$(az acr show --name $ACR_NAME --resource-group $ACR_RESOURCE_GROUP --query "id" --output tsv)

# Create role assignment
az role assignment create --assignee $CLIENT_ID --role acrpull --scope $ACR_ID

https://docs.microsoft.com/bs-latn-ba/azure/container-registry/container-registry-auth-aks https://docs.microsoft.com/bs-latn-ba/azure/container-registry/container-registry-auth-aks

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM