我已经创建了构建和发布管道,它是基于azure devops服务的yaml。
我使用self host linux vm作为代理来运行我的管道。
当管道运行时,它完成所有阶段,但它一直在等待部署到k8s步骤。
请查找k8部署的Yaml
- task: Kubernetes@1
displayName: 'Deploy App in Development Environment'
inputs:
connectionType: 'Azure Resource Manager'
azureSubscriptionEndpoint: ''
azureResourceGroup: ''
kubernetesCluster: ''
command: 'apply'
arguments: '-f $(System.DefaultWorkingDirectory)dev.yaml'
管道在此阶段等待60分钟,通过以下错误
Deploy App in Development Enviroment
View raw log
Starting: Deploy App in Development Enviroment
==============================================================================
Task : Kubectl
Description : Deploy, configure, update a Kubernetes cluster in Azure Container Service by running kubectl commands
Version : 1.181.0
Author : Microsoft Corporation
Help : https://aka.ms/azpipes-kubectl-tsg
==============================================================================
Prepending PATH environment variable with directory: /usr/local/bin
==============================================================================
Kubectl Client Version: v1.20.4
Kubectl Server Version: Could not find kubectl server version
==============================================================================
/usr/local/bin/kubectl apply -f /home/-agent/_work/1/s/kubernetes/dev.yaml -o json
To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code CPDSWFNHR to authenticate.
Unable to connect to the server: context deadline exceeded (Client.Timeout exceeded while awaiting headers)
##[error]To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code CPDSWFNHR to authenticate.
##[error]Unable to connect to the server: context deadline exceeded (Client.Timeout exceeded while awaiting headers)
commandOutput
##[error]The process '/usr/local/bin/kubectl' failed with exit code 1
Finishing: Deploy App in Development Enviroment
1条答案
按热度按时间bejyjqdl1#
不妨试试以下方法:
allowPublicClient
设置为true
,将oauth2AllowIdTokenImplicitFlow
设置为true
。这里是a similar issue。
~/.kube/config
下的accessToken
和refreshToken
。