How to set up kubernetes on travis YML file

2/10/2017

I have a repository that serves as a driver for kubernetes and docker, built using nodejs.

I have created several test cases for this repo to work on docker and kubernetes, and they all passed locally.

The only thing I don't know how to do is to set up kubernetes on the travis YML. Surprisingly, I can't find any decent examples anywhere. Below is the YML file I have, and between <> is the gap I need help to fill.

sudo: required

language: node_js

node_js: 6.9.5

services:
  - docker
  - <kubernetes>

branches:
  only:
    - staging
    - master

addons:
  hosts:
    - localhost
    - dev-controller

before_script:
  - npm install -g grunt-cli
  - docker pull soajsorg/soajs
  - <pull the soajsorg/soajs image and load it to kubernetes>

script:
  - grunt coverage
-- nicolas
kubernetes
node.js
travis-ci
unit-testing

1 Answer

2/10/2017

You could try to install minikube: http://github.com/kubernetes/minikube if you need it running on TravisCI otherwise I would suggest connecting to a self-managed Kubernetes cluster or using Google's cli/sdk to launch a small GKE cluster and use that for testing

-- feelobot
Source: StackOverflow