* Fix ConfigMap name clash if env_file name is equal #2000
* Generate envFrom instead of single env entries from env_file entries #1999
* Fix failing test fixture outputs
* docs: update user guide
#### What type of PR is this?
<!--
Add one of the following kinds:
/kind bug
/kind cleanup
/kind feature
-->
/kind documentation
#### What this PR does / why we need it:
Updates the user guide completely revamp it / describe each label.
#### Which issue(s) this PR fixes:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
Closes https://github.com/kubernetes/kompose/issues/1584
Closes https://github.com/kubernetes/kompose/issues/1577
#### Special notes for your reviewer:
Signed-off-by: Charlie Drage <charlie@charliedrage.com>
Please check the docs examples / each label that it's okay!
* Update docs/user-guide.md
Co-authored-by: TessaIO <ahmedgrati1999@gmail.com>
* Update docs/user-guide.md
Co-authored-by: TessaIO <ahmedgrati1999@gmail.com>
* Update docs/user-guide.md
Co-authored-by: TessaIO <ahmedgrati1999@gmail.com>
* update capitalization
Signed-off-by: Charlie Drage <charlie@charliedrage.com>
---------
Signed-off-by: Charlie Drage <charlie@charliedrage.com>
Co-authored-by: TessaIO <ahmedgrati1999@gmail.com>
#### What type of PR is this?
<!--
Add one of the following kinds:
/kind bug
/kind documentation
/kind feature
-->
/kind cleanup
#### What this PR does / why we need it:
Removes the network policy annotation which is not needed (we are not
generating network policy)
#### Which issue(s) this PR fixes:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
Fixes https://github.com/kubernetes/kompose/issues/1759
#### Special notes for your reviewer:
#### What type of PR is this?
<!--
Add one of the following kinds:
/kind bug
/kind cleanup
/kind documentation
/kind feature
-->
#### What this PR does / why we need it:
When supplying a label in the compose file, it should stay in the output
too.
#### Which issue(s) this PR fixes:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
Fixes https://github.com/kubernetes/kompose/issues/1885
#### Special notes for your reviewer:
Signed-off-by: Charlie Drage <charlie@charliedrage.com>
#### What type of PR is this?
<!--
Add one of the following kinds:
/kind bug
/kind documentation
/kind feature
-->
/kind cleanup
#### What this PR does / why we need it:
Fixes the two flakey tests. One which is returning them in random
orders..
The other which is not available to run on mac due to not being able
"access" the folders.
#### Which issue(s) this PR fixes:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
N/A
#### Special notes for your reviewer:
N/A
Signed-off-by: Charlie Drage <charlie@charliedrage.com>
#### What type of PR is this?
<!--
Add one of the following kinds:
/kind bug
/kind documentation
/kind feature
-->
/kind cleanup
#### What this PR does / why we need it:
Removes the gen file, removes the old test file.
#### Which issue(s) this PR fixes:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
N/A
#### Special notes for your reviewer:
N/A
Signed-off-by: Charlie Drage <charlie@charliedrage.com>
#### What type of PR is this?
<!--
Add one of the following kinds:
/kind bug
/kind cleanup
/kind documentation
/kind feature
-->
#### What this PR does / why we need it:
Update the owners as people who haven't reviewed / approved for a while
keep getting pings / notifications about reviewing.
#### Which issue(s) this PR fixes:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
N/A
#### Special notes for your reviewer:
N/A
Signed-off-by: Charlie Drage <charlie@charliedrage.com>
#### What type of PR is this?
<!--
Add one of the following kinds:
/kind bug
/kind cleanup
/kind documentation
-->
/kind feature
#### What this PR does / why we need it:
This changes our example to use non-root so it runs well on non-root
clusters (ex. openshift).
We also add debugging tools so we can safely explore the container.
/tmp is also added as the directory for the replica or else it fails.
#### Which issue(s) this PR fixes:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
N/A
#### Special notes for your reviewer:
Signed-off-by: Charlie Drage <charlie@charliedrage.com>
#### What type of PR is this?
Change from Docker Compose references to just Compose
<!--
Add one of the following kinds:
/kind bug
/kind cleanup
/kind documentation
/kind feature
-->
#### What this PR does / why we need it:
Compose is an open format and we should not say "Docker Compose".
#### Which issue(s) this PR fixes:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
Fixes https://github.com/kubernetes/kompose/issues/1868
#### Special notes for your reviewer:
Signed-off-by: Charlie Drage <charlie@charliedrage.com>
fallback to skip volume mount and log warning when path cannot be resolved, as /sys, /root, /var/lib/docker
in e2e TestMultipleContainersInPod directory /data replaced with /data-dir
Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>
* adds a label for initContainers, test and user-guide
Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>
* solved suggestion version from 2 to 3, coments
Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>
* test e2e
Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>
* add target to kompose build
Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>
* chore(deps)(deps): bump golang.org/x/tools from 0.16.1 to 0.19.0 (#1836)
Bumps [golang.org/x/tools](https://github.com/golang/tools) from 0.16.1 to 0.19.0.
- [Release notes](https://github.com/golang/tools/releases)
- [Commits](https://github.com/golang/tools/compare/v0.16.1...v0.19.0)
---
updated-dependencies:
- dependency-name: golang.org/x/tools
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* changed var names contaers to containers
changed labels to kompose.init.container.name, kompose.init.container.image, kompose.init.container.command
fixed documentation, tests and e2e
also merged main with new commits to this branch
Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>
---------
Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Kubernetes Prow Robot <20407524+k8s-ci-robot@users.noreply.github.com>
add tests and e2e
function isconfigfile check if we need to use configmap and mount in readonly
readonly not asigned because not fail e2e
Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>
added tests
fixNetworkModeToService is responsible for adjusting the network mode of services in docker compose (services:) and generate a mapping of deployments based on the network mode of each service merging containers into the destination deployment, and removing transferred deployments
Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>
kompose.hpa.minreplicas
kompose.hpa.maxreplicas
kompose.hpa.cpu
kompose.hpa.memory
documentated labels user_guide.md
generate custom metrics from cpu, memory and set min/max replicas
Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>
* fix issue 1793 https://github.com/kubernetes/kompose/issues/1793
*add tests
Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>
formated k8utils_test.go
Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>
labels formatted as name"-"envName to match fixtures when performing the gitHub action
Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>
removed this piece code because apply it later, and it is redundant
Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>
Refactor test in k8sutils_test.go to extract the last 63 characters. This addresses the impact of the removed code that previously truncated the input with if len(envName) > 63 { envName = envName[len(envName)-63:] }
Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>
changed to name function to getUsableNameEnvFile
Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>
fix issue 1793
* fix issue 1793 https://github.com/kubernetes/kompose/issues/1793
*add tests
Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>
labels formatted as name"-"envName to match fixtures when performing the gitHub action
Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>
changed to name function to getUsableNameEnvFile
Signed-off-by: jose luis <2064537+sosan@users.noreply.github.com>
#### What type of PR is this?
<!--
Add one of the following kinds:
/kind bug
/kind cleanup
/kind feature
-->
/kind documentation
#### What this PR does / why we need it:
Updates the readme by:
* Removing small amount of references to Docker since Compose is an open spec
* Changing to correct redis terminology
#### Which issue(s) this PR fixes:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
N/A
#### Special notes for your reviewer:
N/A
Signed-off-by: Charlie Drage <charlie@charliedrage.com>
#### What type of PR is this?
<!--
Add one of the following kinds:
/kind bug
/kind cleanup
/kind feature
-->
/kind documentation
#### What this PR does / why we need it:
We should not be using the outdated redis terms, instead redis now uses
leader / replica.
#### Which issue(s) this PR fixes:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
N/A
#### Special notes for your reviewer:
N/A
Signed-off-by: Charlie Drage <charlie@charliedrage.com>
#### What type of PR is this?
<!--
Add one of the following kinds:
/kind bug
/kind cleanup
/kind feature
-->
/kind documentation
#### What this PR does / why we need it:
It's 2024 now
#### Which issue(s) this PR fixes:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
Fixes #
#### Special notes for your reviewer:
Signed-off-by: Charlie Drage <charlie@charliedrage.com>
#### What type of PR is this?
<!--
Add one of the following kinds:
/kind bug
/kind documentation
/kind feature
-->
/kind cleanup
#### What this PR does / why we need it:
Fixes the current broken examples by:
* Removing all the old incompatible ones (we do not really support v3
anymore or v2... since switching libraries)
* Uses quay.io/kompose/web as our front end example which is a fork of
the guestbook-go kubernetes examples
#### Which issue(s) this PR fixes:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
Closes https://github.com/kubernetes/kompose/issues/1757
#### Special notes for your reviewer:
Test using docker-compose (you'll see it come up!), then try with
kompose :)
Signed-off-by: Charlie Drage <charlie@charliedrage.com>
* fix issue https://github.com/kubernetes/kompose/issues/1683
* add tests, die if inputfiles not specified
* fix GetComposeFileDir function and use it
* use fixed GetComposeFileDir instead of filepath.Dir
* return error instead of fatal
* add pod configmap creation to openshift
* fix: env_file configmap name length
fix filename to configmap name transformer
* fix configmap names in tests
* add env-multiple fixture and test
* adjust to test
* disable env-multiple suite
#### What type of PR is this?
<!--
Add one of the following kinds:
/kind bug
/kind cleanup
/kind feature
-->
/kind documentation
Updates the documentation to mention arm64.
#### What this PR does / why we need it:
N/A
#### Which issue(s) this PR fixes:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
N/A
#### Special notes for your reviewer:
N/A
Signed-off-by: Charlie Drage <charlie@charliedrage.com>
#### What type of PR is this?
<!--
Add one of the following kinds:
/kind cleanup
/kind documentation
/kind feature
-->
/kind bug
#### What this PR does / why we need it:
When we generate the YAML, we should NOT add namespace by default,
namespace should only be added if it has been specified via the command
line.
#### Which issue(s) this PR fixes:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
Fixes https://github.com/kubernetes/kompose/issues/1729
#### Special notes for your reviewer:
Signed-off-by: Charlie Drage <charlie@charliedrage.com>
#### What type of PR is this?
<!--
Add one of the following kinds:
/kind cleanup
/kind documentation
/kind feature
-->
/kind bug
Fixes a validation bug where if you do not provide a compose.yaml or
docker-compose.yaml it will nil point error out rather than have an
appropriate "file not found" output.
#### Which issue(s) this PR fixes:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
Closes https://github.com/kubernetes/kompose/issues/1719
#### Special notes for your reviewer:
Signed-off-by: Charlie Drage <charlie@charliedrage.com>
#### What type of PR is this?
<!--
Add one of the following kinds:
/kind bug
/kind cleanup
/kind documentation
/kind feature
-->
replaces wording to replica
#### What this PR does / why we need it:
#### Which issue(s) this PR fixes:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
Fixes #
#### Special notes for your reviewer:
Signed-off-by: Charlie Drage <charlie@charliedrage.com>
#### What type of PR is this?
<!--
Add one of the following kinds:
/kind bug
/kind cleanup
/kind documentation
/kind feature
-->
We should be using replica to indicate a new node of redis.
Unfortunatley gcr still hasn't pushed another image, so we will still
have to use registry.k8s.io/redis-slave:v2
#### What this PR does / why we need it:
N/A
#### Which issue(s) this PR fixes:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
Fixes #
N/A
#### Special notes for your reviewer:
N/A
Signed-off-by: Charlie Drage <charlie@charliedrage.com>
#### What type of PR is this?
<!--
Add one of the following kinds:
/kind bug
/kind cleanup
/kind feature
-->
/kind documentation
#### What this PR does / why we need it:
Updates the site with correct architecture link
#### Which issue(s) this PR fixes:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
Fixes #
#### Special notes for your reviewer:
Signed-off-by: Charlie Drage <charlie@charliedrage.com>
#### What type of PR is this?
<!--
Add one of the following kinds:
/kind bug
/kind cleanup
/kind documentation
/kind feature
-->
update release script again with a reminder for docs update
#### What this PR does / why we need it:
#### Which issue(s) this PR fixes:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
Fixes #
#### Special notes for your reviewer:
Signed-off-by: Charlie Drage <charlie@charliedrage.com>
#### What type of PR is this?
<!--
Add one of the following kinds:
/kind bug
/kind documentation
/kind feature
-->
/kind cleanup
#### What this PR does / why we need it:
Updates the release script to use main instead of master
#### Which issue(s) this PR fixes:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
N/A
#### Special notes for your reviewer:
N/A
Signed-off-by: Charlie Drage <charlie@charliedrage.com>
* feat: support custom build and push commands
Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
* test: add functional tests of the support of custom build and push
Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
* docs: add docs of the support of custom build and push
Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
---------
Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
* fix: support host port and protocol in functional tests
* feat: support compose.yaml and compose.yml files
Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
* test: implement functional tests of the support of compose files
Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
---------
Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
* fix openshift dc and image stream api version
Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
* e2e: Update Openshift manifests to update the API Version
Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
---------
Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
* feat: support security context fsgroup
Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
* test: add unit test to security group fsgroup
Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
* test: add functional test to security group fsgroup
Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
* docs: add documentation of the new label of security group fsgroup
Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
---------
Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
#### What type of PR is this?
<!--
Add one of the following kinds:
/kind bug
/kind cleanup
/kind documentation
/kind feature
-->
#### What this PR does / why we need it:
Update the copyright of the website to 2023.
#### Which issue(s) this PR fixes:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
N/A
#### Special notes for your reviewer:
N/A
Signed-off-by: Charlie Drage <charlie@charliedrage.com>
#### What type of PR is this?
<!--
Add one of the following kinds:
/kind bug
/kind cleanup
/kind documentation
/kind feature
-->
Removes the build/rpm submodule that's no longer needed / used
#### What this PR does / why we need it:
Fixes the issue of trying to build the Dockerfile: docker build -t
kompose https://github.com/kubernetes/kompose.git#main
#### Which issue(s) this PR fixes:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
N/A
#### Special notes for your reviewer:
Signed-off-by: Charlie Drage <charlie@charliedrage.com>
#### What type of PR is this?
<!--
Add one of the following kinds:
/kind bug
/kind cleanup
/kind documentation
/kind feature
-->
#### What this PR does / why we need it:
We've switched to main, so the previous command no longer worked since
it was searching for master.
#### Which issue(s) this PR fixes:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
N/A
#### Special notes for your reviewer:
N/A
Signed-off-by: Charlie Drage <charlie@charliedrage.com>
#### What type of PR is this?
<!--
Add one of the following kinds:
/kind bug
/kind cleanup
/kind documentation
/kind feature
-->
#### What this PR does / why we need it:
The latest spelling error changes broke TOC from showing in the
documentation
#### Which issue(s) this PR fixes:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
Fixes #
#### Special notes for your reviewer:
Signed-off-by: Charlie Drage <charlie@charliedrage.com>
* docs: correct broken internal link (/docs/maven-example.md)
1. When I was reading the documentation, I noticed that links to other documents inside the repository were giving a 404 error. So, I cloned the repository and found found that all links such as "[Quickstart](/docs/maven-example.md)" were giving the errors.
2. The fix is to remove the `/docs/` part and the `.md` part.
3. I tested these commits with `bundle exec jekyll serve`. All the pages getting changed by the commits now work correctly.
* docs: correct broken internal link (/docs/conversion.md)
- Removed the `/docs` part and the `.md` part from the link.
- Tested with `bundle exec jekyll serve`.
- Working correctly now.
* docs: correct broken internal link (/docs/installation.md)
- Removed the `/docs` part and the `.md` part from the link.
- Tested with `bundle exec jekyll serve`.
- Working correctly now.
---------
Co-authored-by: Charlie Drage <charlie@charliedrage.com>
Some of the installation methods are either unmaintained / not up to
date anymore.
For example, we no longer package `.deb` packages.
The person using Kompose should be installing the binary directly
from GitHub rather than relying on their package manager.
Signed-off-by: Charlie Drage <charlie@charliedrage.com>
* feat: add the host port to containers
* test(unit): add unit tests for host port and protocol
* test(functional): add functional tests of host port and protocol
* test(functional): add functional tests of host port and protocol for openshift
* change master to main in scripts and docs
Changes the naming from master to main in the scripts and documentation.
Do not merge unless CI passes!
Signed-off-by: Charlie Drage <charlie@charliedrage.com>
* remove 1.18, specify version of staticcheck
---------
Signed-off-by: Charlie Drage <charlie@charliedrage.com>
Woo! Our new logo!
It's a little cartoon octopus inside of a septagon (similar to
Kubernetes).
It's to show how "composable" we similar to an octopus.
I've gone ahead and updated the documentation as well as the website.
Noticed a few errors in the release script when doing the 1.28.0 release
this month! So here is the updated script.
Signed-off-by: Charlie Drage <charlie@charliedrage.com>
Signed-off-by: Charlie Drage <charlie@charliedrage.com>
These were leftover files from a docs / site template.
Removing as they are not needed.
Signed-off-by: Charlie Drage <charlie@charliedrage.com>
Signed-off-by: Charlie Drage <charlie@charliedrage.com>
Maintenance!
Removes all the old scripts now used, and adds a "manual" doc sync
maintenance script which we have yet to automate.
Signed-off-by: Charlie Drage <charlie@charliedrage.com>
Signed-off-by: Charlie Drage <charlie@charliedrage.com>
* feat: migrate from libcompose to compose-go
libcompose has been deprecated since summer 2021 in favor of https://github.com/compose-spec/compose-go.
Kompose should now be able to load all versions of compose.
* chore: replace golint with staticcheck
golint has been deprecated. Recommended replacement is staticcheck.
* fix: make the out flag print to one file using seperator
* fix: comment an unused function
* fix: update test script
* fix: update output k8s
* fix: update the json output error condition
* fix: update envvars interpolation tests
* chore: update e2e tests to support yaml generation instead of JSON format
* fix: update e2e tests according to ci environment
* fix: apply PR changes
don't need sync docs since we are building from `/docs` directory
instead of `gh-pages`.
Signed-off-by: Charlie Drage <charlie@charliedrage.com>
Signed-off-by: Charlie Drage <charlie@charliedrage.com>
* fix: update kubernetes unit tests
* fix: check whether selectors are present or not
* fix: update golang-lint yaml file
* fix: downgrade the version of fsouza go docker-client
* openSUSE meanwhile includes kompose in their official repositories for Tumbleweed and Leap
* on SUSE Linux Enterprise Server kompose is available via PackageHub
@ -8,8 +8,8 @@ We'd love to accept your patches! Before we can take them, we have to jump a cou
Please fill out either the individual or corporate Contributor License Agreement (CLA).
* If you are an individual writing original source code and you're sure you own the intellectual property, then you'll need to sign an individual CLA.
* If you work for a company that wants to allow you to contribute your work, then you'll need to sign a corporate CLA.
- If you are an individual writing original source code and you're sure you own the intellectual property, then you'll need to sign an individual CLA.
- If you work for a company that wants to allow you to contribute your work, then you'll need to sign a corporate CLA.
Contact one of the [OWNERS](OWNERS) on Slack to access the appropriate CLA and instructions for how to sign and return it. Once we receive it, we'll be able to accept your pull requests.
[![Build Status Widget]][Build Status] [![Coverage Status Widget]][Coverage Status] [![GoDoc Widget]][GoDoc] [![GoReportCard Widget]][GoReportCardResult]
`kompose` is a tool to help users who are familiar with `docker-compose` move to [Kubernetes](http://kubernetes.io). `kompose` takes a Docker Compose file and translates it into Kubernetes resources.

`kompose` is a convenience tool to go from local Docker development to managing your application with Kubernetes. Transformation of the Docker Compose format to Kubernetes resources manifest may not be exact, but it helps tremendously when first deploying an application on Kubernetes.
`kompose` is a tool to help users who are familiar with `docker-compose` move to [Kubernetes](http://kubernetes.io). `kompose` takes a [Compose Specification](https://compose-spec.io/) 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](https://compose-spec.io/) format to Kubernetes resources manifest may not be exact, but it helps tremendously when first deploying an application on Kubernetes.
## Use Case
Convert [`docker-compose.yaml`](https://raw.githubusercontent.com/kubernetes/kompose/master/examples/docker-compose.yaml) into Kubernetes deployments and services with one simple command:
Convert [`compose.yaml`](https://raw.githubusercontent.com/kubernetes/kompose/main/examples/compose.yaml) into Kubernetes deployments and services with one simple command:
```sh
$ kompose convert -f docker-compose.yaml
INFO Kubernetes file "frontend-service.yaml" created
INFO Kubernetes file "redis-master-service.yaml" created
INFO Kubernetes file "redis-slave-service.yaml" created
INFO Kubernetes file "frontend-deployment.yaml" created
INFO Kubernetes file "redis-master-deployment.yaml" created
INFO Kubernetes file "redis-slave-deployment.yaml" created
$ 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](./examples).
@ -29,34 +31,36 @@ We have multiple ways to install Kompose. Our preferred method is downloading th
Our entire list of installation methods are located in our [installation.md](/docs/installation.md) document.
- [macOS (Homebrew and MacPorts)](/docs/installation.md#macos)
- [Windows](/docs/installation.md#windows)
- [Docker](/docs/installation.md#docker)
#### Binary installation
Kompose is released via GitHub on a three-week cycle, you can see all current releases on the [GitHub release page](https://github.com/kubernetes/kompose/releases).
Documentation can be found at our [kompose.io](http://kompose.io) website or our [docs](https://github.com/kubernetes/kompose/tree/master/docs) folder.
Documentation can be found at our [kompose.io](http://kompose.io) website or our [docs](https://github.com/kubernetes/kompose/tree/main/docs) folder.
Here is a list of all available docs:
@ -114,12 +134,11 @@ Here is a list of all available docs:
## Community, Discussion, Contribution, and Support
__Issues:__ If you find any issues, please [file it](https://github.com/kubernetes/kompose/issues).
**Issues:** If you find any issues, please [file it](https://github.com/kubernetes/kompose/issues).
__Kubernetes Community:__ As part of the Kubernetes ecosystem, we follow the Kubernetes community principles. More information can be found on the [community page](http://kubernetes.io/community/).
__Chat (Slack):__ We're fairly active on [Slack](http://slack.kubernetes.io#kompose) and you can find us in the #kompose channel.
**Kubernetes Community:** As part of the Kubernetes ecosystem, we follow the Kubernetes community principles. More information can be found on the [community page](http://kubernetes.io/community/).
**Chat (Slack):** We're fairly active on [Slack](http://slack.kubernetes.io#kompose) and you can find us in the #kompose channel.
### Code of Conduct
@ -129,7 +148,7 @@ Participation in the Kubernetes community is governed by the [Kubernetes Code of
[Build Status Widget]: https://github.com/kubernetes/kompose/workflows/Kompose%20CI/badge.svg
"unexpected Value for Kubernetes Controller field. Possible values are: %v, %v, and %v",string(DEPLOYMENT),string(DAEMONSET),string(REPLICATION_CONTROLLER),
errorMessage:fmt.Sprintf("unexpected Value for Build field. Possible values are: %v, %v, and %v",string(LOCAL),string(BUILD_CONFIG),string(NONE)),
},
{
options:ConvertOptions{
VolumeType:&randomVolumeTypeValue,
},
errorMessage:fmt.Sprintf("unexpected Value for VolumeType field. Possible values are: %v, %v, %v, %v",string(PVC),string(EMPTYDIR),string(HOSTPATH),string(CONFIGMAP)),
},
{
options:ConvertOptions{
Provider:Kubernetes{
Controller:&randomKubernetesControllerValue,
},
},
errorMessage:fmt.Sprintf("unexpected Value for Kubernetes Controller field. Possible values are: %v, %v, and %v",string(DEPLOYMENT),string(DAEMONSET),string(REPLICATION_CONTROLLER)),
convertCmd.Flags().BoolVar(&MultipleContainerMode,"multiple-container-mode",false,"Create multiple containers grouped by 'kompose.service.group' label")
convertCmd.Flags().StringVar(&ServiceGroupMode,"service-group-mode","","Group multiple service to create single workload by `label`(`kompose.service.group`) or `volume`(shared volumes)")
convertCmd.Flags().StringVar(&ServiceGroupName,"service-group-name","","Using with --service-group-mode=volume to specific a final service name for the group")
convertCmd.Flags().BoolVar(&SecretsAsFiles,"secrets-as-files",false,"Always convert docker-compose secrets into files instead of symlinked directories")
// OpenShift only
convertCmd.Flags().BoolVar(&ConvertDeploymentConfig,"deployment-config",true,"Generate an OpenShift deploymentconfig object")
@ -149,25 +190,32 @@ func init() {
// Standard between the two
convertCmd.Flags().StringVar(&ConvertBuild,"build","none",`Set the type of build ("local"|"build-config"(OpenShift only)|"none")`)
convertCmd.Flags().BoolVar(&ConvertPushImage,"push-image",false,"If we should push the docker image we built")
convertCmd.Flags().StringVar(&ConvertPushImageRegistry,"push-image-registry","","Specify registry for pushing image, which will override registry from image name.")
convertCmd.Flags().StringVar(&BuildCommand,"build-command","",`Set the command used to build the container image, which will override the docker build command. Should be used in conjuction with --push-command flag.`)
convertCmd.Flags().StringVar(&PushCommand,"push-command","",`Set the command used to push the container image. override the docker push command. Should be used in conjuction with --build-command flag.`)
convertCmd.Flags().StringVar(&ConvertPushImageRegistry,"push-image-registry","","Specify registry for pushing image, which will override registry from image name")
convertCmd.Flags().BoolVarP(&ConvertYaml,"yaml","y",false,"Generate resource files into YAML format")
convertCmd.Flags().MarkDeprecated("yaml","YAML is the default format now.")
convertCmd.Flags().MarkShorthandDeprecated("y","YAML is the default format now.")
convertCmd.Flags().MarkDeprecated("yaml","YAML is the default format now")
convertCmd.Flags().MarkShorthandDeprecated("y","YAML is the default format now")
convertCmd.Flags().BoolVarP(&ConvertJSON,"json","j",false,"Generate resource files into JSON format")
convertCmd.Flags().BoolVar(&ConvertStdout,"stdout",false,"Print converted objects to stdout")
convertCmd.Flags().StringVarP(&ConvertOut,"out","o","","Specify a file name or directory to save objects to (if path does not exist, a file will be created)")
convertCmd.Flags().IntVar(&ConvertReplicas,"replicas",1,"Specify the number of replicas in the generated resource spec")
convertCmd.Flags().StringVar(&ConvertVolumes,"volumes","persistentVolumeClaim",`Volumes to be generated ("persistentVolumeClaim"|"emptyDir"|"hostPath" | "configMap")`)
convertCmd.Flags().StringVar(&ConvertPVCRequestSize,"pvc-request-size","",`Specify the size of pvc storage requests in the generated resource spec`)
convertCmd.Flags().StringVarP(&ConvertNamespace,"namespace","n","",`Specify the namespace of the generated resources`)
convertCmd.Flags().BoolVar(&GenerateNetworkPolicies,"generate-network-policies",false,"Specify whether to generate network policies or not")
convertCmd.Flags().BoolVar(&WithKomposeAnnotation,"with-kompose-annotation",true,"Add kompose annotations to generated resource")
convertCmd.Flags().BoolVar(&NoInterpolate,"no-interpolate",false,"Keep environment variable names in the Compose file")
// Deprecated commands
convertCmd.Flags().BoolVar(&ConvertEmptyVols,"emptyvols",false,"Use Empty Volumes. Do not generate PVCs")
convertCmd.Flags().MarkDeprecated("emptyvols","emptyvols has been marked as deprecated. Use --volumes empty")
convertCmd.Flags().MarkDeprecated("emptyvols","emptyvols has been marked as deprecated. Use --volumes emptyDir")
convertCmd.Flags().IntVar(&ConvertYAMLIndent,"indent",2,"Spaces length to indent generated yaml files")
convertCmd.Flags().StringArrayVar(&ConvertProfiles,"profile",[]string{},`Specify the profile to use, can use multiple profiles`)
// In order to 'separate' both OpenShift and Kubernetes only flags. A custom help page is created
`kompose` has 3 stages: Loader, Transformer and Outputter. Each Stage should have well defined interface so it is easy to write new Loader, Transformer or Outputters and plug it in. Currently only Loader and Transformer interfaces are defined.
`kompose` has 3 stages: _Loader_, _Transformer_ and _Outputter_. Each stage should have a well-defined interface, so it is easy to write a new Loader, Transformer, or Outputters and plug it in. Currently, only Loader and Transformer interfaces are defined.
Loader reads input file (now `kompose` supports [Docker Compose](https://docs.docker.com/compose) v1, v2 and [Docker Distributed Application Bundle](https://blog.docker.com/2016/06/docker-app-bundle/) file) and converts it to KomposeObject.
The Loader reads the input file now `kompose` supports [Compose](https://docs.docker.com/compose) v1, v2 and converts it to KomposeObject.
Loader is represented by a Loader interface:
```go
type Loader interface {
LoadFile(file string) kobject.KomposeObject
}
```
Every loader “implementation” should be placed into `kompose/pkg/loader` (like compose& bundle). More input formats will be supported in future. You can take a look for more details at:
Every loader “implementation” should be placed into `kompose/pkg/loader` (like compose). More input formats will be supported in the future. You can take a look for more details at:
@ -32,38 +40,38 @@ Every loader “implementation” should be placed into `kompose/pkg/loader` (li
```go
// KomposeObject holds the generic struct of Kompose transformation
type KomposeObject struct {
ServiceConfigs map[string]ServiceConfig
ServiceConfigs map[string]ServiceConfig
}
// ServiceConfig holds the basic struct of a container
type ServiceConfig struct {
ContainerName string
Image string
Environment []EnvVar
Port []Ports
Command []string
WorkingDir string
Args []string
Volumes []string
Network []string
Labels map[string]string
Annotations map[string]string
CPUSet string
CPUShares int64
CPUQuota int64
CapAdd []string
CapDrop []string
Entrypoint []string
Expose []string
Privileged bool
Restart string
User string
ContainerName string
Image string
Environment []EnvVar
Port []Ports
Command []string
WorkingDir string
Args []string
Volumes []string
Network []string
Labels map[string]string
Annotations map[string]string
CPUSet string
CPUShares int64
CPUQuota int64
CapAdd []string
CapDrop []string
Entrypoint []string
Expose []string
Privileged bool
Restart string
User string
}
```
## Transformer
Transformer takes KomposeObject and converts it to target/output format (at this moment, there are sets of kubernetes/openshift objects). Similar to`Loader`, Transformer is represented by a Transformer interface:
The Transformer takes KomposeObject and converts it to target/output format (currently, there are sets of Kubernetes/OpenShift objects). Similar to the`Loader`, Transformer is represented by a Transformer interface:
```go
type Transformer interface {
@ -71,12 +79,12 @@ type Transformer interface {
}
```
If you wish to add more providers which contain different kind of objects, transformer would be the place to look into. At this moment Kompose supports Kubernetes (by default) and Openshift providers. More details at:
If you wish to add more providers containing different kinds of objects, the Transformer would be the place to look into. Currently, Kompose supports Kubernetes (by default) and OpenShift providers. More details at:
Outputter takes Transformer result and executes given action. For example action can be displaying result to stdout or directly deploying artifacts to Kubernetes/OpenShift.
The Outputter takes the Transformer result and executes the given action. For example, action can display results to stdout or directly deploy artifacts to Kubernetes/OpenShift.