如何传递凭据以在私有 AKS 群集的 Azure 托管代理上运行脚本
我在Azure上使用Linux VM创建了一个私有AKS群集,该Linux VM充当自托管代理\堡垒。 Linux框可以通过Kubectl访问AKS群集。我的问题是,当我尝试在Azure DevOps管道中运行bash脚本时,我被拒绝了。(管道使用上面的自托管代理)BASH脚本运行一个helm命令,该命令获得AKS需要的图像列表。我想使用此列表将图像从外部码头注册表中拉出,然后将它们推到内部Azure容器注册表中,然后使用Helm进行部署。
这是脚本中的Helm命令:
Helm升级 - 安装托管节点-f Helm_config.yaml myApp/hosted-app-Dry-run -n-n dev | grep“图像:” |尴尬“ {print $ 2}” | uniq | sed“ s/” // g“ | grep” myApp“ | sed” s/^s/^image:// g“
管道流如下:
获取所需图像的列表
从私人Docker Repo
拔出图像将图像推到ACR
运行helm(将配置为使用ACR中的图像)
如何为构建代理提供管道中的适当信用以运行上述命令。
谢谢, 射线
I have a created a private AKS cluster on Azure with a Linux VM that acts as self hosted agent\Bastion. The Linux box can access the AKS cluster via Kubectl. My issue is when I try to run a bash script in the Azure DevOps pipeline, I get permission denied.(The pipeline is using the selfhosted agent above) The Bash script runs a Helm command that get a list of the images that AKS will need. I want to use this list to pull images from an external Docker registry and push them to an internal Azure Container Registry and then use Helm to deploy.
Here is the Helm command in the script:
helm upgrade --install hosted-node -f helm_config.yaml myapp/hosted-app --dry-run -n dev | grep "image:" | awk "{print $2}" | uniq | sed "s/"//g" | grep "myapp" | sed "s/^.*image: //g"
The pipeline flow is like this:
Get list of images needed
Pull images from a private Docker repo
Push images to ACR
Run Helm (it will be configured to use images in the ACR)
How to I give the build agent the proper creds from the pipeline to run the above command.
Thanks,
Ray
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Tokens can now be used in your scripts for authentication.