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.

  • Pull image from another Docker Machine
  • No space left on device when pulling an image
  • RStudio Server in a Docker Container on GCE Fails
  • Cannot exec into docker container due to application
  • Docker Client server different. And there is no boot2docker
  • Postgres to Ubuntu Docker container linking not working
  • 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?

  • Docker: Use sockets for communication between 2 containers
  • Not able to connect to the Docker server running on another Linux system
  • How to specify IP of docker container in Marathon?
  • Named Docker volume to share build not updating
  • set docker container env from daemon configuration file
  • Docker - COPY/ADD files remove the trailing line
  • 3 Solutions collect form web for “Can Kubernetes be used like Docker Compose?”

    If you still looking, maybe this can help

    using this tool

    https://github.com/kelseyhightower/compose2kube

    You can create compose file

    web:
      image: nginx
      ports:
        - "80"
        - "443"
    database:
      image: postgres
      ports:
        - "5432"
    cache:
      image: memcached
      ports:
        - "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

    output/cache-rc.yaml
    output/database-rc.yaml
    output/web-rc.yaml
    

    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 https://github.com/kubernetes-incubator/kompose.

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