Skip to content

About

Kubernetes to docker compose in one command. Converts Helm charts, helmfiles, and K8s manifests to a working docker compose setup.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

29 Commits

Folders and files

Repository files navigation

kubernetes2simple

Kubernetes? Too simple.

You have a Kubernetes project. You want to run it locally with docker compose. You don't want to think about it.

curl -fsSL k2s.dekube.io/get | bash
docker compose up -d

The script looks at your project, figures out what it is, installs whatever tools are missing, and produces a working docker compose setup. Everything it downloads lives in .kubernetes2simple/ — your system stays clean.

Guides: Kubernetes to Docker Compose · Helm chart to Docker Compose · Local development with Docker Compose

What you need

  • Docker (with docker compose)
  • Python 3.10+

That's all. The rest is handled.

Options

./k2s.sh [--env <environment>] [--output-dir <dir>] [--clean]

--env selects a helmfile environment if your project uses one. --clean wipes the local cache and starts fresh.

If you don't pass --env, the script prompts for one interactively — under curl | bash that prompt reads from /dev/tty, so it still works even though stdin is the piped script. Without a terminal at all (e.g. a CI job), it warns and continues without an environment instead of hanging.

Good to know

The script generates three files: compose.yml, Caddyfile, and dekube.yaml.

You can re-run it safely. Your compose.yml and Caddyfile are regenerated every time — don't edit them by hand, your changes will be overwritten. If you need to customize something (exclude a service, override an image, pin a volume path), edit dekube.yaml instead. That file is yours — the script reads it but never overwrites it.

Downloads are cached. The converter is cached in .kubernetes2simple/ and checked for updates at most once a day; if GitHub can't be reached, the cached copy is used. helm and helmfile, when the script has to download them, are checksum-verified first. Details: what the script fetches, and when.

TLS is best-effort. If your project uses cert-manager certificates, the script generates self-signed certs locally so things can start. This is fine for development. It is not a replacement for your actual certificate setup — don't ship this to production expecting real TLS.

Some things won't convert. CronJobs, HPA, resource requests — anything that doesn't have a compose equivalent is skipped with a warning. (Resource limits and probes do convert, to deploy.resources.limits and healthcheck: respectively.) This is expected. The goal is a working local environment, not a 1:1 replica of your cluster.

It didn't work

Open an issue. Describe what you pointed it at, paste the output. We'll figure it out.

Just don't ask how it works.


You want answers? Click at your own risk.

kubernetes2simple is the turnkey face of dekube — an heretical, overengineered conversion engine that parses Kubernetes manifests, resolves ConfigMaps and Secrets, rewrites Service DNS, generates TLS certificates, produces reverse proxy configurations, and reassembles the whole thing as docker compose services. It has an extension system, a package manager, a fake API server for the things that can't be faked, a regression test suite with an O(n³) torture generator, and documentation written in the tone of forbidden texts.

It was not designed. It was revealed, one mass-produced horror at a time, across increasingly unhinged AI-assisted sessions. The Lovecraftian quotes in the docs started as a joke. They stopped being funny around the third project.

kubernetes2simple bundles the engine, a bootstrap script, and most (not all) of the optional extensions in dekube-manager's registry: keycloak, cert-manager, trust-manager, servicemonitor, nginx, traefik, bitnami (see distribution.json), plus emptydir (inherited from the helmfile2compose base it's built on). Left out: cnpg, flatten-internal-urls (conflicts with the bundled cert-manager), nginx-provider, and fake-apiserver — so you never have to see any of this, except for those four.

Full documentation · kubernetes2simple site · Source engine · Extension registry

About

Kubernetes to docker compose in one command. Converts Helm charts, helmfiles, and K8s manifests to a working docker compose setup.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages