Azure devops Azure DevOps中部署作业期间的池是什么?
我正在使用Azure devops Azure DevOps中部署作业期间的池是什么?,azure-devops,azure-aks,Azure Devops,Azure Aks,我正在使用ubuntu-latest作为我的build-vmImage,用于在管道中构建所有容器。现在,我正在尝试将以前构建的容器部署到AKS 根据这本书,它应该是这样的: - stage: Deploy displayName: Deploy stage dependsOn: Build jobs: - deployment: Deploy displayName: Deploy job pool: vmImage: $(vmImageName)
ubuntu-latest
作为我的build-vmImage,用于在管道中构建所有容器。现在,我正在尝试将以前构建的容器部署到AKS
根据这本书,它应该是这样的:
- stage: Deploy
displayName: Deploy stage
dependsOn: Build
jobs:
- deployment: Deploy
displayName: Deploy job
pool:
vmImage: $(vmImageName)
- job: BuildSQL
displayName: Build SQL Server Container image
pool:
vmImage: "ubuntu-latest"
steps:
- task: Docker@2
displayName: Build an image
inputs:
command: buildAndPush
dockerfile: "$(Build.SourcesDirectory)/Code/Database/Docker/Dockerfile"
arguments: -o $(Build.ArtifactStagingDirectory)/xxx.sql.tar
containerRegistry: $(dockerRegistryServiceConnection)
repository: his.sql
tags: |
$(tag)
#publish the results of the previous task as manifest to be picked up by the deployment job
- task: PublishPipelineArtifact@1
inputs:
artifactName: 'his.sql.tar'
path: $(Build.ArtifactStagingDirectory)
不幸的是,没有对变量$(vmImageName)
所指内容的描述,也不可能再遵循这些步骤,因为使用可视化界面使用Helm,这会让我更加困惑
我正在这样构建容器:
- stage: Deploy
displayName: Deploy stage
dependsOn: Build
jobs:
- deployment: Deploy
displayName: Deploy job
pool:
vmImage: $(vmImageName)
- job: BuildSQL
displayName: Build SQL Server Container image
pool:
vmImage: "ubuntu-latest"
steps:
- task: Docker@2
displayName: Build an image
inputs:
command: buildAndPush
dockerfile: "$(Build.SourcesDirectory)/Code/Database/Docker/Dockerfile"
arguments: -o $(Build.ArtifactStagingDirectory)/xxx.sql.tar
containerRegistry: $(dockerRegistryServiceConnection)
repository: his.sql
tags: |
$(tag)
#publish the results of the previous task as manifest to be picked up by the deployment job
- task: PublishPipelineArtifact@1
inputs:
artifactName: 'his.sql.tar'
path: $(Build.ArtifactStagingDirectory)
在下一个阶段中,如果您希望拾取工件,然后部署它:
- stage: DeploySQL
displayName: 'Deploy SQL Container to AKS'
dependsOn: BuildSQL
jobs:
- deployment: Deploy
displayName: Deploy job
pool:
vmImage: "ubuntu-latest"
environment: 'sql-test.default'
strategy:
runOnce:
deploy:
steps:
- task: DownloadPipelineArtifact@2
inputs:
artifactName: 'manifests'
downloadPath: '$(Build.ArtifactStagingDirectory)/xxx.sql.tar'
部署作业随后失败,并显示以下错误消息:
##[error]Pipeline does not have permissions to use the referenced pool(s) . For authorization details, refer to https://aka.ms/yamlauthz.
我在这里不知所措,不知道游泳池实际上指的是什么,也不知道应该进入那里。如何将其推送到Azure中已配置的AKS群集?我认为这可能会有所帮助。如果你对ubuntu最新版本没有强烈的偏好,那么根本不要指定一个
vmImage
!微软将提供一个没有需求的私人泳池
如果您确实有特定需求,您可以将需求:
行添加到“pool”部分
我想这可能会有帮助。如果你对ubuntu最新版本没有强烈的偏好,那么根本不要指定一个
vmImage
!微软将提供一个没有需求的私人泳池
如果您确实有特定需求,您可以将需求:
行添加到“pool”部分
问题实际上可能是您在这里引用的
vmImage:“ubuntu最新版本”
,请尝试将其更改为vmImage:“ubuntu最新版本”
关于将池作为变量传递,您应该记住:
仅使用全局级别变量定义池名称。不支持阶段/作业级别变量来定义池名称
然而,如果我的第一个建议没有帮助,请检查
因为您可能需要获得默认池的权限
问题实际上可能是您在这里引用的
vmImage:“ubuntu最新版本”
,请尝试将其更改为vmImage:“ubuntu最新版本”
关于将池作为变量传递,您应该记住:
仅使用全局级别变量定义池名称。不支持阶段/作业级别变量来定义池名称
然而,如果我的第一个建议没有帮助,请检查
因为您可能需要获得默认池的权限