Kompose: Move a Docker Compose File to Kubernetes (K3s) (Linux, Windows, Mac)
Before you start
- 28 min read
Boxes marked Run in terminal are what you type; plain text explains why. Check what you need first

What you get in one minute#
Kompose is a free, open-source command line tool that reads a Docker Compose file and writes Kubernetes YAML files for it (Deployments, Services, volume claims and an optional Ingress), so you do not start from a blank page when you move a homelab app from Docker to Kubernetes.

Logo: the official Kompose project (github.com/kubernetes/kompose, file docs/assets/images/logo.png at commit f90c0f5, the commit of release v1.39.0)
Kompose gives a first draft; its README says the result "may not be exact". We take one small Compose file (a feed reader plus Postgres, dummy passwords), convert it, fix what Kompose misses, and apply it to K3s, a small Kubernetes for one machine. Kompose only writes files and never talks to your cluster.
| What | Value (official sources, read 5 December 2026) |
|---|---|
| Current version | Kompose v1.39.0, released 24 November 2026 (previous: v1.38.0, 15 January 2026) |
| Licence | Apache-2.0 (GitHub repository and package listings) |
| Time needed | About 45 minutes (our estimate) |
| Ports | None. Kompose opens nothing |
| Official docs | kompose.io and the docs folder |
At a glance:
- It converts: services, ports, environment variables, named volumes, labels.
- It misses: passwords, volume sizes, the database Service, TLS, start order.
- Tested: the whole flow, once, on Windows with a throwaway K3s in Docker Desktop. Linux and Mac were not run.
- How alive: the README promises a release every three weeks; in 2026 we saw two, and a stale bot closes many old issues unfixed. Do not expect fast bug fixes.
How it fits together#
You write a Compose file, kompose convert turns it into a folder of Kubernetes files, you fix the gaps by hand, and kubectl apply sends the files to K3s, where Traefik (built into K3s) receives web requests and the app talks to the database through a Service.
Drawn for this guide from the official docs and our own test. The dashed step is manual: Kompose never does it.
Words you will meet: a Deployment keeps a container running; a Service gives it a stable name and port; a PVC is a request for disk space; an Ingress sends a host name to a Service; a Secret holds passwords. New to Kubernetes? Read our introduction to container orchestration first. For a web screen on K3s see our Rancher guide.
Before you start#
Note: every password, domain and name on this page is a dummy example (
change-me,rss.example.com). Replace them with your own and keep real secrets out of Git.
| System | What to have |
|---|---|
| Linux | A 64-bit machine with 2 CPU cores and 2 GB RAM or more (K3s server minimum, K3s docs) |
| Windows | Windows 10 or later, PowerShell, Docker Desktop (only for a throwaway K3s) |
| Mac | Docker Desktop (only for a throwaway K3s), Intel or Apple Silicon |
Checklist:
- [ ] You know Compose basics (see our Docker Compose guide)
- [ ] Ports 80 and 443 are free on the K3s machine
- [ ] A scratch folder, not your real project
Tested by DIY Lab Hub on 2026-12-05: Windows (PowerShell) with Kompose 1.39.0, kubectl 1.36 and K3s v1.36.6+k3s1 inside Docker Desktop. Linux, Mac and a native K3s node: not run. "Real output" below comes from that Windows run; on Linux and Mac paths use /, not \.
Tip: Never practise on your only copy of a project. Convert in a new folder: Kompose writes next to your files and can overwrite same-named YAML.
LLM Guide: let your AI assistant set it up#
Prefer to let an AI do the typing? Copy the block below into ChatGPT, Claude, Gemini or a local model. It first asks about your setup (system, cluster, HTTPS), then follows only the path that fits you. It uses the same pinned versions as this guide. You still read each command before you run it.
You are my assistant for moving a Docker Compose file to Kubernetes with Kompose 1.39.0 and applying it to K3s.
Follow the DIY Lab Hub guide https://diylabhub.com/kompose/ (checked 5 December 2026).
Work one step at a time. Before each command, say in one line what it does. Wait for my OK before anything that deletes data, deletes a namespace or cluster, changes a firewall or opens a port.
STEP 0 - FIND OUT MY SETUP. Ask me these questions (or have me run the read-only checks) before you do anything else:
1. Which machine do I work on: Linux (which distribution), Windows (PowerShell) or Mac (Terminal)?
2. Do I already have a Kubernetes cluster? If yes: which one, and does "kubectl get nodes" show it as Ready? If no: Linux can run K3s natively; Windows and Mac can only run a throwaway K3s inside Docker Desktop (docker --version).
3. Is kubectl installed? Check: kubectl version --client
4. Which Compose file do I want to convert? Practise first on the guide's example (Miniflux + Postgres); convert in a NEW empty folder, never in my only copy of a project.
5. How should the web page be reached: only by curl with a Host header (test), HTTPS with the Traefik that ships with K3s, or HTTPS with Caddy on another machine? For a public domain Let's Encrypt works; at home a local certificate is enough.
THEN FOLLOW THE MATCHING PATH:
- Install Kompose from the GitHub release binary, not apt, snap or a distro package (they are old). Linux: download kompose-linux-amd64 from https://github.com/kubernetes/kompose/releases/download/v1.39.0/ and check it with sha256sum against the checksum on the release page, chmod +x, move to /usr/local/bin (ARM64: kompose-linux-arm64). Windows: kompose-windows-amd64.exe into a folder on my PATH, compare Get-FileHash with the release page. Mac: brew install kompose kubectl. Check: kompose version (must print 1.39.0).
- Install kubectl 1.36.7 from dl.k8s.io (Linux/Windows) or Homebrew (Mac) if missing. It works with K3s 1.37.
- No cluster, Linux: curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION='v1.37.3+k3s1' sh - then copy /etc/rancher/k3s/k3s.yaml to ~/.kube/k3s-kompose.yaml, chown to me, chmod 600, and export KUBECONFIG=~/.kube/k3s-kompose.yaml. The kubeconfig is an admin key: never print it.
- No cluster, Windows or Mac: docker run -d --name k3s-test --privileged -p 127.0.0.1:16443:6443 -p 127.0.0.1:18080:80 rancher/k3s:v1.37.3-k3s1 server, wait 45 seconds, copy /etc/rancher/k3s/k3s.yaml out with docker exec, replace https://127.0.0.1:6443 with https://127.0.0.1:16443, and point KUBECONFIG at that file. This test cluster is removed with: docker rm -f k3s-test (ask me first, it deletes the database too).
- Existing cluster: use it, but ask me which namespace to use. Do not change anything outside the namespace "miniflux".
- HTTPS with Traefik (K3s has it): put these annotations on the Ingress by patching the generated file (not as Docker labels in the Compose file; Traefik ignores labels there): traefik.ingress.kubernetes.io/router.entrypoints: websecure and traefik.ingress.kubernetes.io/router.tls: "true". Traefik then answers with its own self-signed certificate (curl -k). A trusted certificate needs cert-manager or a Traefik resolver set in a K3s HelmChartConfig; the guide did not test either.
- HTTPS with Caddy: run Caddy on ANOTHER machine (K3s's Traefik already holds ports 80 and 443 on its node). In compose.yaml replace the kompose.service.expose label with kompose.service.type: nodeport and kompose.service.nodeport.port: 30080, convert again, and use a Caddyfile "rss.example.com { reverse_proxy <node-ip>:30080 }" (add "tls internal" for a local certificate and trust Caddy's root certificate). Allow port 30080 in the firewall only from the Caddy machine.
THE EXAMPLE (folder ~/kompose-demo, Windows: $HOME\kompose-demo). The final compose.yaml has NO passwords:
services:
app:
image: miniflux/miniflux:2.3.6
ports:
- "8080:8080"
depends_on:
- db
restart: unless-stopped
environment:
- RUN_MIGRATIONS=1
- CREATE_ADMIN=1
- ADMIN_USERNAME=admin
labels:
kompose.service.expose: "rss.example.com"
db:
image: postgres:17.12
restart: unless-stopped
expose:
- "5432"
environment:
- POSTGRES_USER=miniflux
- POSTGRES_DB=miniflux
volumes:
- db-data:/var/lib/postgresql/data
labels:
kompose.volume.size: 1Gi
volumes:
db-data:
Convert: mkdir k8s, then kompose convert --with-kompose-annotation=false -o k8s (the folder must exist first). Read every WARN line. Expect six files: app-service, db-service, app-deployment, app-ingress, db-deployment, db-data-persistentvolumeclaim.
The generated files hold no passwords. Make two Kubernetes Secrets from small env files that I create myself with my own values (app-secrets.env: ADMIN_PASSWORD and DATABASE_URL=postgres://miniflux:<my-db-password>@db/miniflux?sslmode=disable; db-secrets.env: POSTGRES_PASSWORD), chmod 600 them, then: kubectl create namespace miniflux; kubectl create secret generic app-secrets -n miniflux --from-env-file=app-secrets.env; the same for db-secrets. Add an envFrom/secretRef block (app-secrets, db-secrets) to the two Deployments with kubectl patch --local --patch-file ... -o yaml, as the guide shows.
Apply: kubectl apply -n miniflux -f k8s, then kubectl rollout status deployment/db -n miniflux --timeout=180s and the same for app.
CHECK IT WORKED: kubectl get pods,svc,pvc,ingress -n miniflux shows both pods Running (the app may show 1 restart because depends_on is not converted), services app and db, the claim db-data Bound with 1Gi, and an Ingress for rss.example.com. Then curl -s -H "Host: rss.example.com" http://127.0.0.1:18080/healthcheck prints OK (on a native K3s node use its address on port 80; on Windows use curl.exe).
RULES FOR YOU:
- Use only the versions above (Kompose 1.39.0, K3s v1.37.3+k3s1, miniflux 2.3.6, postgres 17.12). No :latest, no "kompose up" or "kompose down" (they do not exist in 1.39.0), no invented kompose labels. Never swap Postgres to another major version by changing the tag; a major upgrade needs a dump and restore.
- On an error show it to me and read https://github.com/kubernetes/kompose/tree/v1.39.0/docs before guessing. After every convert, read the WARN lines first.
- Passwords stay out of Git and out of the chat. Values like rss.example.com, change-me and <node-ip> are placeholders; ask me for mine. Never ask me to paste passwords, tokens or the kubeconfig into this chat.
- Do not expose the Kubernetes API (port 6443) or the database to the internet.
Step 1: Install Kompose and kubectl#
Use the release binary, not a distro package: Repology (5 December 2026) lists Alpine edge at 1.31.2, openSUSE Leap 15.6 at 1.30.0 and EPEL 7 at 1.7.0. The docs call the GitHub binary the recommended way. kubectl is the Kubernetes command line; keep it within one minor version of the cluster (1.36.7 fits 1.37).
Linux#
curl -L https://github.com/kubernetes/kompose/releases/download/v1.39.0/kompose-linux-amd64 -o kompose echo "9a233e1e654f9cfb9ab179acc7d8b3082d509f3a3d3f587e46b095c1d183e538 kompose" | sha256sum --check chmod +x kompose sudo mv kompose /usr/local/bin/kompose curl -LO https://dl.k8s.io/release/v1.36.7/bin/linux/amd64/kubectl curl -LO https://dl.k8s.io/release/v1.36.7/bin/linux/amd64/kubectl.sha256 echo "$(cat kubectl.sha256) kubectl" | sha256sum --check sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
On ARM64 use kompose-linux-arm64 and linux/arm64 (its checksum is on the release page). The long hash is the published SHA256 of the kompose-linux-amd64 file in the release.
Windows (PowerShell)#
$bin = "$HOME\bin"
New-Item -ItemType Directory -Force $bin | Out-Null
Invoke-WebRequest https://github.com/kubernetes/kompose/releases/download/v1.39.0/kompose-windows-amd64.exe -OutFile "$bin\kompose.exe"
Invoke-WebRequest https://dl.k8s.io/release/v1.36.7/bin/windows/amd64/kubectl.exe -OutFile "$bin\kubectl.exe"
(Get-FileHash "$bin\kompose.exe" -Algorithm SHA256).Hash
[Environment]::SetEnvironmentVariable("Path", [Environment]::GetEnvironmentVariable("Path","User") + ";$bin", "User")
$env:Path += ";$bin"
The printed hash must be 663ae6648256b0f58120ed5a2b810c6739a2b068e68d813b2a7fbc82341a7730 (any letter case), the value on the release page. Alternatively: winget install Kubernetes.kompose (the package lists 1.39.0).
Mac (Terminal)#
brew install kompose kubectl
Homebrew lists Kompose 1.39.0. Without Homebrew, download kompose-darwin-arm64 (Apple Silicon) or kompose-darwin-amd64 from the release, then chmod +x and move it to /usr/local/bin. We did not run the Mac steps.
Check it worked. Real output on Windows:
> kompose version 1.39.0 (f90c0f540)
kubectl version --client should print a v1.36 client. If kompose says "not found", open a new terminal so the new PATH is read.
Tip: Run
kompose versionbefore anything else. Old copies fromsnap,aptorgo installcause the strangest errors (see Common mistakes).
Step 2: Get a K3s cluster#
K3s is Kubernetes in one binary, with Traefik, DNS and local-path storage included (K3s docs). We pin v1.37.3+k3s1 (notes: no breaking change). K3s runs on Linux only.
Linux#
On the machine that will run the cluster:
curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION='v1.37.3+k3s1' sh - sudo k3s kubectl get nodes mkdir -p ~/.kube sudo cp /etc/rancher/k3s/k3s.yaml ~/.kube/k3s-kompose.yaml sudo chown "$USER" ~/.kube/k3s-kompose.yaml chmod 600 ~/.kube/k3s-kompose.yaml export KUBECONFIG=~/.kube/k3s-kompose.yaml
The kubeconfig is an admin key, so it gets its own chmod 600 file instead of replacing ~/.kube/config. Firewall rules are in Step 1 of our Rancher guide.
Windows (PowerShell)#
K3s needs Linux. Use a Linux machine (copy its kubeconfig as in Step 2 of the Rancher guide), or start a throwaway K3s inside Docker Desktop. This is what we tested:
docker run -d --name k3s-test --privileged -p 127.0.0.1:16443:6443 -p 127.0.0.1:18080:80 rancher/k3s:v1.37.3-k3s1 server
Start-Sleep -Seconds 45
docker exec k3s-test cat /etc/rancher/k3s/k3s.yaml | ForEach-Object { $_ -replace 'https://127.0.0.1:6443','https://127.0.0.1:16443' } | Set-Content -Encoding ascii "$HOME\k3s-test.yaml"
$env:KUBECONFIG = "$HOME\k3s-test.yaml"
Mac (Terminal)#
Use a Linux machine, or the throwaway K3s (not run on a Mac):
docker run -d --name k3s-test --privileged -p 127.0.0.1:16443:6443 -p 127.0.0.1:18080:80 rancher/k3s:v1.37.3-k3s1 server sleep 45 docker exec k3s-test cat /etc/rancher/k3s/k3s.yaml | sed 's#https://127.0.0.1:6443#https://127.0.0.1:16443#' > ~/k3s-test.yaml chmod 600 ~/k3s-test.yaml export KUBECONFIG=~/k3s-test.yaml
Check it worked. kubectl get nodes lists one node as Ready. Real output of our throwaway K3s (the node name is the container id and differs for you):
NAME STATUS ROLES AGE VERSION 4c6f49fbac90 Ready control-plane 37s v1.36.6+k3s1
After a minute kubectl get pods -A shows coredns, traefik and local-path-provisioner as Running. A helm-install-traefik pod may show Error once, then Completed; we saw this.
Tip:
docker rm -f k3s-testdeletes the throwaway cluster, database included.
Step 3: Write the Compose file and convert it#
We use Miniflux (a feed reader) with Postgres. Both images are pinned, and every password is a dummy value to replace. Keep Postgres 17.12 (Miniflux's example uses 18, another data folder).
Linux#
mkdir -p ~/kompose-demo
cd ~/kompose-demo
cat > compose.yaml << 'EOF'
services:
app:
image: miniflux/miniflux:2.3.6
ports:
- "8080:8080"
depends_on:
- db
restart: unless-stopped
environment:
- RUN_MIGRATIONS=1
- CREATE_ADMIN=1
- ADMIN_USERNAME=admin
- ADMIN_PASSWORD=change-me-too
- DATABASE_URL=postgres://miniflux:change-me@db/miniflux?sslmode=disable
db:
image: postgres:17.12
restart: unless-stopped
environment:
- POSTGRES_USER=miniflux
- POSTGRES_PASSWORD=change-me
- POSTGRES_DB=miniflux
volumes:
- db-data:/var/lib/postgresql/data
volumes:
db-data:
EOF
mkdir k8s-first
kompose convert --with-kompose-annotation=false -o k8s-first
Windows (PowerShell)#
New-Item -ItemType Directory -Force "$HOME\kompose-demo" | Out-Null
Set-Location "$HOME\kompose-demo"
@'
services:
app:
image: miniflux/miniflux:2.3.6
ports:
- "8080:8080"
depends_on:
- db
restart: unless-stopped
environment:
- RUN_MIGRATIONS=1
- CREATE_ADMIN=1
- ADMIN_USERNAME=admin
- ADMIN_PASSWORD=change-me-too
- DATABASE_URL=postgres://miniflux:change-me@db/miniflux?sslmode=disable
db:
image: postgres:17.12
restart: unless-stopped
environment:
- POSTGRES_USER=miniflux
- POSTGRES_PASSWORD=change-me
- POSTGRES_DB=miniflux
volumes:
- db-data:/var/lib/postgresql/data
volumes:
db-data:
'@ | Set-Content -Encoding ascii compose.yaml
New-Item -ItemType Directory k8s-first | Out-Null
kompose convert --with-kompose-annotation=false -o k8s-first
Mac (Terminal)#
Same commands as Linux.
Why these flags: -o k8s-first writes into that folder, which must exist first (if not, Kompose writes one single file with that name; we saw this). --with-kompose-annotation=false drops the kompose.cmd annotation, which otherwise stores the full path of the command you ran, user name included.
Check it worked. Real output (Windows; Kompose colours the words WARN and INFO):
WARN Restart policy 'unless-stopped' in service db is not supported, convert it to 'always' WARN Restart policy 'unless-stopped' in service app is not supported, convert it to 'always' WARN Service "db" won't be created because 'ports' is not specified WARN File don't exist or failed to check if the directory is empty: CreateFile :/var/lib/postgresql/data: The filename, directory name, or volume label syntax is incorrect. INFO Kubernetes file "k8s-first\\app-service.yaml" created INFO Kubernetes file "k8s-first\\app-deployment.yaml" created INFO Kubernetes file "k8s-first\\db-deployment.yaml" created INFO Kubernetes file "k8s-first\\db-data-persistentvolumeclaim.yaml" created
The fourth warning is a Windows path quirk and changed nothing. Read the third twice: there is no db Service.
Step 4: Read the YAML and fix what Kompose misses#
Open k8s-first. Kompose made four files. We read them and applied them to a spare namespace; here is what is wrong:
| What we saw (real) | Why it matters | The fix |
|---|---|---|
No db-service.yaml (warning Service "db" won't be created because 'ports' is not specified) | Nothing gives the name db an address. Our app pod went to Error, then CrashLoopBackOff: dial tcp: lookup db on 10.43.0.10:53: server misbehaving | Add expose: ["5432"] to db |
db-data asks for storage: 100Mi | Kompose's default is tiny | Label kompose.volume.size: 1Gi (or flag --pvc-request-size) |
value: change-me in env: | Passwords sit in plain text in a file you may commit | Secrets (Step 5) |
| No Ingress | No way in from a browser | Label kompose.service.expose |
depends_on vanished | Kubernetes has no start order | Accept a few restarts, or add a readiness probe |
unless-stopped became Always | Deployments always restart | Nothing |
The part that matters most, from the real app-deployment.yaml:
env:
- name: ADMIN_PASSWORD
value: change-me-too
- name: DATABASE_URL
value: postgres://miniflux:change-me@db/miniflux?sslmode=disable
The Secrets problem: Kompose copies every environment: value into the manifest as plain text. It also bakes in values read from ${VAR} and .env at convert time, and turns env_file into a ConfigMap (all three seen in our runs). A ConfigMap is no place for passwords.
Linux#
Rewrite the Compose file without the passwords, add the missing labels, and convert into a clean folder:
cd ~/kompose-demo
cat > compose.yaml << 'EOF'
services:
app:
image: miniflux/miniflux:2.3.6
ports:
- "8080:8080"
depends_on:
- db
restart: unless-stopped
environment:
- RUN_MIGRATIONS=1
- CREATE_ADMIN=1
- ADMIN_USERNAME=admin
labels:
kompose.service.expose: "rss.example.com"
db:
image: postgres:17.12
restart: unless-stopped
expose:
- "5432"
environment:
- POSTGRES_USER=miniflux
- POSTGRES_DB=miniflux
volumes:
- db-data:/var/lib/postgresql/data
labels:
kompose.volume.size: 1Gi
volumes:
db-data:
EOF
mkdir k8s
kompose convert --with-kompose-annotation=false -o k8s
Windows (PowerShell)#
Set-Location "$HOME\kompose-demo"
@'
services:
app:
image: miniflux/miniflux:2.3.6
ports:
- "8080:8080"
depends_on:
- db
restart: unless-stopped
environment:
- RUN_MIGRATIONS=1
- CREATE_ADMIN=1
- ADMIN_USERNAME=admin
labels:
kompose.service.expose: "rss.example.com"
db:
image: postgres:17.12
restart: unless-stopped
expose:
- "5432"
environment:
- POSTGRES_USER=miniflux
- POSTGRES_DB=miniflux
volumes:
- db-data:/var/lib/postgresql/data
labels:
kompose.volume.size: 1Gi
volumes:
db-data:
'@ | Set-Content -Encoding ascii compose.yaml
New-Item -ItemType Directory k8s | Out-Null
kompose convert --with-kompose-annotation=false -o k8s
Mac (Terminal)#
Same commands as Linux.
Check it worked. Real output:
INFO Kubernetes file "k8s\\app-service.yaml" created INFO Kubernetes file "k8s\\db-service.yaml" created INFO Kubernetes file "k8s\\app-deployment.yaml" created INFO Kubernetes file "k8s\\app-ingress.yaml" created INFO Kubernetes file "k8s\\db-deployment.yaml" created INFO Kubernetes file "k8s\\db-data-persistentvolumeclaim.yaml" created
There are now six files, and db-data asks for 1Gi. The Ingress has no ingressClassName: K3s marks Traefik as the default class, so it picks the Ingress up.
Tip: Put
kompose.service.exposeonly on the web service. The database gets a Service fromexpose:and no Ingress, which is right.
Step 5: Move the passwords into Kubernetes Secrets#
A Secret holds values for a pod, outside the Deployment file. We make two (one per app) from small env files, then add envFrom to each Deployment so the values appear as environment variables. The app Secret holds the whole DATABASE_URL because it contains the password. Replace the dummy values.
Linux#
cd ~/kompose-demo
cat > app-secrets.env << 'EOF'
ADMIN_PASSWORD=change-me-too
DATABASE_URL=postgres://miniflux:change-me@db/miniflux?sslmode=disable
EOF
cat > db-secrets.env << 'EOF'
POSTGRES_PASSWORD=change-me
EOF
chmod 600 app-secrets.env db-secrets.env
for n in app db; do
cat > $n-patch.yaml << EOF
spec:
template:
spec:
containers:
- name: $n
envFrom:
- secretRef:
name: $n-secrets
EOF
kubectl patch --local -f k8s/$n-deployment.yaml --patch-file $n-patch.yaml -o yaml > k8s/$n-deployment.new
mv k8s/$n-deployment.new k8s/$n-deployment.yaml
done
kubectl create namespace miniflux
kubectl create secret generic app-secrets -n miniflux --from-env-file=app-secrets.env
kubectl create secret generic db-secrets -n miniflux --from-env-file=db-secrets.env
Windows (PowerShell)#
Set-Location "$HOME\kompose-demo"
@'
ADMIN_PASSWORD=change-me-too
DATABASE_URL=postgres://miniflux:change-me@db/miniflux?sslmode=disable
'@ | Set-Content -Encoding ascii app-secrets.env
@'
POSTGRES_PASSWORD=change-me
'@ | Set-Content -Encoding ascii db-secrets.env
foreach ($n in "app","db") {
@"
spec:
template:
spec:
containers:
- name: $n
envFrom:
- secretRef:
name: $n-secrets
"@ | Set-Content -Encoding ascii "$n-patch.yaml"
kubectl patch --local -f "k8s\$n-deployment.yaml" --patch-file "$n-patch.yaml" -o yaml | Set-Content -Encoding ascii "k8s\$n-deployment.new"
Move-Item -Force "k8s\$n-deployment.new" "k8s\$n-deployment.yaml"
}
kubectl create namespace miniflux
kubectl create secret generic app-secrets -n miniflux --from-env-file=app-secrets.env
kubectl create secret generic db-secrets -n miniflux --from-env-file=db-secrets.env
Mac (Terminal)#
Same commands as Linux.
kubectl patch --local merges the patch into the file on your disk (the container is matched by name) without contacting the cluster, and prints the result. Keep the patch files: after a new kompose convert you can repeat the edit. You can also add the envFrom lines with an editor.
Check it worked. Real output of the create commands:
namespace/miniflux created secret/app-secrets created secret/db-secrets created
k8s/app-deployment.yaml now has an envFrom block with secretRef: name: app-secrets, and no password.
Tip: Delete
app-secrets.envanddb-secrets.envafter you stored the real values in your password manager, and never commit them. The Secrets live on in the cluster; the files are only the way in.
Step 6: Apply to K3s and check#
Linux#
cd ~/kompose-demo kubectl apply -n miniflux -f k8s kubectl rollout status deployment/db -n miniflux --timeout=180s kubectl rollout status deployment/app -n miniflux --timeout=180s kubectl get pods,svc,pvc,ingress -n miniflux
Windows (PowerShell)#
Set-Location "$HOME\kompose-demo" kubectl apply -n miniflux -f k8s kubectl rollout status deployment/db -n miniflux --timeout=180s kubectl rollout status deployment/app -n miniflux --timeout=180s kubectl get pods,svc,pvc,ingress -n miniflux
Mac (Terminal)#
Same commands as Linux.
Real output (the image pulls can take a minute on a first run; the ids differ for you):
deployment.apps/app created ingress.networking.k8s.io/app created service/app created persistentvolumeclaim/db-data created deployment.apps/db created service/db created NAME READY STATUS RESTARTS AGE pod/app-67cbf69cf-cfgxv 1/1 Running 1 (4s ago) 5s pod/db-d6565c4f8-vrcmt 1/1 Running 0 5s NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE service/app ClusterIP 10.43.91.192 <none> 8080/TCP 5s service/db ClusterIP 10.43.16.7 <none> 5432/TCP 5s NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS persistentvolumeclaim/db-data Bound pvc-... 1Gi RWO local-path NAME CLASS HOSTS ADDRESS PORTS AGE ingress.networking.k8s.io/app traefik rss.example.com 172.17.0.2 80 5s
(We shortened the claim table.) RESTARTS 1 on the app is the lost depends_on: it started before Postgres accepted connections. In an earlier run its log said dial tcp 10.43.225.100:5432: connect: connection refused, and Kubernetes restarted it until the database was ready.
rss.example.com is a dummy, so for a first test send the host name by hand. On a Linux K3s machine use its address and port 80; in our throwaway K3s it is 127.0.0.1:18080:
curl -s -H "Host: rss.example.com" http://127.0.0.1:18080/healthcheck curl -s -H "Host: rss.example.com" http://127.0.0.1:18080/ | grep -i "<title>"
On Windows use curl.exe. Real result: OK and <title>Sign In - Miniflux. Log in as admin with the dummy password from Step 5, then change it. For a real address, point a DNS record of your own domain at the K3s machine and use that domain in the label.
Tip: If a pod shows
CrashLoopBackOff, runkubectl logs -n miniflux deploy/app --tail=30. The last lines almost always name the cause.
Put it behind HTTPS with Traefik (K3s has it already)#
The Ingress from Step 4 serves plain HTTP. For HTTPS use the Traefik that ships with K3s, or a reverse proxy of your own (Caddy). This is for a server with a domain; at home a local certificate is enough.
With Traefik#
K3s gives Traefik ports 80 and 443 on the node (K3s docs). We read its start arguments: the HTTPS entry point is websecure and no certificate resolver is set. The Traefik labels you know from our Traefik guide become annotations on the Ingress:
| Docker label | Ingress annotation |
|---|---|
traefik.http.routers.app.entrypoints=https | traefik.ingress.kubernetes.io/router.entrypoints: websecure (K3s name; https only if your own Traefik uses it) |
traefik.http.routers.app.tls=true | traefik.ingress.kubernetes.io/router.tls: "true" |
traefik.http.routers.app.tls.certresolver=le | traefik.ingress.kubernetes.io/router.tls.certresolver: le (the resolver must exist in your Traefik settings; K3s has none) |
Names are from the Traefik Ingress docs (5 December 2026). Do not put traefik.http.routers... labels in the Compose file: Kompose copies labels as annotations, which Traefik ignores on Kubernetes (we saw them land on the Deployment and Ingress). Add the real ones with a patch.
Linux and Mac:
cd ~/kompose-demo
cat > ingress-patch.yaml << 'EOF'
metadata:
annotations:
traefik.ingress.kubernetes.io/router.entrypoints: websecure
traefik.ingress.kubernetes.io/router.tls: "true"
EOF
kubectl patch --local -f k8s/app-ingress.yaml --patch-file ingress-patch.yaml -o yaml > k8s/app-ingress.new
mv k8s/app-ingress.new k8s/app-ingress.yaml
kubectl apply -n miniflux -f k8s/app-ingress.yaml
Windows (PowerShell):
Set-Location "$HOME\kompose-demo"
@'
metadata:
annotations:
traefik.ingress.kubernetes.io/router.entrypoints: websecure
traefik.ingress.kubernetes.io/router.tls: "true"
'@ | Set-Content -Encoding ascii ingress-patch.yaml
kubectl patch --local -f k8s\app-ingress.yaml --patch-file ingress-patch.yaml -o yaml | Set-Content -Encoding ascii k8s\app-ingress.new
Move-Item -Force k8s\app-ingress.new k8s\app-ingress.yaml
kubectl apply -n miniflux -f k8s\app-ingress.yaml
Check it worked. On our throwaway K3s, with kubectl port-forward -n kube-system svc/traefik 18443:443 running in a second terminal, curl.exe -sk --resolve rss.example.com:18443:127.0.0.1 https://rss.example.com:18443/ -o NUL -w "%{http_code}" printed 200, and plain HTTP to the same host gave 404 (the route now exists only on websecure). On a real node: curl -k --resolve rss.example.com:443:<node-ip> https://rss.example.com/.
-k is needed because Traefik answers with its own self-signed certificate. For a trusted one use cert-manager (our Rancher guide installs it) or Traefik's Let's Encrypt resolver le set in a K3s HelmChartConfig. We tested neither.
Without Traefik: Caddy#
Caddy gets a Let's Encrypt certificate for a public domain by itself, or a local one with tls internal. K3s's Traefik already holds ports 80 and 443 on its node, so run Caddy on another machine and point it at a NodePort. In compose.yaml replace the kompose.service.expose label with these (Kompose user guide) and convert again:
labels:
kompose.service.type: nodeport
kompose.service.nodeport.port: 30080
Kompose then wrote type: NodePort with nodePort: 30080, and the app answered on that port from inside the node. We did not run Caddy. With Caddy installed (see our Caddy guide), the Caddyfile is:
rss.example.com {
reverse_proxy <node-ip>:30080
}
At home add tls internal inside the braces and trust Caddy's root certificate as the Caddy guide shows. A NodePort opens that port on every interface of the node: allow it in the firewall only from the Caddy machine. Check with curl -I https://rss.example.com (-k for an untrusted local certificate).
Tip: Pick one route. Do not keep the Ingress label and the NodePort labels together unless you want both doors open.
What Kompose converts and what it does not#
From the official conversion table (v1.39.0) and our runs:
| Compose key | Result |
|---|---|
image, ports, environment, command | Converted |
Named volumes | A PVC, 100Mi unless you label it |
Bind mount (./data:/data) | Warning Volume mount on the host "..." isn't supported - ignoring path on the host. An empty PVC, your files are not copied |
env_file | A ConfigMap (plain text), not a Secret |
secrets: | A Secret object, but see the mount bug in Common mistakes |
healthcheck | A livenessProbe. Check it: a probe that fails during first start restarts the pod |
depends_on, links, networks, dns, logging | Not converted |
build: | Only with --build local; the image must still reach a registry the cluster can use |
Helm chart output. kompose convert --chart -o chart writes Chart.yaml and a templates folder. We ran it: the templates are the same plain YAML, there is no values.yaml, and the chart is named after the folder. It packages the files; it is not a parameterised chart. We did not run helm install.
Security and testing#
| Control | How |
|---|---|
| Secrets are encoded, not encrypted | kubectl get secret app-secrets -n miniflux -o jsonpath='{.data.ADMIN_PASSWORD}' printed Y2hhbmdlLW1lLXRvbw==, base64 of our dummy password. Kubernetes stores Secrets unencrypted by default (Kubernetes docs). K3s can encrypt them at rest with the server flag --secrets-encryption (needs a server restart; K3s docs) |
| Who can read them | Anyone with admin kubectl. Keep the kubeconfig chmod 600 |
| Files | Never commit *-secrets.env. The k8s folder holds no passwords after Step 5 |
| Network | Only Traefik (80/443) faces your network. The db Service is ClusterIP, inside the cluster only. kompose convert --generate-network-policies exists; we did not test it |
| Images | Pinned tags; scan them with our Trivy guide |
Quick tests:
kubectl get pods -n miniflux kubectl logs -n miniflux deploy/app --tail=20 kubectl exec -n miniflux deploy/db -- psql -U miniflux -c "\dt"
The last command listed Miniflux's tables in our run, so the app had migrated the database.
Common mistakes#
| Mistake | Why it happens | Do this instead |
|---|---|---|
Using a distro or snap copy of Kompose: Unsupported config option for services service: 'foo', cannot unmarshal !!str 'myapp' into config.RawService (issue 2094, snap 1.21.0; issue 1814, 1.22.0) | Repositories lag (Alpine edge 1.31.2, EPEL 7 1.7.0), and old versions cannot read modern Compose files | Install the release binary, check kompose version (Step 1) |
| Applying the first output as is | Kompose makes a Service only for a service with ports: or expose: | Add expose: ["5432"] to the database, or the app fails with lookup db ... server misbehaving (our run) |
| Keeping the 100Mi volume | Default claim size (issue 1374, closed by --pvc-request-size) | Label kompose.volume.size: 1Gi. A label beats the flag (we tested 1Gi against 2Gi) |
Committing passwords, .env or env_file values | They are baked into plain YAML or a ConfigMap at convert time (our runs) | Keep them out of the Compose file; use Step 5 |
Two or more Compose secrets:: Deployment.apps "service" is invalid: ... volumeMounts[1].mountPath: Invalid value: "/run/secrets": must be unique (issue 1894) | Every secret is mounted at /run/secrets. The issue was closed as not planned (12 July 2026) and 1.39.0 still wrote both mounts in our test | Use Step 5, or --secrets-as-files, which gave /run/secrets/secret1 and /run/secrets/secret2 |
Expecting a bind mount (./pgdata:/var/lib/postgresql/data) to carry data (issue 1271 shows the warning) | Kubernetes has no host folder next to your Compose file | Use a named volume, then load data from a dump (see Updates and backups) |
Expecting depends_on to wait (issue 1871: "We don't support condition at the moment") | Kubernetes starts everything at once | Expect a few restarts, or add a readiness probe |
Leaving kompose.cmd annotations in shared files | Kompose writes the command and its path into every file | --with-kompose-annotation=false |
AI assistants: kompose up or kompose down "to deploy" | Old tutorials. 1.39.0 has only convert, completion, version, help; kompose up prints unknown command "up" for "kompose" | kompose convert, then kubectl apply |
AI assistants: Traefik Docker labels in the Compose file, or invented labels such as kompose.service.tls | Docker Traefik mixed with Kubernetes. Only the labels in the user guide exist | Check each label in the user guide; use Ingress annotations |
| AI assistants: "the Helm chart is production ready" | --chart wraps the same YAML | Review the files; there is no values.yaml |
Tip: After every
kompose convert, read the WARN lines first.Service "db" won't be createdandVolume mount ... isn't supportedeach warn of a broken connection or lost data before you apply anything.
Tip: Keep your fixes as files (the patch files), not as hand edits. After you change the Compose file you convert again and re-apply them in a minute; hand edits are lost.
Tip: Pin image tags in the Compose file. With
latesta node restart can pull a different image.
Troubleshooting#
| Problem | Solution |
|---|---|
kompose: command not found | Open a new terminal so the PATH is read |
kubectl get nodes cannot connect | KUBECONFIG must point at your file; the throwaway K3s needs a minute to start |
App pod Error or CrashLoopBackOff | kubectl logs -n miniflux deploy/app --tail=30 and kubectl describe pod -n miniflux -l io.kompose.service=app |
| Database pod restarts at first start | Check its livenessProbe in db-deployment.yaml; raise initialDelaySeconds or remove it |
Ingress gives 404 page not found | The host name must match the Ingress (-H "Host: ..."); after the websecure annotation use HTTPS |
Claim stays Pending | kubectl describe pvc db-data -n miniflux. K3s local-path binds it when a pod uses it |
| Changed a Secret, nothing changed | Values load at start: kubectl rollout restart deployment/app -n miniflux |
Exact error texts#
Unsupported config option for services service: 'foo'andcannot unmarshal !!str 'myapp' into config.RawService(issue 2094): an old Kompose (1.21.0). Install 1.39.0.services.vault-agent.depends_on.vault must be a mapping(issue 1986, 1.35.0): the reporter's file haddepends_on:withvault: service_started, a short form we believe Compose does not accept. The thread has no confirmed cause.metadata.name: Invalid value: "scooldUploads": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters(issue 1942, 1.34.0, reported fixed later): use lowercase volume names.
Known bugs (December 2026)#
Issue 1894 (secret mounts) was closed as not planned and still shows in v1.39.0. We found nothing else that stops the flow in this guide.
Updates and backups#
Update the app. Change the tag in compose.yaml, convert into a fresh folder, repeat the patches from Step 5 and the HTTPS section, and apply (kubectl apply -n miniflux -f k8s). A major Postgres version needs a dump and restore, not a tag change. Update Kompose: download the new binary, check kompose version, read the release notes, and compare the new output with git diff before you apply.
What to back up. compose.yaml, the patch files and the k8s folder (no passwords in them); the real secret values in your password manager; and the database. The db-data claim sits on the node's disk, so a dump is the simplest backup. Linux and Mac:
db=$(kubectl get pod -n miniflux -l io.kompose.service=db -o jsonpath='{.items[0].metadata.name}')
kubectl exec -n miniflux "$db" -- pg_dump -U miniflux -Fc miniflux -f /tmp/miniflux.dump
kubectl cp "miniflux/$db:/tmp/miniflux.dump" "./miniflux-$(date +%F).dump"
kubectl exec -n miniflux "$db" -- rm /tmp/miniflux.dump
Windows (PowerShell):
$db = kubectl get pod -n miniflux -l io.kompose.service=db -o jsonpath='{.items[0].metadata.name}'
kubectl exec -n miniflux $db -- pg_dump -U miniflux -Fc miniflux -f /tmp/miniflux.dump
kubectl cp "miniflux/${db}:/tmp/miniflux.dump" ".\miniflux-$(Get-Date -Format yyyy-MM-dd).dump"
kubectl exec -n miniflux $db -- rm /tmp/miniflux.dump
Run it from cron (03:00) or Task Scheduler. kubectl cp prints tar: Removing leading '/' from member names; that is harmless. For K3s snapshots see the backup part of our Rancher guide.
Restore test. We ran this on Windows into a scratch database and it printed admin:
kubectl exec -n miniflux "$db" -- createdb -U miniflux restore_test kubectl cp ./miniflux.dump "miniflux/$db:/tmp/restore.dump" kubectl exec -n miniflux "$db" -- pg_restore -U miniflux -d restore_test /tmp/restore.dump kubectl exec -n miniflux "$db" -- psql -U miniflux -d restore_test -tc "select username from users" kubectl exec -n miniflux "$db" -- sh -c 'dropdb -U miniflux restore_test; rm /tmp/restore.dump'
To remove the demo: kubectl delete namespace miniflux. This deletes the data too.
Performance and resources#
Kompose runs once and exits. K3s is what costs resources: its docs list 2 CPU cores and 2 GB RAM as the server minimum. We measured once, on the Windows throwaway K3s with kubectl top: the app pod used 15 Mi and 1m CPU, the database pod 43 Mi and 13m CPU, and the whole node (K3s, Traefik, both pods) about 965 Mi. That is one idle sample, not a benchmark. Watch yours with kubectl top pods -n miniflux and kubectl top node.
FAQ#
Is Kompose "Docker Compose on Kubernetes"? No. It translates the file once. Kubernetes then runs the result its own way, without depends_on, host folders or Compose networks.
Can I deploy with kompose up? Not in 1.39.0 (we got unknown command "up"). Use kompose convert, then kubectl apply.
Should I use the Helm chart output? Only to package the files. It has no values.yaml.
Is it worth it for a homelab? For one or two apps, hand-writing 100 lines of YAML can be as fast. Kompose pays off as a first draft for a bigger file and as a way to learn what Kubernetes needs. For Git-driven Docker deployments see Doco-CD.
Sources#
- Kompose: repository and README, release v1.39.0 (24 November 2026, with the SHA256 list), installation, user guide (labels), conversion table, kompose.io; Apache-2.0 via the GitHub licence record
- Miniflux: basic Compose example at 2.3.6; images
miniflux/miniflux:2.3.6andpostgres:17.12checked on Docker Hub - K3s: quick start, requirements, Traefik and ServiceLB, secrets encryption; release v1.37.3+k3s1 (image
rancher/k3s:v1.37.3-k3s1) - Kubernetes: Secrets, Translate a Docker Compose file, kubectl install
- Traefik: Kubernetes Ingress annotations
- Package versions: Repology, Homebrew
- Issues read: 2094, 1814, 1986, 1904, 1942, 1894, 1871, 1374, 1271, 2054
- Our guides: Rancher on K3s, Docker Compose, Traefik, Caddy, Doco-CD
Checked against the official docs on 2026-12-05. DIY Lab Hub ran the flow once on Windows (Kompose 1.39.0, K3s v1.36.6+k3s1 in Docker Desktop); Linux, Mac, a native K3s node, Caddy, cert-manager and Helm were not run.