- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我使用 Azure Devops 创建了一个部署管道,通过它构建镜像并将其推送到 Azure 容器注册表。在下一步中,我将从 ACR 部署到我使用以下命令创建并附加到 ACR 的 AKS 集群:az aks create -n HealthCareAKSCluster -g AKSCICDRG --generate-ssh-keys --attach-acr HealthCareAKSCICDACR以下是我的 yaml 代码:
# Docker
# Build and push an image to Azure Container Registry
# https://learn.microsoft.com/azure/devops/pipelines/languages/docker
trigger:
- master
resources:
- repo: self
variables:
# Container registry service connection established during pipeline creation
dockerRegistryServiceConnection: 'XXXXXXXXXX'
imageRepository: 'patientservice'
containerRegistry: 'healthcareakscicdacr.azurecr.io'
dockerfilePath: './PatientService/Dockerfile'
tag: '$(Build.BuildId)'
# Agent VM image name
vmImageName: 'ubuntu-latest'
stages:
- stage: Build
displayName: Build and push stage
jobs:
- job: Build
displayName: Build
pool:
vmImage: $(vmImageName)
steps:
- task: Docker@2
displayName: Build and push an image to container registry
inputs:
command: buildAndPush
repository: $(imageRepository)
dockerfile: $(dockerfilePath)
containerRegistry: $(dockerRegistryServiceConnection)
tags: |
$(tag)
- stage: Deploy
displayName: Deploy
jobs:
- job: Deploy
displayName: Deploy
pool:
vmImage: $(vmImageName)
steps:
- task: Kubernetes@1
displayName: Deploy an image to AKS
inputs:
connectionType: 'Azure Resource Manager'
azureSubscriptionEndpoint: 'XXXXXXX'
azureResourceGroup: 'AKSCICDRG'
kubernetesCluster: 'HealthCareAKSCluster'
command: 'apply'
arguments: '-f patientservice.yaml'
secretType: 'dockerRegistry'
containerRegistryType: 'Azure Container Registry'
即使部署步骤也运行良好,但当我在 AKS 集群中执行“kubectl get pods”时,我得到的 pod 状态为 ImagePullBackOff 或 ErrImagePull。当我执行“kubectl描述pod”时,我收到以下消息:
Failed to pull image "patientservice": rpc error: code = Unknown desc = Error response from daemon: pull access denied for patientservice, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
请帮助我如何部署正确的镜像。
最佳答案
问题出在 Patientservice.yaml 文件中。我忽略了它。以前的图像只有服务名称。我将以下内容添加到 Patientservice.yaml 中的图像中:
image: healthcareakscicdacr.azurecr.io/patientservice:latest
部署工作正常。
关于Azure Devops kubectl 任务部署的镜像的状态为 ErrImagePull/ImagePullBackOff,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62424570/
使用 Config View 获取以下输出。注意没有“当前上下文” root@Bootstrap [ /etc ]# kubectl config view apiVersion: v1 cluste
最近在学习Kubernetes,对“kubectl apply”和“kubectl replace”的区别不是很清楚。有没有我们只能使用其中一种的情况? 最佳答案 我已经写了一篇关于 apply、re
我想使用单个 kubectl patch 命令修补 Kubernetes 部署中的所有 容器模板,而不必知道它们的名称。这可能吗? 我知道我可以通过awk、sed、jq和kubectl replace
我能找到的唯一两种身份验证方法是创建一个新的身份验证上下文,例如 kubectl config set-credentials gajus/foo --token=foo kubectl config
我正在尝试使用 kubectl -o jsonpath 从服务 yaml(在元数据注释下)检索 kubernetes last-applied-configuration,但该字段的名称是“kubec
我在 k8s 中已有部署,我想更新容器,我在部署和运行中更新了 docker 镜像标签(新的唯一 ID): kubectl apply -f testdeploy.yml --namespace=my
我正在尝试在 kubectl 中使用 kustomize。具体来说,我想知道等效的 kubectl 命令: kustomize build --load_restrictor LoadRestrict
对于每个带有kubectl的命令,我需要使用sudo kubectl。 我了解安全性观点,但是我正在测试环境中工作,并且希望能够不使用sudo来使用它。 我尝试运行sudo -i并使用root帐户运行
如何在 YAML 文件中使用环境变量? 我正在使用 kubectl 创建命名空间,并想知道如何使用变量而不是 testnamespace喜欢 name: $var apiVersion: v1 kin
我使用 Mac OS 作为开发环境。 如果我安装 minikube , kubectl将使用 minikube 制作的本地集群作为默认选项。我发现我可以使用 kubectl命令与 minikube前缀
我对文档的理解是: kubectl create 在集群中创建新的 k8s 资源 kubectl replace 更新实时集群中的资源 kubectl apply 如果我想做创建+替换 ( Refer
我是 k8s 新手,在这里遇到了一个小问题。 上下文如下:我需要每天通过 crontask 调用 kubectl delete [podname] 一次,并等到 k8s 重新创建 pod,然后登录到该
通过使用kubectl exec -ti POD_NAME bash我能够访问容器内的终端并执行命令。 我能理解上面命令的可用性和方便性。作为 K8s 运算符(operator),我经常使用 exec
我是 kubernetes 的新手,正在尝试了解何时使用 kubectl autoscale 和 kubectl scale 命令 最佳答案 部署中的 规模 表示应始终运行多少 pod 以确保应用程序
我用 kubectl create -f pod.xml 创建了一个 pod和 kubectl apply -f pod.xml使用下面的 yaml,我没有看到任何区别,使用这两个命令创建了一个 po
我一直在使用带有各种标志的“kubectl run”以交互方式运行作业,但最近我已经超出了我可以用这些标志做的事情,并且已经逐渐使用 YAML 配置文件来描述我的工作。 但是,我找不到与“-i”和“-
在reference docs ,他们说您可以像这样打印容器的图像。 kubectl get pod test-pod -o custom-columns=CONTAINER:.spec.contai
我正在使用 kubectl 来控制 Azure 上的 Kubernetes 服务(扩展、获取 pod 状态)。在生产脚本中自动调用 kubectl 是否安全,而不用担心凭证会过期? 这是我在生产服务器
我正在尝试使用 kubeadm 工具创建一个高可用性集群。我正在尝试安装 kubeadm 安装的先决条件中指定的工具。当我运行时 sudo apt-get install -y kubelet kub
我的 CI 工具使用生命周期,所以如果 Dev 部署有效,它会进入 QA。 我有一个端到端的测试容器,我想在 kubernetes 中运行,但是如何从容器中获取退出代码? 我可以以某种方式运行容器并在
我是一名优秀的程序员,十分优秀!