LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

kompose

converts Docker Compose files to Kubernetes resources

TLDR

Convert to Kubernetes
$ kompose convert
copy
Convert specific file
$ kompose convert -f [docker-compose.yml]
copy
Convert to Helm chart
$ kompose convert -c
copy
Convert with specific controller type
$ kompose convert --controller [daemonSet]
copy
Output as JSON to stdout
$ kompose convert --json --stdout
copy
Convert with replicas
$ kompose convert --replicas [3]
copy
Apply directly to cluster
$ kompose up
copy

SYNOPSIS

kompose command [options]

DESCRIPTION

kompose is a conversion tool that translates Docker Compose files into Kubernetes resource manifests. It parses `docker-compose.yml` definitions and generates corresponding Deployments, Services, PersistentVolumeClaims, and other Kubernetes objects, providing a migration path for applications originally designed to run with Docker Compose.The tool supports multiple output formats including standard Kubernetes YAML, JSON, and Helm charts. It can also deploy converted resources directly to a cluster with `kompose up` or tear them down with `kompose down`. As a CNCF sandbox project, kompose handles common Compose directives such as port mappings, volumes, environment variables, and replica counts, though some Compose-specific features may require manual adjustment after conversion.

PARAMETERS

convert

Convert compose to Kubernetes.
up
Deploy to Kubernetes.
down
Remove from Kubernetes.
-f FILE
Compose file to convert.
-c, --chart
Output Helm chart.
-o DIR
Output directory.
--replicas N
Set replica count (default 1).
--controller TYPE
Set output controller type (deployment, daemonSet, replicationController).
--volumes TYPE
Volume generation type (persistentVolumeClaim, emptyDir, hostPath, configMap). Default persistentVolumeClaim.
--json
Generate resource files in JSON format.
--stdout
Print converted objects to stdout.
--provider PROVIDER
Target provider (kubernetes, openshift). Default kubernetes.
--help
Display help information.

CAVEATS

Not all Compose features translate. May need manual adjustment. CNCF project.

HISTORY

kompose was created to help users migrate from Docker Compose to Kubernetes, becoming a CNCF sandbox project.

SEE ALSO

Copied to clipboard
Kai