sebgoa sebgoa on Products, kompose

kompose

kompose is a Kubernetes tool that meets Docker users where they are and ease their migration to Kubernetes.

kompose takes a Docker compose file that describes a containerized application and automatically generates the corresponding Kubernetes objects.

It is open source and available on GitHuB. Skippbox contributors together with engineers from Google and Red Hat are developing kompose.

We hope to donate it to the Cloud Native Computing Foundation in the next few months.

For instance, given a docker-voting.ml compose file:

version: "2"

services:  
  vote:
    build: ./vote
    command: python app.py
    labels:
     - "com.example.description=Vote"
    volumes:
     - ./vote:/app
    ports:
      - "5000:80"

  redis:
    image: redis:alpine
    ports: ["6379"]

  worker:
    build: ./worker

  db:
    image: postgres:9.4
    labels:
     - "com.example.description=Postgres Database"

  result:
    build: ./result
    command: nodemon --debug server.js
    volumes:
      - ./result:/app
    ports:
      - "5001:80"
      - "5858:5858"

kompose can convert it automatically into Kubernetes services and deployments objects.

$ kompose convert --file docker-voting.yml
WARN[0000]: Unsupported key networks - ignoring  
WARN[0000]: Unsupported key build - ignoring  
file "worker-svc.json" created  
file "db-svc.json" created  
file "redis-svc.json" created  
file "result-svc.json" created  
file "vote-svc.json" created  
file "redis-deployment.json" created  
file "result-deployment.json" created  
file "vote-deployment.json" created  
file "worker-deployment.json" created  
file "db-deployment.json" created