【问题标题】:ADO: error validating data: the server could not find the requestedADO:验证数据时出错:服务器找不到请求的
【发布时间】:2021-08-07 09:26:51
【问题描述】:

我面对的是similar issue。 “Deployment.yml”已成功应用,但“Services.yml”给了我

错误验证数据:服务器找不到请求的 资源

部署.yml

--- 
apiVersion: apps/v1
kind: Deployment
metadata: 
  name: #{component}#
spec: 
  replicas: #{replica}#
  selector: 
    matchLabels: 
      app: #{component}#
  template: 
    metadata: 
      labels: 
        app: #{component}#
    spec: 
      containers: 
        - 
          env: 
            - 
              name: AUTHOR
              value: #{author}#
          image: #{acr}#/#{component}#:#{stage}#-#{Build.BuildId}#
          imagePullPolicy: Always
          name: #{component}#
          ports: 
            - 
              containerPort: 8000
          resources: 
            limits: 
              cpu: "1"
              memory: 512Mi
            requests: 
              cpu: "0.25"
              memory: 256Mi
      imagePullSecrets: 
        - 
          name: "acrakssecret"

Services.yml

--- 
apiVersion: v1
kind: Service
metadata: 
  name: #{component}#
spec: 
  ports: 
    - 
      name: #{component}#
      port: 443
      protocol: TCP
      targetPort: 8000
  selector: 
      app: #{component}#
  type: LoadBalancer

Client Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.0", GitCommit:"cb303e613a121a29364f75cc67d3d580833a7479", GitTreeState:"clean", BuildDate:"2021-04-08T16:31:21Z", GoVersion:"go1.16.1", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"20", GitVersion:"v1.20.5", GitCommit:"54684493f8139456e5d2f963b23cb5003c4d8055", GitTreeState:"clean", BuildDate:"2021-03-22T23:02:59Z", GoVersion:"go1.15.8", Compiler:"gc", Platform:"linux/amd64"}

通过 kubectl 控制台部署时,“Services.yml”应用成功。任何帮助表示赞赏?

【问题讨论】:

  • 嗨@Parth,您是否使用 Azure Pipelines 进行部署。如果是这样,为了让我们进一步调查此问题,请在 Azure DevOps 上共享您的管道的完整 YAML 文件,并共享失败管道运行的完整调试日志。

标签: kubernetes azure-devops azure-aks


【解决方案1】:

作为对我的支持票的回应,MSFT 提供了this article,只需在 kubectl 任务的高级部分中勾选“检查最新版本”即可解决问题。

希望这对其他人有所帮助:)

【讨论】:

    猜你喜欢
    • 2019-11-14
    • 2020-01-29
    • 2018-01-09
    • 1970-01-01
    • 2017-06-23
    • 2020-01-24
    • 1970-01-01
    • 2022-12-10
    • 2015-10-19
    相关资源
    最近更新 更多