Kompose Compose to Kubernetes
Light · Postcard
102 × 152 mm · PDF
Dark · Postcard
102 × 152 mm · PDF
Ink saver · Postcard
102 × 152 mm · PDF
Light · A4 landscape
297 × 210 mm · PDF
Dark · A4 landscape
297 × 210 mm · PDF
Ink saver · A4 landscape
297 × 210 mm · PDF
Light · A3 landscape
420 × 297 mm · PDF
Dark · A3 landscape
420 × 297 mm · PDF
Ink saver · A3 landscape
420 × 297 mm · PDF
Start here
kompose convertkompose convert -f <file>
kompose convert -o <dir>
kompose convert --stdout
kompose convert -n <ns>
kompose convert --controller statefulset
kubectl apply -f <dir>
kompose convert --help
Concepts
- Compose services
- Manifests Deployment, Service, PVC
- Cluster running pods
Convert
kompose convertkompose convert -f <file>
kompose -f <a> -f <b> convert
kompose convert -o <path>
kompose convert --stdout
kompose convert --json
kompose convert -n <namespace>
kompose convert --provider openshift
kompose convert --profile <name>
kompose convert --indent <n>
kompose convert --no-interpolate
kompose convert --with-kompose-annotation=false
Workloads
kompose convert --controller deployment
kompose convert --controller daemonSet
kompose convert --controller replicationController
kompose convert --replicas <n>
kompose convert --service-group-mode label
kompose convert --generate-network-policies
| restart | Object | Pod restartPolicy |
|---|---|---|
unset / always |
controller | Always |
unless-stopped |
controller | Always |
on-failure |
Pod or CronJob | OnFailure |
no |
Pod or CronJob | Never |
Volumes & Secrets
kompose convert --volumes persistentVolumeClaim
kompose convert --volumes emptyDir
kompose convert --volumes hostPath
kompose convert --volumes configMap
kompose convert --pvc-request-size <size>
kompose convert --secrets-as-files
Images
kompose convert --build local
kompose convert --build local --push-image
kompose convert --push-image-registry
<registry>
kompose convert --build-command '<cmd>'
kompose convert --push-command '<cmd>'
Helm
kompose convert -c
kompose convert -c -o <dir>
helm install <name> <chart-dir>
Labels
| Label | Effect |
|---|---|
service.type |
nodeport, clusterip, loadbalancer, headless |
service.expose |
Make an Ingress (true or host) |
service.nodeport.port |
Fixed NodePort |
controller.type |
deployment, daemonset, ... |
volume.type |
PVC, emptyDir, hostPath, configMap |
volume.size |
PVC size, e.g. 1Gi |
image-pull-policy |
Always, IfNotPresent, Never |
service.group |
Share one pod |
| Label | Effect |
|---|---|
hpa.replicas.min/max |
Autoscaler bounds |
hpa.cpu |
CPU target, e.g. 50% |
cronjob.schedule |
Run as CronJob |
service.expose.tls-secret |
Ingress TLS secret |
image-pull-secret |
Registry secret |
Recipes
kompose convert -o k8s/kubectl apply -f k8s/kubectl get pods
kompose convert --stdout --controller statefulset \ -f compose.yaml | less
services: web: image: nginx ports: ["80:80"] labels: kompose.service.type: loadbalancer
kompose convert -c -n shop -o chart/helm install shop chart/
Help
kompose --helpkompose versionkompose completion bash
kompose -v convert
kompose --suppress-warnings convert
kompose --error-on-warning convert



