【发布时间】:2020-12-10 16:49:38
【问题描述】:
我使用ubuntu-latest 作为构建 vmImage 来构建管道中的所有容器。现在我正在尝试将以前构建的容器部署到 AKS。
根据documentation,它应该是这样的:
- stage: Deploy
displayName: Deploy stage
dependsOn: Build
jobs:
- deployment: Deploy
displayName: Deploy job
pool:
vmImage: $(vmImageName)
很遗憾,没有描述变量$(vmImageName) 指的是什么,并且无法再按照步骤进行操作,因为使用可视化界面使用的是 Helm,这会让我更加困惑。
我正在构建这样的容器:
- 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 群集?
【问题讨论】: