Commit Graph

64 Commits

Author SHA1 Message Date
Charlie Drage
bd6d493cef Add deploy: mode: global support
Adds support for deploy: mode.

For example:

```yaml
version: "3"

services:
  foo:
    deploy:
      resources:
        mode: global
        replicas: 6
    image: redis
```

Will only generate replicas: 1 in Kubernetes pods as "global" limits
replicas to only one.
2017-08-23 12:47:27 -04:00
Suraj Narwade
ec5c4d8550 Adding save command to annotation
This command will add `kompose command` used to generate artifacts as well as `kompose version`,
for ex,

```
metadata:
    annotations:
      kompose.cmd: kompose convert -f /home/snarwade --stdout
      kompose.version: 1.0.0 (HEAD)
```

For functional test, Now each test has template like,

```
 "annotations": {
           "kompose.cmd": "%CMD%",
           "kompose.version": "%VERSION%"
```

Because, for every machine these values will be different.

Updated functional test with new annotations
2017-08-14 12:22:33 +05:30
Suraj Narwade
641f8f8932 Added support for group_add key
This PR will add support for `group_add` key which will map to
supplemental group in pod security context.
2017-08-10 11:54:35 +05:30
Charlie Drage
af26b797a2 Add CPU limit, CPU Reservation and Memory Reservation
This adds support for CPU limit, CPU reservation as well as memory
reservation.

Specifically, when using the `deploy` key in Docker Compose.
2017-08-03 09:41:14 -04:00
Suraj Narwade
d5a5f42d8b Handling Volume at early stage
It will resolve #544 as well as refactor volume handling part.
2017-07-26 19:59:05 +05:30
Charlie Drage
ce32bb817d 2016 -> 2017 for licensing
New year, update to the license.
2017-06-28 10:49:52 -04:00
Charlie Drage
cf39f78435 Merge pull request #653 from cdrage/remove-dab
Disable dab
2017-06-21 07:39:59 -04:00
Tomas Kral
ef8c7a7a0a
fix env substitution for docker compose v3 2017-06-20 15:16:12 +02:00
Charlie Drage
b8a46895a6 Disable DAB
See issue: https://github.com/kubernetes-incubator/kompose/issues/390

Disable DAB as it is hard to maintain / not much usage / DAB is still
experimental in Docker and there hasn't been much movement:
https://github.com/moby/moby/issues/26876

MarkDeprecated does not work at the moment due to issue:
https://github.com/kubernetes-incubator/kompose/issues/652

However, that is not a blocker as we `fatalF` within `ValidateFlags`
2017-06-20 09:02:53 -04:00
Charlie Drage
ee7961216f Merge pull request #603 from procrypt/error_with_volume_name
PVC name changes if volumes containes .(dot) in it
2017-06-19 09:39:59 -04:00
Suraj Deshmukh
f823a22e64 Merge pull request #590 from surajnarwade/label-fix
Failing when port is specified with labels
2017-06-15 14:56:30 +05:30
Suraj Narwade
209cda28d2 Failing when port is specified with labels
Resolves #522
Kompose will give FATAL error if labels are given but ports are not defined
2017-06-15 09:30:01 +05:30
Charlie Drage
e2f9084003 Adds both build and push support
This adds support for building and pushing docker containers
when you perform either `kompose convert` or `kompose up`.

Docker Compose files who have build parameters with their respective
image and build keys will automatically be both built and pushed.
2017-06-14 10:19:12 -04:00
Abhishek
c40bb4bb3a change volume name with generated deployment file
if volumes in docker file is defined as
      volumes:
        - .:/code
    Then the PVC created by kompose will containes .(dot) in it.
       .-persistentvolumeclaim.yaml
2017-06-14 14:31:07 +05:30
Charlie Drage
2b58307191 Add v3 support
This does a major refactor on the compose.go functions as well as brings
in a new era of v3 support to Kompose.

Similar to how we utilize libcompose, we utilize docker/cli's "stack
deploy" code which has a built-in v3 parser. We convert the parsed
structure to our own and then convert it to Kubernetes/OpenShift
artifacts.
2017-06-13 09:44:48 -04:00
Suraj Narwade
581e181967 Validate dockerfilepath in buildconfig
This PR will resolve #594 by validating dockerfilepath based on whether
it is relative path or not.
2017-05-30 16:31:20 +05:30
Suraj Deshmukh
1c64b016dc Merge pull request #592 from cdrage/change-git-command
Use old git command
2017-05-18 09:12:09 +05:30
Suraj Narwade
8fc262bd99 Add build_args support in buildconfig
now args provided under build in docker-compose file can be available in buildconfig.
it solves #406
Added unit test and functional test
solves #445
Separated key:"value" pairs by spaces
2017-05-16 12:19:00 +05:30
Charlie Drage
f0c4addbaf Use old git command
Some versions of git don't have git-url (case in point on Debian 8, no
get-url on packaged git).

Use old command in getting URL.
2017-05-09 08:55:55 -04:00
Suraj Narwade
aacde86eb9 Fixes fixture test for build context
Resolves #576

This PR includes `output-os-template.json` in `nginx-node-redis` example,
which is basically output template contains `%URI%` and `%REF%` variables
which will be filled while initializing test cases and new will be stored as
`/tmp/output-os.json`
This will remove the problem of git uri and ref.
2017-05-08 17:54:24 +05:30
Suraj Narwade
605d643a84 Adding code for consistent build context
fixes #445

This PR was partially fixed by docker/libcompose#450, which now gives consistent build context,
also it modifies the function getAbsBuildContext to create accurate build context, Unit test are being modified
according to new structure.
2017-04-27 21:38:38 +05:30
Tuna
65c9cf9bd8 Merge pull request #557 from procrypt/driver_local
fix driver:local in prefixing volumes with current dir name
2017-04-27 15:25:50 +07:00
Abhishek
7eccb37c19 fix driver:local in prefixing volumes
If we have a docker-file with root level volumes and we do a kompose up
using that docker-file, libcompose will add an additional _ followed by
the current directory name. Since kubernetes doesn't allow _ in the
objects created so kompose up will fail to deploy it. As a solution we
replace _ to - and we can then deploy it successfully.
2017-04-26 20:14:22 +05:30
Abhishek
ec85012a8c typo in nginx name 2017-04-25 11:14:35 +05:30
Charlie Drage
ee44a2630f Move docker-compose.yml test file to tests
Moves a file that was incorrectly being used from examples to
script/test/fixtures.
2017-04-04 09:09:12 -04:00
Suraj Narwade
df014bebd6 Fixed functional tests
Fixes #431

fixed commands where output showing `command not found` and k8s output
added for restart-options example.
2017-03-30 15:06:57 +05:30
Charlie Drage
858314e06b Adds mem_limit support for conversion
This commit adds mem_limit support. Taking the value from
docker-compose.yaml and converting it to it's associative value in
Kubernetes artifacts.

Closes (half) of
https://github.com/kubernetes-incubator/kompose/issues/267
2017-02-22 08:19:27 -05:00
Charlie Drage
438088f37d Add support for host:port:port
This adds support for supplying for example:
"127.0.0.1:80:80/tcp" to docker-compose.yaml and converting it to it's
corresponding Kubernetes / OpenShift hostIP.

This commit also refactors the loadPorts function of compose.go

Closes https://github.com/kubernetes-incubator/kompose/issues/335
2017-02-09 12:21:17 -05:00
Charlie Drage
8bf06407ba Merge pull request #368 from procrypt/yaml_and_yml
added support for docker-compose.yaml besides docker-compose.yml
2017-01-30 09:21:33 -05:00
Abhishek
1ecd32a362 error out if controller object is specified with "restart: on-failure" 2017-01-30 17:52:36 +05:30
Tomas Kral
90febe7f7f
Change warning to debug for services without ports. 2017-01-25 13:20:40 +01:00
sebgoa
3193ac3bd7
Handle Headless Services when no ports are present 2017-01-25 11:28:29 +01:00
Abhishek
96a0572f50 added support for docker-compose.yaml besides docker-compose.yml 2017-01-23 13:30:33 +05:30
Charlie Drage
bf6085dd02 Merge pull request #356 from cdrage/update-vendoring
Update vendoring as well as libcompose
2017-01-12 12:49:14 -05:00
Charlie Drage
15b482698a Uncomment test case for image handling 2017-01-12 08:14:41 -05:00
Suraj Deshmukh
26e348e731 Fixing functional tests for checking generated artifacts
Earlier any test written after check_file_exist would
fail, so fixed it with new function.
2017-01-06 00:35:00 +05:30
Abhishek
cfcbfa8c6d make default kompose conversion YAML 2017-01-04 12:50:56 +05:30
Abhishek
a5a3805760 added support for multiple-compose files 2017-01-03 17:18:34 +05:30
Ratnadeep Debnath
eb719f85c2 Fix tests for buildconfig support. 2016-12-28 17:00:33 +05:30
Shubham Minglani
6a151c6267 add stdin_open, tty support, add tests, fix #344
This adds supports for stdin_open: bool and
tty: bool support for kubernetes and openshift
providers in kompose. This maps to the
template.Spec.Containers[0].Stdin and
template.Spec.Containers[0].TTY in Kubernets
world.

Also, added tests.

Fixes #344
2016-12-28 15:58:45 +05:30
Shubham Minglani
7e378cd546 implement expose service, add tests, fix #140
Implements a kompose specific docker compose label "kompose.service.expose" which can be used to expose the specified services externally. The accepted values are of type string.
If the value is set to "true", the provider sets the endpoint automatically, and for any other value, the value is set as the hostname. If multiple ports are defined in a service, the first one is chosen to be the exposed.

Unit tests, functional tests, glide updates and docs have also been added in this commit for the related feature.
2016-12-21 20:00:38 +05:30
Suraj Deshmukh
48e3ba88cd Merge pull request #324 from rtnpro/unsupported-keys-per-provider
Unsupported keys per provider
2016-12-21 19:08:42 +05:30
Shubham Minglani
365fe81987 implement storing to dir/file, add tests
When kompose convert -o artifacts is run, then if artifacts is a directory,
kompose stores all the resulting files inside it, and if it's not a directory,
it stores the artifacts in a single file.

Fixes #209
2016-12-21 18:12:43 +05:30
Tomas Kral
841141ad64 Fix functional tests for unsupported keys 2016-12-20 12:21:53 +05:30
Tuna
a881f5cca0 add test for key-only env 2016-12-19 11:23:42 +01:00
Suraj Deshmukh
6ea5f72e40 support for raw pod output
if a user specifies a docker-compose service
with restart value as "no" or "on-failure"
then normal pod will be created as against
to a controller and a pod.
2016-12-13 19:24:25 +05:30
sebgoa
00331589a3 Fix license headers, This closes #223 2016-11-01 15:01:27 +01:00
Christopher A. Baumbauer
1b3f71c55f Add tests converting dab files 2016-10-26 21:47:51 -07:00
Tomas Kral
414645d73c Merge pull request #211 from procrypt/unknown_args
remove unknown args and added tests
2016-10-26 14:37:08 +02:00
Suraj Deshmukh
b068c5cf81 Merge pull request #190 from surajssd/support-volumes-from
support for volumes_from docker-compose construct
2016-10-23 21:40:14 +05:30