Kompose

Updated: 24 February 2025

Example with Minikube

Convert docker compose config to Kubernetes cofig and apply it to Kubernetes

#!/bin/bash

cd  /path/to/docker-compose-project/

# make a dir for kompose output yaml files
rm -rf kompose-output
mkdir kompose-output
cd kompose-output

# convert docker compose file to kubernetes files
kompose --file ../docker-compose.yml convert

# apply to minikube all the config files
# this actually runs the containers in kubernetes
minikube kubectl -- apply -f '*.yaml'

Check that deployments are running

minikube kubectl -- get deployments

Get the name of the service with type LoadBalancer

minikube kubectl -- get services

On cloud providers supporting load balancers, an external IP address would be provisioned to access the Service. On minikube, the LoadBalancer type makes the Service accessible through the minikube service command.

Opens a browser window that serves the app

minikube service name-of-loadbalancer-service

Leave a comment