To make `kompose up` & `kompose convert` equal in feature, This PR will
add `--controller` flag for `kompose up` as well as `kompose down`
so that user experience will be the same for `up` & `convert`
Resolves#798
since we are adding `--controller` to `up` and `down`, So respective code to deploy and undeploy also being added for `daemonset` and `replicationcontroller`
Added tests for `--controller`
Updated `sirupsen`, `docker/cli`, `docker/libcompose` in `glide`,
Also changed `Sirupsen` with `sirupsen` in all kompose packages as well as in
`docker/distribution` packages
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
Previously we used to mention controller type as `--deployment`,
`--replication-controller` or `--daemonset` as argument.
But now,
it will be like,
ex.
```
kompose convert --controller=daemonset
```
This adds the --volumes paramater with a "generate" and "empty"
By default, "generate" will be used as a place-holder for "true".
Although not used in the code, we will eventually add "none"
This uses CLI paramater naming processes (no emptyVols as that is Go /
Kubernetes specific) and thus we use dashes.
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.
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.
This commit Add support for cap_add & cap_drop which maps to
Pod.Spec.Container.SecurityContext.Capabilities.Add/Drop
Added unit tests for ConfigCapabilities function
Updated conversion.md on support for these keys
Now we can deploy application in different namespaces using the "--namespace=<value>" flag with kompose up and kompose down. The --namepace flag will deploy the application in that particular "namespace" if exist."
fixes#270
all errors in undeploy method(both kubernetes and openshift) are appended in a slice of errors,
and then it will be returned after successful deletion of all components.
Now we can provide service name with "_" in docker-compose files and they will by converted as "-" in the generated artifacts by kompose eg, if the service name in docker-compose file is "foo_bar" then it will be converted into "foo-bar" in the generated artifacts
fixes#270
all errors in undeploy method(both kubernetes and openshift) are appended in a slice of errors,
and then it will be returned after successful deletion of all components.
This PR uses the "SelectorFromSet()" function which takes alabel or
selector as an argument returns all the object that uses that label or
selector. Once we get the object that uses a particular label we can
further do the delete operation on them. This is similar to "kubectl
delete <object> --selector=<key>=<value>". Also the label has been
modified from service to io.kompose.service.
fixes#436
This commit will add support for tmpfs, configEmptyVolumeSource
function is being modified as it have to work in two ways now.
(For emptyvols and tmpfs)
Added unit test for tmpfs too.
This commit refactors the code to remove more or less
all occurences of logrus.Fatalf() from the code under
pkg/ except for app.go where all the errors are being
handled currently.
This is being done since random logrus.Fatalf() calls
all around the code was making handling the errors,
unit testing and troubleshooting a bit more painful.
logrus.Fatalf() calls are either replaced by
return errors.New("new error")
or
return errors.Wrap(err, "annonate error")
calls, and the function signatures are accordingly
changed to accomodate the new return values.
The unit tests which previously used to check
if logrus.Fatalf() calls worked fine have also
been fixed to only check for errors now.
Fixes#416
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
If TCP is passed in as the protocol, by default, we add TCP as the
protocol within the Kubernetes or OpenShift artifacts.
By default, TCP is already selected within Kubernetes and thus having
the TCP output is redundant.
This commit checks to see if TCP has already been selected, and if it
has, ignores adding it to the list of ports.
Closes https://github.com/kubernetes-incubator/kompose/issues/392
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.
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.
This is so you can set Opts on instance creation of
kubernetes.Kubernetes and openshift.Openshift. This is useful
so that we can pass option information arround without having
to do it on the call stack every time.
Now a user can provide volumes_from to share volumes
from other service so here the PVC created for that
service will be shared by service calling volumes_from
Sorts objects in Transform function, this should
make sure that Services are first everywhere as
long as we keep order in the slice that Transform returns.
fixes#130
The repated controller creation code has been removed. And
aggregated it into a single function, that Kubernetes and OpenShift
providers' Transform code can call.