drone+k8s持续集成部署时报错 Error from server (NotFound): deployments.extensions "test" not found

server notfound一般是部署时在k8s中找不到test这个服务,此时需要去你的k8s中建这个服务,重新来过一次就好了。
我们使用rancher作为k8s的管理界面,因此我直接到rancher中去添加test服务,创建完后再次deploy就好了。

deploy:
    image: *****
    when:
      event: [ push ]
    secrets:
      - source: K8S_TOKEN
        target: K8S_TOKEN
    environment:
      - K8S_SERVER=******
      - K8S_NAMESPACE=***
      - K8S_USER=***
      - K8S_CLUSTER_NAME=***
      - REPO=*****
      - TAG=latest
      - CONTAINER=AAAAA
      - DEPLOYMENTS=AAAAA
      - DEBUG=true

AAAAA需要和k8s中的服务名对应,若不一致是一样会报错。

你可能感兴趣的:(drone+k8s持续集成部署时报错 Error from server (NotFound): deployments.extensions "test" not found)