Skip to content

javajon/cdc-with-k8s

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Consumer-driven Contracts with Kubernetes

Learn how to use the Pact Foundation's framework for CDC testing

This project contains the source code for demonstrating consumer-driven contact testing using Pact. The application aggregates population and COVID-19 datasources and presents data at an API gateway. The entire application and Pact testing runs on Kubernetes. Here is a networking representation of the Pod relationships.

Demonstration application architecture

There are 6 directories for the following purposes:

Directory Name Purpose
aggregator Public API gateway, aggregates data from world-pop and covid-19 microservices. This is the API you will test with Pact.
cluster A collection of Kubernetes YAML-based manifests that define how each microservice, Pod, Deployment, and Service will run on your Kubernetes cluster.
covid-19 A microservice that serves the COVID-19 data, updated daily, for each country on our blue marble.
h2-seeder A small container that runs as an initContainer that seeds the H2 database Pod when it starts. The data is the human population for all the countries and major cities on our blue marble.
pact Here is one consumer. The Node.js code is independent of the Kubernetes cluster and by running a Pact test it creates a Pact contract
world-pop A microservice that serves the world population data in the H2 database.

In summary, the aggregator serves data combining the daily COVID-19 metrics with the world population.

For a complete tutorial on how this all works follow this interactive O'Reilly Media lab: Consumer-driven Contracts with Kubernetes

About

A complete tutorial on how to use the code can be found in my Katacoda scenario here: https://katacoda.com/javajon/courses/kubernetes-pipelines/cdc-with-k8s

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •