Back to Kompose

Conversion

docs/conversion.md

1.38.022.3 KB
Original Source

Conversion Matrix

  • TOC {:toc}

This document outlines all possible conversion details regarding compose.yaml values to Kubernetes / OpenShift artifacts.

Version Support

Under the hood, we're using compose-go, the reference library for parsing Compose files. We should be able to load all versions of Compose files. We're doing our best to keep it up to date as soon as possible in our releases to be compatible with the latest features defined in the Compose specification. If you absolutely need a feature we don't support yet, please open a PR!

Conversion Table

Glossary:

  • ✓: Converts
  • -: Not in this Compose Version
  • n: Not yet implemented
  • x: Not applicable / no 1-1 conversion
KeysV1V2V3Kubernetes / OpenShiftNotes
buildBuilds/Pushes to Docker repository. See user guide on build and push image
build: context
build: dockerfile
build: argsnnn
build: cache_from--n
cap_addContainer.SecurityContext.Capabilities.Add
cap_dropContainer.SecurityContext.Capabilities.Drop
commandContainer.Args
configsnn
configs: short-syntaxnnOnly create configMap
configs: long-syntaxnnIf target path is /, ignore this and only create configMap
cgroup_parentxxxNot supported within Kubernetes. See issue https://github.com/kubernetes/kubernetes/issues/11986
container_nameMetadata.Name + Deployment.Spec.Containers.Name
credential_specxxxOnly applicable to Windows containers
deploy--
deploy: mode--
deploy: replicas--Deployment.Spec.Replicas / DeploymentConfig.Spec.Replicas
deploy: placement--Affinity
deploy: update_config--Workload.Spec.StrategyDeployment / DeploymentConfig
deploy: resources--Containers.Resources.Limits.Memory / Containers.Resources.Limits.CPUSupport for memory as well as cpu
deploy: restart_policy--Pod generationThis generated a Pod, see the user guide on restart
deploy: labels--Workload.Metadata.LabelsOnly applied to workload resource
devicesxxxNot supported within Kubernetes, See issue https://github.com/kubernetes/kubernetes/issues/5607
depends_onxxx
dnsxxxNot used within Kubernetes. Kubernetes uses a managed DNS server
dns_searchxxxSee dns key
domainnameSubDomain
tmpfsContainers.Volumes.EmptyDirCreates emptyDirvolume with medium set to Memory & mounts given directory inside container
entrypointContainer.Command
env_filenn
environmentContainer.Env
exposeService.Spec.Ports
endpoint_modennIf endpoint_mode=vip, the created Service will be forced to set to NodePort type
extendsExtends by utilizing the same image supplied
external_linksxxxKubernetes uses a flat-structure for all containers and thus external_links does not have a 1-1 conversion
extra_hostsnnn
group_add
healthcheck-n
hostnameHostName
imageDeployment.Spec.Containers.Image
isolationxxxNot applicable as this applies to Windows with HyperV support
labelsMetadata.Annotations
linksxxxAll containers in the same pod are accessible in Kubernetes
loggingxxxKubernetes has built-in logging support at the node-level
network_modexxxKubernetes uses its own cluster networking
networksSee networks key
networks: aliasesxxxSee networks key
networks: addressesxxxSee networks key
pidHostPID
portsService.Spec.Ports
ports: short-syntaxService.Spec.Ports
ports: long-syntax--Service.Spec.Ports
secrets--SecretExternal Secret is not Supported
secrets: short-syntax--SecretExternal Secret is not Supported
secrets: long-syntax--SecretExternal Secret is not Supported
security_optxxxKubernetes uses its own container naming scheme
stop_grace_periodTerminationGracePeriodSeconds
stop_signalxxxNot supported within Kubernetes. See issue https://github.com/kubernetes/kubernetes/issues/30051
sysctlsnnn
ulimitsxxxNot supported within Kubernetes. See issue https://github.com/kubernetes/kubernetes/issues/3595
userns_modexxxNot supported within Kubernetes and ignored in Compose Version 3
volumesPersistentVolumeClaimCreates a PersistentVolumeClaim. Can only be created if there is already a PersistentVolume within the cluster
volumes: short-syntaxPersistentVolumeClaimCreates a PersistentVolumeClaim. Can only be created if there is already a PersistentVolume within the cluster
volumes: long-syntax--PersistentVolumeClaimCreates a PersistentVolumeClaim. Can only be created if there is already a PersistentVolume within the cluster
restart
Volumexxx
driverxxx
driver_optsxxx
externalxxx
labelsxxx
Networkxxx
driverxxx
driver_optsxxx
enable_ipv6xxx
ipamxxx
internalxxx
labelsxxx
externalxxx
Configsxxx
environmentx
file
contentx
labelsxxx
externalxxx