kompose README

The project's README from github.com/kubernetes/kompose. As one markdown file: README.md.

Kompose (Kubernetes + Compose)

Build Status Widget Coverage Status Widget GoDoc Widget GoReportCard Widget

logo

kompose is a tool to help users who are familiar with docker-compose move to Kubernetes. kompose takes a Compose Specification file and translates it into Kubernetes resources.

kompose is a convenience tool to go from local Compose environment to managing your application with Kubernetes. Transformation of the Compose Specification format to Kubernetes resources manifest may not be exact, but it helps tremendously when first deploying an application on Kubernetes.

Use Case

Convert compose.yaml into Kubernetes deployments and services with one simple command:

$ kompose convert -f compose.yaml
INFO Kubernetes file "frontend-service.yaml" created
INFO Kubernetes file "redis-leader-service.yaml" created
INFO Kubernetes file "redis-replica-service.yaml" created
INFO Kubernetes file "frontend-deployment.yaml" created
INFO Kubernetes file "redis-leader-deployment.yaml" created
INFO Kubernetes file "redis-replica-deployment.yaml" created

Other examples are provided in the examples directory.

Installation

We have multiple ways to install Kompose. Our preferred method is downloading the binary from the latest GitHub release.

Our entire list of installation methods are located in our installation.md document.

Installation methods:

Binary installation

Kompose is released via GitHub on a three-week cycle, you can see all current releases on the GitHub release page.

Linux and macOS:

# Linux
curl -L https://github.com/kubernetes/kompose/releases/download/v1.38.0/kompose-linux-amd64 -o kompose

# macOS
curl -L https://github.com/kubernetes/kompose/releases/download/v1.38.0/kompose-darwin-amd64 -o kompose

chmod +x kompose
sudo mv ./kompose /usr/local/bin/kompose

Windows:

Download from GitHub and add the binary to your PATH.

Shell autocompletion

We support Bash, Zsh and Fish autocompletion.

# Bash (add to .bashrc for persistence)
source <(kompose completion bash)

# Zsh (add to .zshrc for persistence)
source <(kompose completion zsh)

# Fish autocompletion
kompose completion fish | source

Development and building of Kompose

Building with go

Requisites:

  1. make
  2. Golang v1.6 or later
  3. Set GOPATH correctly or click SettingGOPATH for details

Steps:

  1. Clone repository
$ git clone https://github.com/kubernetes/kompose.git $GOPATH/src/github.com/kubernetes/kompose
  1. Change directory to the cloned repo.
cd $GOPATH/src/github.com/kubernetes/kompose
  1. Build with make
$ make bin
  1. Or build with go
$ go build -o kompose main.go
  1. Test your changes
$ make test

Documentation

Documentation can be found at our kompose.io website or our docs folder.

Here is a list of all available docs:

Community, Discussion, Contribution, and Support

Issues: If you find any issues, please file it.

Kubernetes Community: As part of the Kubernetes ecosystem, we follow the Kubernetes community principles. More information can be found on the community page.

Chat (Slack): We're fairly active on Slack and you can find us in the #kompose channel.

Code of Conduct

Participation in the Kubernetes community is governed by the Kubernetes Code of Conduct.

kompose (kubernetes/kompose)

Searching Database…

10.6K ·GitHub
这是什么?kompose 是 Kubernetes 项目出品的一款命令行工具,能把 Docker Compose 文件转换成 Kubernetes 资源,专为想从 docker-compose 迁移到 Kubernetes 的开发者打造。
kompose 是用来运行容器的工具,还是别的东西?它既不运行也不管理容器——它只是一个转换器:你把 Compose Specification 文件交给它,它会生成 Kubernetes 清单,之后由你自己部署到集群。
转换 Compose 文件时需要一个运行中的 Kubernetes 集群吗?不需要——转换本身在本地完成:kompose 只读取你的 Compose 文件并生成 Kubernetes 资源清单。只有当你真正要部署这些输出时才需要集群。
从 Compose 转换到 Kubernetes 的结果总是完全一致的吗?不是——README 警告说转换结果可能不完全一致。你需要检查并调整生成的清单,不过第一次部署到 Kubernetes 时,它还是能省下大量工作。
它能在 Windows 和 macOS 上运行吗,还是只能用 Linux?三个平台都可以:有 Linux、macOS(可通过 Homebrew 或 MacPorts 安装)和 Windows 的二进制文件,还有 CentOS、openSUSE/SLE 和 NixOS 的软件包,以及 Go 安装和 Docker 方式。
实际转换起来是什么样的?一条简单的命令就能把你的 compose.yaml 转换成 Kubernetes 的 Deployment 和 Service。仓库里的 examples 目录展示了更多转换场景。
为什么用它而不是手动编写 Kubernetes YAML?对熟悉 docker-compose、正在转向 Kubernetes 的人来说,它是一座便利的桥梁:输出可能不够完美,但比从零开始编写清单要快得多,能让应用更快跑上 Kubernetes。
它支持命令行自动补全吗?支持——Bash、Zsh 和 Fish 的自动补全都开箱即用。
kompose 是 Kubernetes 的官方项目吗?它属于 Kubernetes 生态,位于 kubernetes 这个 GitHub 组织下,遵循 Kubernetes 社区原则和行为准则,其团队也活跃在 #kompose Slack 频道。完整文档见 kompose.io。
What are similar projects?tilt, compose, skaffold, helm, kustomize, encore, velero, k9s
Creator
kubernetes
Size
44.2 MB
Stars
10.6K
Age
10y
Commits · 90 Days