The goal of OpenCompose is to make it easier for developers to on-board to Kubernetes. OpenCompose is a declarative higher level abstraction for specific Kubernetes resources.
Very simple idea, isn't it? A developer shouldn't have to learn various Kubernetes concepts just to test and deploy their applications. Focus on the application that is being developed.
We are at a very evolving stage of this project and we have listed some of our ideas as issues and examples. We are open to suggestions and contributions from the Kubernetes community as our project grows. Please send any PRs, issues or RFCs to improve this project.
You can retrieve binaries for Linux, macOS and Windows on our GitHub release page.
# Linux
curl -L https://github.com/redhat-developer/opencompose/releases/download/v0.2.0/opencompose-linux-amd64 -o opencompose
# macOS
curl -L https://github.com/redhat-developer/opencompose/releases/download/v0.2.0/opencompose-darwin-amd64 -o opencompose
# Windows
curl -L https://github.com/redhat-developer/opencompose/releases/download/v0.2.0/opencompose-windows-amd64.exe -o opencompose.exe
chmod +x ./opencompose
sudo mv ./opencompose /usr/local/bin/opencompose
A simple go get
is all you need in order to develop OpenCompose from source.
go get -u github.com/redhat-developer/opencompose
However, in order to file an issue, you may have to build it the supported way:
go get -u github.com/redhat-developer/opencompose
make bin
In order to have a properly signed build (as denoted by ./opencompose version
).
- Create or download hello-nginx.yaml.
version: 0.1-dev
services:
- name: helloworld
containers:
- image: tomaskral/nonroot-nginx
ports:
- port: 8080
- Convert OpenCompose file to Kubernetes objects
opencompose convert -f hello-nginx.yaml
Alternatively, you could also simply pass the URL of the remote file to OpenCompose, like -
opencompose convert -f https://raw.githubusercontent.com/redhat-developer/opencompose/master/examples/hello-nginx.yaml
This will create two Kubernetes files in current directory - helloworld-deployment.yaml
and helloworld-service.yaml
.
To deploy your application to Kubernetes run:
kubectl create -f helloworld-service.yaml -f helloworld-deployment.yaml
For Bash auto completion run the following command:
source <(opencompose completion bash)
To make it permanent add this line to your ~/.bashrc
.
For Zsh auto completion run the following command:
source <(opencompose completion zsh)
To make it permanent add this line to your ~/.zshrc
.
- OpenCompose file reference documentation
- You can find more in doc/ folder
We always welcome your feedback and thoughts on the project! Come and join our mailing list - opencompose [at] googlegroups.com. We also hangout on slack.k8s.io (#sig-apps).