spring - Spring Cloud Pipelines 中编译后协调不生效

标签 spring kubernetes spring-cloud google-kubernetes-engine

我正在关注这个tutorial当此 repo 时,我在“部署到测试”阶段面临构建失败已编译。失败的原因是sc-pipelines.yml定义eureka服务coordinate: scpipelines/github-eureka:latest ,它没有被编译成等效的 target\k8s\eureka.yml 。编译后的 yml 有 image: :对于容器镜像。有人可以帮助我如何获取此图像值填充 scpipelines/github-eureka:latest

12:39:25 Logging in to Kubernetes API [kubernetes.default:443], with cluster name [gke_kubproject-210508_asia-south1-b_cluster-1] and user [default]
12:39:25 Cluster "gke_kubproject-210508_asia-south1-b_cluster-1" set.
12:39:25 User "default" set.

12:39:25 Context "gke_kubproject-210508_asia-south1-b_cluster-1" created.
12:39:25 Switched to context "gke_kubproject-210508_asia-south1-b_cluster-1".
12:39:25 CLI version
12:39:25 Client Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.2", GitCommit:"bb9ffb1654d4a729bb4cec18ff088eacc153c239", GitTreeState:"clean", BuildDate:"2018-08-07T23:17:28Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}
12:39:25 Server Version: version.Info{Major:"1", Minor:"9+", GitVersion:"v1.9.7-gke.5", GitCommit:"9b635efce81582e1da13b35a7aa539c0ccb32987", GitTreeState:"clean", BuildDate:"2018-08-02T23:42:40Z", GoVersion:"go1.9.3b4", Compiler:"gc", Platform:"linux/amd64"}
12:39:25 Pipeline descriptor already parsed - will not parse it again
12:39:25 Deleting all possible entries with name [rabbitmq-github-webhook]
12:39:26 Error from server (NotFound): secrets "rabbitmq-github-webhook" not found
12:39:26 Error from server (NotFound): persistentvolumeclaims "rabbitmq-github-webhook" not found
12:39:26 Error from server (NotFound): pods "rabbitmq-github-webhook" not found
12:39:26 Error from server (NotFound): deployments.extensions "rabbitmq-github-webhook" not found

12:39:26 service "rabbitmq-github-webhook" deleted
12:39:26 Will deploy service with type [rabbitmq] name [rabbitmq-github-webhook] and coordinates []
12:39:26 Waiting for RabbitMQ to start
12:39:26 replicationcontroller "rabbitmq-github-webhook" deleted
12:39:26 Error from server (NotFound): error when deleting "target/k8s/rabbitmq-service.yml": services "rabbitmq-github-webhook" not found
12:39:26 Failed to delete app by [target/k8s/rabbitmq-service.yml] file. Continuing with the script
12:39:27 replicationcontroller/rabbitmq-github-webhook replaced
12:39:27 service/rabbitmq-github-webhook replaced
12:39:27 Deleting all possible entries with name [mysql-github-webhook]

12:39:27 secret "mysql-github-webhook" deleted
12:39:27 Error from server (NotFound): persistentvolumeclaims "mysql-github-webhook" not found
12:39:27 pod "mysql-github-webhook" deleted

12:39:44 Error from server (NotFound): deployments.extensions "mysql-github-webhook" not found

12:39:44 service "mysql-github-webhook" deleted
12:39:44 Will deploy service with type [mysql] name [mysql-github-webhook] and coordinates []
12:39:44 Waiting for MySQL to start
12:39:44 Generating secret with name [mysql-github-webhook]
12:39:45 Error from server (NotFound): secrets "mysql-github-webhook" not found
12:39:45 Failed to delete secret [mysql-github-webhook]. Continuing with the script
12:39:45 secret/mysql-github-webhook created
12:39:45 Error from server (NotFound): error when deleting "target/k8s/mysql.yml": pods "mysql-github-webhook" not found
12:39:45 Failed to delete app by [target/k8s/mysql.yml] file. Continuing with the script
12:39:45 Error from server (NotFound): error when deleting "target/k8s/mysql-service.yml": services "mysql-github-webhook" not found
12:39:45 Failed to delete app by [target/k8s/mysql-service.yml] file. Continuing with the script

12:39:45 pod/mysql-github-webhook replaced
12:39:46 service/mysql-github-webhook replaced
12:39:46 Deleting all possible entries with name [eureka-github-webhook]
12:39:46 Error from server (NotFound): secrets "eureka-github-webhook" not found
12:39:46 Error from server (NotFound): persistentvolumeclaims "eureka-github-webhook" not found

12:39:46 Error from server (NotFound): pods "eureka-github-webhook" not found
12:39:47 Error from server (NotFound): deployments.extensions "eureka-github-webhook" not found
12:39:47 Error from server (NotFound): services "eureka-github-webhook" not found
12:39:47 Will deploy service with type [eureka] name [eureka-github-webhook] and coordinates []
12:39:47 Deploying Eureka. Options - image name [:], app name [eureka-github-webhook], env [TEST]
12:39:47 error: error parsing target/k8s/eureka.yml: error converting YAML to JSON: yaml: line 13: mapping values are not allowed in this context
12:39:47 Failed to delete app by [target/k8s/eureka.yml] file. Continuing with the script
12:39:47 Error from server (NotFound): error when deleting "target/k8s/eureka-service.yml": services "eureka-github-webhook" not found
12:39:47 Failed to delete app by [target/k8s/eureka-service.yml] file. Continuing with the script

12:39:47 error: error parsing target/k8s/eureka.yml: error converting YAML to JSON: yaml: line 13: mapping values are not allowed in this context
12:39:47 Build step 'Execute shell' marked build as failure
12:39:47 Archiving artifacts
12:39:48 Finished: FAILURE

sc-pipelines.yml

test:
  # list of required services
  services:
    - type: rabbitmq
      name: rabbitmq-github-webhook
    - type: mysql
      name: mysql-github-webhook
      database: example
    - type: eureka
      name: eureka-github-webhook
      coordinates: scpipelines/github-eureka:latest

eureka.yml - 请注意 image 的空值关键。

1 apiVersion: extensions/v1beta1
 2 kind: Deployment
 3 metadata:
 4   name: eureka-github-webhook
 5 spec:
 6   replicas: 1 # tells deployment to run 2 pods matching the template
 7   template: # create pods using pod definition in this template
 8       metadata:
 9         labels:
10           name: eureka-github-webhook
11       spec:
12         containers:
13         - name: eureka-github-webhook
14           image: :
15           ports:
16           - containerPort: 8761
17           env:
18           - name: PORT
19             value: "8761"
20           - name: eureka_client_serviceUrl_defaultZone
21             value: "http://eureka-github-webhook.sc-pipelines-prod:8761/eureka/"
22           livenessProbe:

最佳答案

这是一个错误 https://github.com/spring-cloud/spring-cloud-pipelines/issues/187 。请使用 master 分支的最新提交重试

关于spring - Spring Cloud Pipelines 中编译后协调不生效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51946775/

相关文章:

Kubernetes:2个命名空间中的2个PVC绑定(bind)到同一个PV,一个成功,一个失败

spring-boot - 如何更新多个spring config实例客户端

java - Spring security hasRole() 给出错误 403 - 访问被拒绝

spring - 我可以结合使用 Spring @RequestMapping 和 BeanNameUrlHandlerMapping 将 URL 映射到方法吗?

Spring 矩阵变量至少需要一个模板变量才能工作?

python - 使用 Azure AKS 群集的 Kubernetes Python 客户端填充 Pod CPU 限制

postgresql - 使用 kubectl apply 命令重新配置 postgres

spring-boot - Grails 2.4作为Spring Cloud微服务的应用

java - Spring Cloud Config Server - 连接 github 的用户名和密码

spring - Spring 启动:发布Thymeleaf模板而无需重新启动服务器