This is an example showing how to run Kubernetes 1.11+ on Travis-CI using Kubernetes in Docker (
KinD). For more details check the lightning talk I held on KubeCon North America 2018: 'Spawning Kubernetes in CI For Integration Tests'
and the follow up article on Loodse blog.
The Travis-CI manifest (
.travis.yml) shows how to build a job for running integration tests, which first runs a local Kubernetes cluster using KinD (as defined in the
before_script stage) and then runs integration tests (as defined in the
When running Integration and End-to-End tests, we usually want to build an image for application we test locally. When creating a cluster, KinD runs a Docker container on the host machine (in our case on Travis-CI) which contains dependencies needed for Kubernetes, including Docker, and then runs Kubernetes in that container. For Kubernetes to be able to use images built locally, we need to sideload the image from the host machine to Docker running in the KinD's container, which can be done using the
If you want to learn more about KinD, check out the following resources: