Commit Graph

54 Commits

Author SHA1 Message Date
João Vitor Paes de Barros do Carmo
0036f0c32b
Add readiness healthcheck generation by label (#1366) 2021-03-17 18:02:50 +08:00
namusyaka
8b06045c70
Support port range for docker-compose v2 (#1345)
* allow port range specification in v1v2

* improve tests for loadPorts

* add port range to fixtures of docker-compose v2

* update fixtures to follow up on #1341
2020-11-04 22:16:33 +08:00
Hang Yan
525b68f027
Go mod (#1305)
* Use go mod instead of glide
* Add `--with-kompose-annotation` flag to allow us to switch it off for tests
* Remove hostpid support (since the newest sdk does not support it)
* Create new test script and fixtures
* Remove replicationcontroller support
2020-08-07 17:25:52 +08:00
Jing Guo
8edc5f4d01
fix stop_grace_period in v3 (#1300) 2020-08-02 17:57:29 +08:00
Hang Yan
e7f05588bf
Support deploy update_config (#1232) 2020-01-05 19:30:41 +08:00
Hang Yan
4d864a9aab
Support deploy labels (#1231) 2020-01-05 11:35:32 +08:00
Hang Yan
05e9bf4fc8
Support config short syntax and fix old bugs (#1230) 2020-01-05 10:19:22 +08:00
Hang Yan
fe4301192a
Refactor code and fix build (#1228) 2020-01-04 17:17:14 +08:00
Hang Yan
1089a26844
Support port expose (#1227) 2020-01-04 14:15:10 +08:00
Chander G
5732a555cb Concat and merge service fields when merging compose files (#1186) (#1226)
according to docker compose specs, certain fields are merged and
certain others are concatented
2020-01-03 23:17:29 +08:00
Hang Yan
25337eb82c
Fix v3 hostpath path concatenate error (#1222) 2019-12-28 18:40:36 +08:00
Hang Yan
34b827c97e
Support use configmap as volume (#1216) 2019-12-28 01:02:27 +08:00
Hang Yan
d2d0d61cf2
Merge will include deploy resources (#1214) 2019-12-27 13:51:11 +08:00
Hang Yan
1f0a097836
Support assign nodeport port in labels (#1210) 2019-12-26 23:45:58 +08:00
João Vitor Paes de Barros do Carmo
30736a3973 Add support for file based secret (#1159)
* Support file based secret
* Fix issue about read-only volume path and add support to absolute path at long-syntax
2019-12-01 12:05:31 +08:00
Mudit Verma
ac2b852955 Network Key Translation Feature and test cases (#1195) 2019-12-01 10:19:23 +08:00
Chander G
5857252c3d Merge top level non-service keys (#1187)
* merge top level non-service keys

docker-compose default behaviour is to merge these top level keys such
as `networks`
2019-11-28 14:18:49 +08:00
Hang Yan
fb7a92ca5e Fix placement parser panic (#1121) 2019-04-04 15:31:06 -04:00
Kamil Kieliszczyk
66ac4aff4f Add kompose.image-pull-secret and kompose.image-pull-policy (#1091)
* Add kompose.image-pull-secret

* Add kompose.image-pull-secret tests

* Add kompose.image-pull-policy

* Add kompose.image-pull-policy tests

* ignore .coverprofile

* Fix typo
2019-02-07 09:50:53 -05:00
huikaihoo
40c1b8cf87 Support multiple hostnames on expose label in service for Kubernetes (#1092)
* Support multiple hostnames on label (kompose.service.expose) separated by semicolon (;)

* Multiple hostnames on expose label separated by comma; Ignore leading / trailing spaces and repeated commas; Updated test cases and documents.
2019-01-31 09:34:04 -05:00
huikaihoo
d48ae64325 Add label support to named volumes in docker compose v3 to Kubernetes (#1083)
* Support read specific label (kompose.volume.size) from named volume and apply to kubernetes supported volume size

* Fix the PVC size in log message when deploy Kubernetes

* Skip creation of PersistentVolumeClaim if it is already created in the same kubernetes deploy

* Add selector to PersistentVolumeClaim only when specific label (kompose.volume.selector) is used in named volume

* Add test case to named-volume for the new labels
2018-11-29 12:07:17 -05:00
Hang Yan
b8aada8f33
Merge pull request #1061 from hangyan/fix/stdin
Support read data from stdin
2018-10-02 10:33:47 +08:00
Roberto C. Morano
424f1a9a2c Propagate dots into valid service names (#1063)
* normalize '.' (dot) to '-' (dash) in service names

* added warning about the dot character replacements in service names

* fix gofmt compliance

* also normalize container names (need lowercase)

* splitted normalization for volumes and service names into different functions (it conflicted with './' volumes replacement)

* changed volume normalization to use the new own normalization function

* changed container normalization to use its new own normalization function

* updated as per discussed in PR #1063 review
2018-09-28 20:20:01 +08:00
Hang Yan
a012fba1c2 Support read data from stdin 2018-08-09 22:46:41 +08:00
Xianlu Bird
0252213efb Add support for Config, endpoint_mode and 3.3 support (#994)
* Add support for Config

* Add deployment endpoint_mode support

* Add docker compose 3.3 support

* Add compose v3.3 support for openshift
2018-08-01 15:09:00 -04:00
João Vitor Paes de Barros do Carmo
e9dab2781a Unit Test added to Placement Constraints Custom Labels 2018-07-04 17:35:56 -04:00
João Vitor Paes de Barros do Carmo
e2ed3a95b7 support node.labels at placement 2018-06-20 18:26:44 -04:00
xianlubird
04e9ee9949 Fix missing attribute when convert with multiple docker-compose files
Signed-off-by: xianlubird <xianlubird@gmail.com>
2018-05-03 11:51:55 +08:00
Hang Yan
88b8e316b9 Support hostname and domainname 2018-03-31 12:00:37 +08:00
Hang Yan
6e5b6a3055 Fix deploy resources parse error 2018-03-15 14:00:17 +08:00
Charlie Drage
a5a113d042
Merge pull request #950 from hangyan/support-old-restart-policy
Support old restart policy in compose v3
2018-03-07 08:41:46 -05:00
Hang Yan
723bd0f9d8 Support old restart policy in compose v3 2018-03-07 13:35:36 +08:00
Hang Yan
ea8b373105 Fix broken links for volume in comments 2018-03-03 19:25:39 +08:00
Hang Yan
a1090ecbf9 Refactor label names to const strings 2018-02-25 14:32:00 +08:00
Hang Yan
b8f1707d30 Fix healthcheck parser nil pointer error 2018-02-09 11:10:03 +08:00
Hang Yan
0ef015d3da Fix unset env bug for v3 compose 2018-02-08 15:12:16 +08:00
Oliver Bristow
35a782024d Add kompose.service.expose.tls-secret 2017-12-18 15:56:38 +00:00
Charlie Drage
84be7400a2
Merge pull request #846 from surajnarwade/buildv3
Added support for build key in v3
2017-11-30 09:06:32 -05:00
Suraj Narwade
5de4aa85f8 Added sirupsen and updated all occurances
Updated `sirupsen`, `docker/cli`, `docker/libcompose` in `glide`,
Also changed `Sirupsen` with `sirupsen` in all kompose packages as well as in
`docker/distribution` packages
2017-11-27 12:28:46 +05:30
Anatoli Babenia
1975c32740 Set service volume size with kompose.volume.size label (#235)
1. Copy labels from compose to kobject
2. If kompose.volume.size is set on service level, use it

Internal API changes:

- Add PVCSize to kobject Volumes struct
- Pass default volume size as CreatePVC() param
2017-11-12 13:05:55 +03:00
Suraj Narwade
c7d6bc63d9 Added support for build key in v3
Resolves #636

This PR will add support for `build` in docker compose v3.
As https://github.com/docker/cli/pull/481 got merged now
2017-10-25 14:38:08 +05:30
Charlie Drage
f4bfe1fcb5 Add env_file + ConfigMaps feature to Kompose
When using env_file with Docker Compose, a ConfigMap will be generated

For example:

```sh
▶ ./kompose convert -f
script/test/fixtures/configmaps/docker-compose.yml
INFO Kubernetes file "redis-service.yaml" created
INFO Kubernetes file "redis-deployment.yaml" created
INFO Kubernetes file "foo-env-configmap.yaml" created
INFO Kubernetes file "bar-env-configmap.yaml" created
```

File:

```yaml
version: '3'

services:
  redis:
    image: 'bitnami/redis:latest'
    environment:
      - ALLOW_EMPTY_PASSWORD=no
    # Env file will override environment / warn!
    env_file:
      - "foo.env"
      - bar.env
    labels:
      kompose.service.type: nodeport
    ports:
      - '6379:6379'
```

To:

```yaml
apiVersion: v1
data:
  ALLOW_EMPTY_PASSWORD: "yes"
kind: ConfigMap
metadata:
  creationTimestamp: null
  name: foo-env
```

```yaml
...
      - env:
        - name: ALLOW_EMPTY_PASSWORD
          valueFrom:
            configMapKeyRef:
              key: ALLOW_EMPTY_PASSWORD
              name: foo-env
```
2017-10-10 12:40:49 -04:00
Suraj Narwade
35198cca12 Added feature for placement key in v3
it will map `engine.labels.operatingsystem` to `beta.kubernetes.io/os` and
`node.hostname` to `kubernetes.io/hostname` and all other constraints will not be supported.
2017-10-06 12:22:14 +05:30
Charlie Drage
2e99b8fd3a Adds healthcheck
This PR adds support for HealthCheck, being able to supply, for example:

```yaml
version: "3"

services:
  redis:
    image: redis
    healthcheck:
      test: echo "hello world"
      interval: 10s
      timeout: 1s
      retries: 5
```

Which is then converted to:

```yaml
spec:
  containers:
  - image: redis
    livenessProbe:
      exec:
        command:
        - echo "hello world"
      failureThreshold: 5
      periodSeconds: 10
      timeoutSeconds: 1
    name: redis
    resources: {}
  restartPolicy: Always
```

At the moment, this only supports livenessProbe, with support for readinessProbe in the future.
2017-08-25 10:02:51 -04:00
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
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
787b7d9261 kubernetes-incubator -> kubernetes
Today, we graduate from the incubator, thus all links are updates from
kubernetes-incubator to kubernetes
2017-07-12 15:42:13 -04:00
Charlie Drage
b8d64ea336 Merge pull request #677 from cdrage/its-2017
2016 -> 2017 for licensing
2017-07-07 10:10:02 -04:00
Suraj Narwade
9dcb2bfba6 added support for restart-policy keys in v3
Resolves `restart_policy` from issue #644
2017-07-06 17:44:19 +05:30