我有一个管道,我需要在其中运行一些 helm 命令才能部署某些内容。我运行
az login
,然后运行我的 az aks get-credentials
。之后,如果我尝试运行 helm install
甚至 kubectl get all
,它会不断要求通过网络浏览器进行身份验证。如果我可以从虚拟机执行此操作,我不明白我做错了什么。
echo "Getting credentials to AKS cluster: akstest1"
az aks get-credentials -g rgtest1 -n akstest1 --overwrite-existing
echo "Container Registry Login to $(acrurl)"
helm registry login $(acrurl) --username $(acruser) --password $(acrtoken)
echo "Running helm uninstall"
helm delete nfs --kubeconfig /home/AzDevOps/.kube/config
这是我的管道的输出
/usr/bin/bash --noprofile --norc /agent/_work/_temp/08e2b7e1-4985-4d94-9809-b8cf0d1a2d5d.sh /agent/_work/_temp/08e2b7e1-4985-4d94-9809-b8cf0d1a2d5d.sh:第 1 行: 获取 AKS 群集的凭据:${{parameters.clusterName}}:错误 替换警告:将“akstest1”合并为当前 /home/AzDevOps/.kube/config 中的上下文
容器注册表登录 crviyatrsasptvaldecc1.azurecr.io
警告:通过 CLI 使用 --password 是不安全的。使用 --密码-stdin。
登录成功
运行 helm 卸载
要登录,请使用网络浏览器打开页面 https://microsoft.com/devicelogin 并输入代码 A9EVL8AVJ 验证。
##[错误]操作已取消。整理:nfs
您可以尝试此操作,这将添加注册表并一步登录(我的示例是使用神器帐户,因此您应该在我使用神器的地方使用您的天蓝色注册表):
helm repo add --username=$(acruser) --password=$(acrtoken) $(acrurl) https://artifacts.com/artifactory/xxx-helm