Can Kubernetes be used like Docker Compose?

I have been digging through the Kubernetes documentation for hours. I understand the core design, and the notion of services, controllers, pods, etc.

What I don’t understand, however, is the process in which I can declaratively configure the cluster. That is, a way for me to write a config file (or a set thereof) to define the makeup, and scaling options of the cloud deployment. I want to be able to declare which containers I want in which pods, how they will communicate, how they will scale, etc. without running a ton of cli commands.

  • Getting LifeCiycleException using Docker Maven Plugin on Ubuntu 14
  • Can I pass environment variables to a Docker container using Cockpit?
  • Install Docker in Ubuntu 14.04
  • Kubernetes Redis HA and exposing redis to things outside of the container
  • hyperkube gets stuck while trying to start the API server
  • How to list images and their containers
  • Is there docker-compose functionality for Kubernetes?

    I want my application to be defined in git—to be version controlled–without relying on manual cli interactions.

    Is this possible to do in a concise way? Is there a reference that is more clear than the official documentation?

  • How can I have nginx in one container and php-fpm in another?
  • How to do SSH tunneling with docker (machine & compose)?
  • How to build a docker image within jenkins
  • Docker MariaDb - remote access
  • Rancher CLI random host port mapping
  • Docker exec. Container is not running. Dockerize rails
  • 3 Solutions collect form web for “Can Kubernetes be used like Docker Compose?”

    If you still looking, maybe this can help

    using this tool

    You can create compose file

      image: nginx
        - "80"
        - "443"
      image: postgres
        - "5432"
      image: memcached
        - "11211"

    Then use the tool to convert it to kubernetes objetcs

    compose2kube -compose-file docker-compose.yml -output-dir output

    Which will create those files


    then you can use kubectl to apply them to kubernetes

    Kubernetes certainly has its own yaml (as shown in “Deploying Applications”)

    But as “Docker Clustering Tools Compared: Kubernetes vs Docker Swarm”, it was not written (just) for Docker, and it has its own system.

    You could use docker-compose to start Kubernetes though, as shown in “vyshane/kid“: that does mask some of the kubectl commands cli in scripts (which can be versioned).

    If you have existing docker composer files, you may take a look at the Kompose project

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.