我如何在 Kubernetes 中使用 postgres 运行 Pact Broker?

How can I run Pact Broker with postgres in Kubernetes?

我将其作为示例微服务消费者和提供者

https://github.com/anha1/microservices-pact-maven

包裹经纪人Docker

https://github.com/DiUS/pact_broker-docker

如何在 Kubernetes 中使用 postgres 部署和运行pact_broker?

我们可以在Kubernetes中部署PactBroker,

  1. 我们需要 Docker postgres 镜像,部署在 kubernetes 中
    • 用于 postgres 的 Kubernetes svc yaml 文件,必须提及 "type : ClusterIP" 和 "targetPort: 5432" 规范
  2. 我们需要 Docker PactBroker 镜像,部署在 kubernetes 中
    • pactbroker 的 Kubernetes svc yaml 文件,必须在规范
    • 中提及 "type : NodePort" & "targetPort: 80"

Sample image - Pact app running in Kubernetes