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.

  • Docker Login for AWS ECR failing with “Cannot connect to the Docker deamon…”
  • Docker run connection timeout
  • docker aufs huge diff folder
  • Using ssh-agent with docker
  • how to solve error in docker-compose?
  • Docker: how to manage development and production settings?
  • 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?

  • List used images from Docker Compose
  • Why are my AWS CodeBuild commands not running?
  • docker restart,exit command, reboot the host machine
  • What's the main advantage of using replicas in Docker Swarm Mode?
  • Crash during startup with network share for gitlab container
  • Update Docker image and container from Jenkins
  • 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.