#Docker#Kubernetes#DevOps#cloud-infrastructure#containers

Docker Kanvas: Bridging the Gap Between Compose and Kubernetes

webhani·

What is Docker Kanvas

Docker has launched Kanvas, a platform that automatically converts Docker Compose definitions into Kubernetes manifests. It targets the common friction point where local development runs on Compose and production runs on Kubernetes — two different formats, two separate maintenance paths.

Kanvas positions itself against Helm and Kustomize, though it's more accurately described as a migration and consistency bridge rather than a direct replacement for either.

How the Conversion Works

Kanvas reads your docker-compose.yml and maps its constructs to Kubernetes equivalents: services become Deployments, ports become Services, volumes become PersistentVolumeClaims.

# Input: docker-compose.yml
version: "3.9"
services:
  web:
    image: my-app:latest
    ports:
      - "3000:3000"
    environment:
      - DATABASE_URL=postgres://db:5432/mydb
    depends_on:
      - db
 
  db:
    image: postgres:16
    volumes:
      - pg_data:/var/lib/postgresql/data
    environment:
      - POSTGRES_DB=mydb
      - POSTGRES_PASSWORD=secret
 
volumes:
  pg_data:

The output is a set of Kubernetes manifests:

# Generated Kubernetes Deployment (web)
apiVersion: apps/v1
kind: Deployment
metadata:
  name: web
spec:
  replicas: 1
  selector:
    matchLabels:
      app: web
  template:
    metadata:
      labels:
        app: web
    spec:
      containers:
        - name: web
          image: my-app:latest
          ports:
            - containerPort: 3000
          env:
            - name: DATABASE_URL
              value: "postgres://db:5432/mydb"
---
apiVersion: v1
kind: Service
metadata:
  name: web
spec:
  ports:
    - port: 3000
  selector:
    app: web

Kanvas vs Helm vs Kustomize

These tools have different purposes and the comparison is often misframed:

ToolPurposeBest for
HelmTemplate engine with values substitutionComplex multi-environment configurations and distribution
KustomizePatch-based overlay systemPer-environment base+overlay management
KanvasCompose-to-Kubernetes auto-conversionMigrating Compose-based projects to Kubernetes

Kanvas doesn't replace Helm or Kustomize — it's a starting point. A reasonable workflow is: use Kanvas to generate the base manifests, then manage environment-specific differences with Kustomize overlays.

Where Kanvas Works Well

  • First Kubernetes migration — teams moving from Compose-based local development to a Kubernetes cluster for the first time
  • Developer onboarding — the side-by-side view of Compose vs. generated manifests is a useful teaching tool for understanding Kubernetes concepts
  • Rapid prototyping — spinning up Kubernetes resources for a proof-of-concept without writing manifests from scratch

Where Kanvas Falls Short

The auto-generated manifests are a starting point, not a production-ready output. You'll need to add:

  • Resource requests and limits — not generated by default, required for Kubernetes scheduling
  • Ingress configuration — Compose ports maps to a basic Service, not a routable Ingress
  • Security context — non-root users, read-only filesystems, privilege escalation settings
  • HPA / scaling policies — Compose has no scaling concept to convert from
  • Secret management — environment variables in Compose become plain ConfigMap values, not Secrets

depends_on has no direct Kubernetes equivalent and needs to be replaced:

# Replace depends_on with a readinessProbe
readinessProbe:
  exec:
    command:
      - pg_isready
      - -h
      - db
  initialDelaySeconds: 5
  periodSeconds: 5

Our Take

Kubernetes adoption friction is real — Helm charts and Kustomize configurations require a mental model that takes time to build. Kanvas lowers that barrier for teams already fluent in Compose.

The most practical use isn't "replace our Helm charts" but "give developers a starting point and a visual map of how Compose concepts translate to Kubernetes." From there, you add the production-specific configuration manually.

Don't deploy Kanvas output to production without review. The generated security context is typically permissive by default, and resource limits will need tuning for your specific workloads.

Takeaways

  • Kanvas automates Compose → Kubernetes conversion, reducing migration friction
  • Not a Helm/Kustomize replacement — best used as a migration starting point
  • Generated manifests need production hardening: resource limits, security contexts, Ingress, HPA
  • depends_on has no direct equivalent — replace with readinessProbe or initContainers
  • Useful for learning Kubernetes by seeing the Compose-to-manifest mapping side by side