forked from LaconicNetwork/kompose
Fixes typos (#1557)
* rebase * undo commit to assets/**/* * undo commit in script/test/* * Apply suggestions from code review Co-authored-by: AhmedGrati <48932084+AhmedGrati@users.noreply.github.com> * removes webrick --------- Co-authored-by: AhmedGrati <48932084+AhmedGrati@users.noreply.github.com>
This commit is contained in:
co-authored by
AhmedGrati
parent
b3d4aec3ee
commit
35a430614f
@@ -29,3 +29,4 @@ end
|
||||
gem "wdm", "~> 0.1.1", :install_if => Gem.win_platform?
|
||||
|
||||
gem "jekyll-redirect-from"
|
||||
|
||||
|
||||
+15
-15
@@ -1,10 +1,10 @@
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
addressable (2.8.0)
|
||||
public_suffix (>= 2.0.2, < 5.0)
|
||||
addressable (2.8.1)
|
||||
public_suffix (>= 2.0.2, < 6.0)
|
||||
colorator (1.1.0)
|
||||
concurrent-ruby (1.1.9)
|
||||
concurrent-ruby (1.1.10)
|
||||
em-websocket (0.5.3)
|
||||
eventmachine (>= 0.12.9)
|
||||
http_parser.rb (~> 0)
|
||||
@@ -12,7 +12,7 @@ GEM
|
||||
ffi (1.15.5)
|
||||
forwardable-extended (2.6.0)
|
||||
http_parser.rb (0.8.0)
|
||||
i18n (1.8.11)
|
||||
i18n (1.12.0)
|
||||
concurrent-ruby (~> 1.0)
|
||||
jekyll (4.0.1)
|
||||
addressable (~> 2.4)
|
||||
@@ -29,22 +29,22 @@ GEM
|
||||
rouge (~> 3.0)
|
||||
safe_yaml (~> 1.0)
|
||||
terminal-table (~> 1.8)
|
||||
jekyll-feed (0.16.0)
|
||||
jekyll-feed (0.17.0)
|
||||
jekyll (>= 3.7, < 5.0)
|
||||
jekyll-redirect-from (0.16.0)
|
||||
jekyll (>= 3.3, < 5.0)
|
||||
jekyll-sass-converter (2.1.0)
|
||||
jekyll-sass-converter (2.2.0)
|
||||
sassc (> 2.0.1, < 3.0)
|
||||
jekyll-seo-tag (2.7.1)
|
||||
jekyll-seo-tag (2.8.0)
|
||||
jekyll (>= 3.8, < 5.0)
|
||||
jekyll-watch (2.2.1)
|
||||
listen (~> 3.0)
|
||||
kramdown (2.3.1)
|
||||
kramdown (2.4.0)
|
||||
rexml
|
||||
kramdown-parser-gfm (1.1.0)
|
||||
kramdown (~> 2.0)
|
||||
liquid (4.0.3)
|
||||
listen (3.7.0)
|
||||
liquid (4.0.4)
|
||||
listen (3.8.0)
|
||||
rb-fsevent (~> 0.10, >= 0.10.3)
|
||||
rb-inotify (~> 0.9, >= 0.9.10)
|
||||
mercenary (0.3.6)
|
||||
@@ -54,12 +54,12 @@ GEM
|
||||
jekyll-seo-tag (~> 2.1)
|
||||
pathutil (0.16.2)
|
||||
forwardable-extended (~> 2.6)
|
||||
public_suffix (4.0.6)
|
||||
rb-fsevent (0.11.0)
|
||||
public_suffix (5.0.1)
|
||||
rb-fsevent (0.11.2)
|
||||
rb-inotify (0.10.1)
|
||||
ffi (~> 1.0)
|
||||
rexml (3.2.5)
|
||||
rouge (3.27.0)
|
||||
rouge (3.30.0)
|
||||
safe_yaml (1.0.5)
|
||||
sassc (2.4.0)
|
||||
ffi (~> 1.9)
|
||||
@@ -68,7 +68,7 @@ GEM
|
||||
thread_safe (0.3.6)
|
||||
tzinfo (1.2.10)
|
||||
thread_safe (~> 0.1)
|
||||
tzinfo-data (1.2021.5)
|
||||
tzinfo-data (1.2022.7)
|
||||
tzinfo (>= 1.0.0)
|
||||
unicode-display_width (1.8.0)
|
||||
wdm (0.1.1)
|
||||
@@ -86,4 +86,4 @@ DEPENDENCIES
|
||||
wdm (~> 0.1.1)
|
||||
|
||||
BUNDLED WITH
|
||||
2.1.4
|
||||
2.4.4
|
||||
|
||||
+36
-37
@@ -2,36 +2,35 @@
|
||||
layout: default
|
||||
permalink: /architecture/
|
||||
title: Architecture
|
||||
redirect_from:
|
||||
redirect_from:
|
||||
- /docs/architecture.md/
|
||||
- /docs/architecture/
|
||||
---
|
||||
|
||||
# Architecture and Internal Design
|
||||
|
||||
* TOC
|
||||
{:toc}
|
||||
- TOC
|
||||
|
||||
`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
|
||||
|
||||
Loader reads input file (now `kompose` supports [Docker Compose](https://docs.docker.com/compose) v1, v2 and converts it to KomposeObject.
|
||||
The Loader reads the input file now `kompose` supports [Docker 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). 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:
|
||||
|
||||
* [kompose/pkg/loader](https://github.com/kubernetes/kompose/tree/master/pkg/loader)
|
||||
* [kompose/pkg/loader/compose](https://github.com/kubernetes/kompose/tree/master/pkg/loader/compose)
|
||||
- [kompose/pkg/loader](https://github.com/kubernetes/kompose/tree/master/pkg/loader)
|
||||
- [kompose/pkg/loader/compose](https://github.com/kubernetes/kompose/tree/master/pkg/loader/compose)
|
||||
|
||||
## KomposeObject
|
||||
|
||||
@@ -40,38 +39,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 {
|
||||
@@ -79,12 +78,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:
|
||||
|
||||
* [kompose/pkg/transformer](https://github.com/kubernetes/kompose/tree/master/pkg/transformer)
|
||||
* [kompose/pkg/transformer/kubernetes](https://github.com/kubernetes/kompose/tree/master/pkg/transformer/kubernetes)
|
||||
* [kompose/pkg/transformer/openshift](https://github.com/kubernetes/kompose/tree/master/pkg/transformer/openshift)
|
||||
- [kompose/pkg/transformer](https://github.com/kubernetes/kompose/tree/master/pkg/transformer)
|
||||
- [kompose/pkg/transformer/Kubernetes](https://github.com/kubernetes/kompose/tree/master/pkg/transformer/kubernetes)
|
||||
- [kompose/pkg/transformer/openshift](https://github.com/kubernetes/kompose/tree/master/pkg/transformer/openshift)
|
||||
|
||||
## Outputter
|
||||
|
||||
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.
|
||||
|
||||
+21
-21
@@ -9,8 +9,8 @@ redirect_from:
|
||||
|
||||
# Conversion Matrix
|
||||
|
||||
* TOC
|
||||
{:toc}
|
||||
- TOC
|
||||
{:toc}
|
||||
|
||||
This document outlines all possible conversion details regarding `docker-compose.yaml` values to Kubernetes / OpenShift artifacts.
|
||||
|
||||
@@ -21,23 +21,23 @@ We're doing our best to keep it up to date as soon as possible in our releases t
|
||||
|
||||
## Conversion Table
|
||||
|
||||
__Glossary:__
|
||||
**Glossary:**
|
||||
|
||||
- __✓:__ Converts
|
||||
- __-:__ Not in this Docker Compose Version
|
||||
- __n:__ Not yet implemented
|
||||
- __x:__ Not applicable / no 1-1 conversion
|
||||
- **✓:** Converts
|
||||
- **-:** Not in this Docker Compose Version
|
||||
- **n:** Not yet implemented
|
||||
- **x:** Not applicable / no 1-1 conversion
|
||||
|
||||
| Keys | V1 | V2 | V3 | Kubernetes / OpenShift | Notes |
|
||||
|------------------------|----|----|----|----------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|
|
||||
| ---------------------- | -- | -- | -- | -------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| build | ✓ | ✓ | ✓ | | Builds/Pushes to Docker repository. See [user guide on build and push image](https://kompose.io/user-guide/#build-and-push-image) |
|
||||
| build: context | ✓ | ✓ | ✓ | | |
|
||||
| build: dockerfile | ✓ | ✓ | ✓ | | |
|
||||
| build: args | n | n | n | | |
|
||||
| build: cache_from | - | - | n | | |
|
||||
| cap_add | ✓ | ✓ | ✓ | Container.SecurityContext.Capabilities.Add | |
|
||||
| cap_drop | ✓ | ✓ | ✓ | Container.SecurityContext.Capabilities.Drop | |
|
||||
| command | ✓ | ✓ | ✓ | Container.Args | |
|
||||
| cap_add | ✓ | ✓ | ✓ | Container.SecurityContext.Capabilities.Add | |
|
||||
| cap_drop | ✓ | ✓ | ✓ | Container.SecurityContext.Capabilities.Drop | |
|
||||
| command | ✓ | ✓ | ✓ | Container.Args | |
|
||||
| configs | n | n | ✓ | | |
|
||||
| configs: short-syntax | n | n | ✓ | | Only create configMap |
|
||||
| configs: long-syntax | n | n | ✓ | | If target path is /, ignore this and only create configMap |
|
||||
@@ -47,7 +47,7 @@ __Glossary:__
|
||||
| deploy | - | - | ✓ | | |
|
||||
| deploy: mode | - | - | ✓ | | |
|
||||
| deploy: replicas | - | - | ✓ | Deployment.Spec.Replicas / DeploymentConfig.Spec.Replicas | |
|
||||
| deploy: placement | - | - | ✓ | Affinity | |
|
||||
| deploy: placement | - | - | ✓ | Affinity | |
|
||||
| deploy: update_config | - | - | ✓ | Workload.Spec.Strategy | Deployment / DeploymentConfig |
|
||||
| deploy: resources | - | - | ✓ | Containers.Resources.Limits.Memory / Containers.Resources.Limits.CPU | Support for memory as well as cpu |
|
||||
| deploy: restart_policy | - | - | ✓ | Pod generation | This generated a Pod, see the [user guide on restart](http://kompose.io/user-guide/#restart) |
|
||||
@@ -56,11 +56,11 @@ __Glossary:__
|
||||
| depends_on | x | x | x | | |
|
||||
| dns | x | x | x | | Not used within Kubernetes. Kubernetes uses a managed DNS server |
|
||||
| dns_search | x | x | x | | See `dns` key |
|
||||
| domainname | ✓ | ✓ | ✓ | SubDomain | |
|
||||
| tmpfs | ✓ | ✓ | ✓ | Containers.Volumes.EmptyDir | Creates emptyDirvolume with medium set to Memory & mounts given directory inside container |
|
||||
| entrypoint | ✓ | ✓ | ✓ | Container.Command | |
|
||||
| domainname | ✓ | ✓ | ✓ | SubDomain | |
|
||||
| tmpfs | ✓ | ✓ | ✓ | Containers.Volumes.EmptyDir | Creates emptyDirvolume with medium set to Memory & mounts given directory inside container |
|
||||
| entrypoint | ✓ | ✓ | ✓ | Container.Command | |
|
||||
| env_file | n | n | ✓ | | |
|
||||
| environment | ✓ | ✓ | ✓ | Container.Env | |
|
||||
| environment | ✓ | ✓ | ✓ | Container.Env | |
|
||||
| expose | ✓ | ✓ | ✓ | Service.Spec.Ports | |
|
||||
| endpoint_mode | n | n | ✓ | | If endpoint_mode=vip, the created Service will be forced to set to NodePort type |
|
||||
| extends | ✓ | ✓ | ✓ | | Extends by utilizing the same image supplied |
|
||||
@@ -68,7 +68,7 @@ __Glossary:__
|
||||
| extra_hosts | n | n | n | | |
|
||||
| group_add | ✓ | ✓ | ✓ | | |
|
||||
| healthcheck | - | n | ✓ | | |
|
||||
| hostname | ✓ | ✓ | ✓ | HostName | |
|
||||
| hostname | ✓ | ✓ | ✓ | HostName | |
|
||||
| image | ✓ | ✓ | ✓ | Deployment.Spec.Containers.Image | |
|
||||
| isolation | x | x | x | | Not applicable as this applies to Windows with HyperV support |
|
||||
| labels | ✓ | ✓ | ✓ | Metadata.Annotations | |
|
||||
@@ -78,7 +78,7 @@ __Glossary:__
|
||||
| networks | ✓ | ✓ | ✓ | | See `networks` key |
|
||||
| networks: aliases | x | x | x | | See `networks` key |
|
||||
| networks: addresses | x | x | x | | See `networks` key |
|
||||
| pid | ✓ | ✓ | ✓ | HostPID | |
|
||||
| pid | ✓ | ✓ | ✓ | HostPID | |
|
||||
| ports | ✓ | ✓ | ✓ | Service.Spec.Ports | |
|
||||
| ports: short-syntax | ✓ | ✓ | ✓ | Service.Spec.Ports | |
|
||||
| ports: long-syntax | - | - | ✓ | Service.Spec.Ports | |
|
||||
@@ -86,7 +86,7 @@ __Glossary:__
|
||||
| secrets: short-syntax | - | - | ✓ | Secret | External Secret is not Supported |
|
||||
| secrets: long-syntax | - | - | ✓ | Secret | External Secret is not Supported |
|
||||
| security_opt | x | x | x | | Kubernetes uses its own container naming scheme |
|
||||
| stop_grace_period | ✓ | ✓ | ✓ | TerminationGracePeriodSeconds | |
|
||||
| stop_grace_period | ✓ | ✓ | ✓ | TerminationGracePeriodSeconds | |
|
||||
| stop_signal | x | x | x | | Not supported within Kubernetes. See issue https://github.com/kubernetes/kubernetes/issues/30051 |
|
||||
| sysctls | n | n | n | | |
|
||||
| ulimits | x | x | x | | Not supported within Kubernetes. See issue https://github.com/kubernetes/kubernetes/issues/3595 |
|
||||
@@ -96,13 +96,13 @@ __Glossary:__
|
||||
| volumes: long-syntax | - | - | ✓ | PersistentVolumeClaim | Creates a PersistentVolumeClaim. Can only be created if there is already a PersistentVolume within the cluster |
|
||||
| restart | ✓ | ✓ | ✓ | | |
|
||||
| | | | | | |
|
||||
| __Volume__ | x | x | x | | |
|
||||
| **Volume** | x | x | x | | |
|
||||
| driver | x | x | x | | |
|
||||
| driver_opts | x | x | x | | |
|
||||
| external | x | x | x | | |
|
||||
| labels | x | x | x | | |
|
||||
| | | | | | |
|
||||
| __Network__ | x | x | x | | |
|
||||
| **Network** | x | x | x | | |
|
||||
| driver | x | x | x | | |
|
||||
| driver_opts | x | x | x | | |
|
||||
| enable_ipv6 | x | x | x | | |
|
||||
|
||||
+8
-6
@@ -14,6 +14,7 @@ redirect_from:
|
||||
Read about building kompose [here](https://github.com/kubernetes/kompose#building).
|
||||
|
||||
## Workflow
|
||||
|
||||
### Fork the main repository
|
||||
|
||||
1. Go to https://github.com/kubernetes/kompose
|
||||
@@ -21,7 +22,7 @@ Read about building kompose [here](https://github.com/kubernetes/kompose#buildin
|
||||
|
||||
### Clone your fork
|
||||
|
||||
The commands below require that you have $GOPATH. We highly recommended you put Kompose' code into your $GOPATH.
|
||||
The commands below require that you have `$GOPATH`. We highly recommended you put the Kompose code into your `$GOPATH`.
|
||||
|
||||
```console
|
||||
git clone https://github.com/$YOUR_GITHUB_USERNAME/kompose.git $GOPATH/src/github.com/kubernetes/kompose
|
||||
@@ -65,12 +66,13 @@ git push -f origin myfeature
|
||||
## Go Modules and dependency management
|
||||
|
||||
Kompose uses [Go Modules](https://github.com/golang/go/wiki/Modules) to manage dependencies.
|
||||
If you want to make changes to dependencies please make sure that `go.mod` and `go.sum` are updated properly.
|
||||
If you want to introduce changes to dependencies, please ensure that `go.mod` and `go.sum` are updated properly.
|
||||
|
||||
##### Updating Kubernetes and OpenShift
|
||||
|
||||
Kubernetes version depends on what version is OpenShift using.
|
||||
OpenShift is using forked Kubernetes to carry some patches.
|
||||
Currently it is not possible to use different Kubernetes version from version that OpenShift uses.
|
||||
Currently, it is not possible to use a different Kubernetes version from the version that OpenShift uses.
|
||||
(for more see comments in `go.mod`)
|
||||
|
||||
### Adding CLI tests
|
||||
@@ -83,6 +85,6 @@ To generate CLI tests, please run `make gen-cmd`.
|
||||
|
||||
For Kompose, we use numerous CI's:
|
||||
|
||||
- [TravisCI](https://travis-ci.org/kubernetes/kompose): Unit and CLI tests
|
||||
- [SemaphoreCI](https://semaphoreci.com/cdrage/kompose-2): Integration / cluster tests
|
||||
- [Fabric8CI](http://jenkins.cd.k8s.fabric8.io/): Secondary integration tests / future cluster tests
|
||||
- [TravisCI](https://travis-ci.org/kubernetes/kompose): Unit and CLI tests
|
||||
- [SemaphoreCI](https://semaphoreci.com/cdrage/kompose-2): Integration / cluster tests
|
||||
- [Fabric8CI](http://jenkins.cd.k8s.fabric8.io/): Secondary integration tests / future cluster tests
|
||||
|
||||
+59
-58
@@ -2,15 +2,15 @@
|
||||
layout: default
|
||||
permalink: /getting-started/
|
||||
title: Getting Started
|
||||
redirect_from:
|
||||
redirect_from:
|
||||
- /docs/getting-started.md/
|
||||
- /docs/getting-started/
|
||||
---
|
||||
|
||||
# Getting Started
|
||||
|
||||
* TOC
|
||||
{:toc}
|
||||
- TOC
|
||||
{:toc}
|
||||
|
||||
This is how you'll get started with Kompose!
|
||||
|
||||
@@ -23,10 +23,11 @@ For beginners and the most compatibility, follow the _Minikube and Kompose_ guid
|
||||
In this guide, we'll deploy a sample `docker-compose.yaml` file to a Kubernetes cluster.
|
||||
|
||||
Requirements:
|
||||
- [minikube](https://github.com/kubernetes/minikube)
|
||||
- [kompose](https://github.com/kubernetes/kompose)
|
||||
|
||||
__Start `minikube`:__
|
||||
- [minikube](https://github.com/kubernetes/minikube)
|
||||
- [kompose](https://github.com/kubernetes/kompose)
|
||||
|
||||
**Start `minikube`:**
|
||||
|
||||
If you don't already have a Kubernetes cluster running, [minikube](https://github.com/kubernetes/minikube) is the best way to get started.
|
||||
|
||||
@@ -43,30 +44,29 @@ Starting cluster components...
|
||||
Kubectl is now configured to use the cluster
|
||||
```
|
||||
|
||||
__Download an [example Docker Compose file](https://raw.githubusercontent.com/kubernetes/kompose/master/examples/docker-compose.yaml), or use your own:__
|
||||
**Download an [example Docker Compose file](https://raw.githubusercontent.com/kubernetes/kompose/master/examples/docker-compose.yaml), or use your own:**
|
||||
|
||||
```sh
|
||||
wget https://raw.githubusercontent.com/kubernetes/kompose/master/examples/docker-compose.yaml
|
||||
```
|
||||
|
||||
__Convert your Docker Compose file to Kubernetes:__
|
||||
**Convert your Docker Compose file to Kubernetes:**
|
||||
|
||||
Run `kompose convert` in the same directory as your `docker-compose.yaml` file.
|
||||
|
||||
```sh
|
||||
$ kompose convert
|
||||
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
|
||||
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
|
||||
```
|
||||
|
||||
Then you can use `kubectl apply` to create these resources in kubernetes.
|
||||
Then you can use `kubectl apply` to create these resources in Kubernetes.
|
||||
|
||||
|
||||
__Access the newly deployed service:__
|
||||
**Access the newly deployed service:**
|
||||
|
||||
Now that your service has been deployed, let's access it.
|
||||
|
||||
@@ -92,7 +92,6 @@ NodePort: 80 31144/TCP
|
||||
Endpoints: 172.17.0.4:80
|
||||
Session Affinity: None
|
||||
No events.
|
||||
|
||||
```
|
||||
|
||||
Note: If you're using a cloud provider, your IP will be listed next to `LoadBalancer Ingress`.
|
||||
@@ -100,7 +99,7 @@ Note: If you're using a cloud provider, your IP will be listed next to `LoadBala
|
||||
If you have yet to expose your service (for example, within GCE), use the command:
|
||||
|
||||
```sh
|
||||
kubectl expose deployment frontend --type="LoadBalancer"
|
||||
kubectl expose deployment frontend --type="LoadBalancer"
|
||||
```
|
||||
|
||||
To check functionality, you may also `curl` the URL.
|
||||
@@ -114,15 +113,16 @@ $ curl http://123.45.67.89
|
||||
In this guide, we'll deploy a sample `docker-compose.yaml` file to an OpenShift cluster.
|
||||
|
||||
Requirements:
|
||||
- [minishift](https://github.com/minishift/minishift)
|
||||
- [kompose](https://github.com/kubernetes/kompose)
|
||||
- An OpenShift route created
|
||||
|
||||
__Note:__ The service will NOT be accessible until you create an OpenShift route with `oc expose`. You must also have a virtualization environment setup. By default, `minishift` uses KVM.
|
||||
- [minishift](https://github.com/minishift/minishift)
|
||||
- [kompose](https://github.com/kubernetes/kompose)
|
||||
- An OpenShift route created
|
||||
|
||||
__Start `minishift`:__
|
||||
**Note:** The service will NOT be accessible until you create an OpenShift route with `oc expose`. You must also have a virtualization environment setup. By default, `minishift` uses KVM.
|
||||
|
||||
[Minishift](https://github.com/minishift/minishift) is a tool that helps run OpenShift locally using a single-node cluster inside of a VM. Similar to [minikube](https://github.com/kubernetes/minikube).
|
||||
**Start `minishift`:**
|
||||
|
||||
[Minishift](https://github.com/minishift/minishift) is a tool that helps run OpenShift locally using a single-node cluster inside a VM. Similar to [minikube](https://github.com/kubernetes/minikube).
|
||||
|
||||
```sh
|
||||
$ minishift start
|
||||
@@ -134,32 +134,32 @@ Starting local OpenShift cluster using 'kvm' hypervisor...
|
||||
...
|
||||
```
|
||||
|
||||
__Download an [example Docker Compose file](https://raw.githubusercontent.com/kubernetes/kompose/master/examples/docker-compose.yaml), or use your own:__
|
||||
**Download an [example Docker Compose file](https://raw.githubusercontent.com/kubernetes/kompose/master/examples/docker-compose.yaml), or use your own:**
|
||||
|
||||
```sh
|
||||
wget https://raw.githubusercontent.com/kubernetes/kompose/master/examples/docker-compose.yaml
|
||||
```
|
||||
|
||||
__Convert your Docker Compose file to OpenShift:__
|
||||
**Convert your Docker Compose file to OpenShift:**
|
||||
|
||||
Run `kompose convert --provider=openshift` in the same directory as your `docker-compose.yaml` file.
|
||||
|
||||
```sh
|
||||
$ kompose convert --provider=openshift
|
||||
INFO OpenShift file "frontend-service.yaml" created
|
||||
INFO OpenShift file "redis-master-service.yaml" created
|
||||
INFO OpenShift file "redis-slave-service.yaml" created
|
||||
INFO OpenShift file "frontend-deploymentconfig.yaml" created
|
||||
INFO OpenShift file "frontend-imagestream.yaml" created
|
||||
INFO OpenShift file "redis-master-deploymentconfig.yaml" created
|
||||
INFO OpenShift file "redis-master-imagestream.yaml" created
|
||||
INFO OpenShift file "redis-slave-deploymentconfig.yaml" created
|
||||
INFO OpenShift file "redis-slave-imagestream.yaml" created
|
||||
INFO OpenShift file "frontend-service.yaml" created
|
||||
INFO OpenShift file "redis-master-service.yaml" created
|
||||
INFO OpenShift file "redis-slave-service.yaml" created
|
||||
INFO OpenShift file "frontend-deploymentconfig.yaml" created
|
||||
INFO OpenShift file "frontend-imagestream.yaml" created
|
||||
INFO OpenShift file "redis-master-deploymentconfig.yaml" created
|
||||
INFO OpenShift file "redis-master-imagestream.yaml" created
|
||||
INFO OpenShift file "redis-slave-deploymentconfig.yaml" created
|
||||
INFO OpenShift file "redis-slave-imagestream.yaml" created
|
||||
```
|
||||
|
||||
Then you can use `kubectl apply` to create these resources in OpenShift cluster.
|
||||
|
||||
__Access the newly deployed service:__
|
||||
**Access the newly deployed service:**
|
||||
|
||||
After deployment, you must create an OpenShift route in order to access the service.
|
||||
|
||||
@@ -191,15 +191,16 @@ Opening the OpenShift Web console in the default browser...
|
||||
In this guide, we'll deploy a sample `docker-compose.yaml` file using both RHEL (Red Hat Enterprise Linux) and OpenShift.
|
||||
|
||||
Requirements:
|
||||
- Red Hat Enterprise Linux 7.4
|
||||
- [Red Hat Development Suite](https://developers.redhat.com/products/devsuite/overview/)
|
||||
- Which includes:
|
||||
- [minishift](https://github.com/minishift/minishift)
|
||||
- [kompose](https://github.com/kubernetes/kompose)
|
||||
|
||||
__Note:__ A KVM hypervisor must be setup in order to correctly use `minishift` on RHEL. You can set it up via the [CDK Documentation](https://access.redhat.com/documentation/en-us/red_hat_container_development_kit/3.1/html-single/getting_started_guide/index#setup-virtualization) under "Set up your virtualization environment".
|
||||
- Red Hat Enterprise Linux 7.4
|
||||
- [Red Hat Development Suite](https://developers.redhat.com/products/devsuite/overview/)
|
||||
- Which includes:
|
||||
- [minishift](https://github.com/minishift/minishift)
|
||||
- [kompose](https://github.com/kubernetes/kompose)
|
||||
|
||||
__Install Red Hat Development Suite:__
|
||||
**Note:** A KVM hypervisor must be setup in order to correctly use `minishift` on RHEL. You can set it up via the [CDK Documentation](https://access.redhat.com/documentation/en-us/red_hat_container_development_kit/3.1/html-single/getting_started_guide/index#setup-virtualization) under "Set up your virtualization environment".
|
||||
|
||||
**Install Red Hat Development Suite:**
|
||||
|
||||
Before we are able to use both `minishift` and `kompose`, DevSuite must be installed. A more concise [installation document is available](https://developers.redhat.com/products/cdk/hello-world#fndtn-rhel).
|
||||
|
||||
@@ -230,7 +231,7 @@ Install Red Hat Development Suite and Kompose.
|
||||
$ yum install rh-devsuite kompose -y
|
||||
```
|
||||
|
||||
__Start `minishift`:__
|
||||
**Start `minishift`:**
|
||||
|
||||
Before we begin, we must do a few preliminary steps setting up `minishift`.
|
||||
|
||||
@@ -253,32 +254,32 @@ Starting local OpenShift cluster using 'kvm' hypervisor...
|
||||
...
|
||||
```
|
||||
|
||||
__Download an [example Docker Compose file](https://raw.githubusercontent.com/kubernetes/kompose/master/examples/docker-compose.yaml), or use your own:__
|
||||
**Download an [example Docker Compose file](https://raw.githubusercontent.com/kubernetes/kompose/master/examples/docker-compose.yaml), or use your own:**
|
||||
|
||||
```sh
|
||||
wget https://raw.githubusercontent.com/kubernetes/kompose/master/examples/docker-compose.yaml
|
||||
```
|
||||
|
||||
__Convert your Docker Compose file to OpenShift:__
|
||||
**Convert your Docker Compose file to OpenShift:**
|
||||
|
||||
Run `kompose convert --provider=openshift` in the same directory as your `docker-compose.yaml` file.
|
||||
|
||||
```sh
|
||||
$ kompose convert --provider=openshift
|
||||
INFO OpenShift file "frontend-service.yaml" created
|
||||
INFO OpenShift file "redis-master-service.yaml" created
|
||||
INFO OpenShift file "redis-slave-service.yaml" created
|
||||
INFO OpenShift file "frontend-deploymentconfig.yaml" created
|
||||
INFO OpenShift file "frontend-imagestream.yaml" created
|
||||
INFO OpenShift file "redis-master-deploymentconfig.yaml" created
|
||||
INFO OpenShift file "redis-master-imagestream.yaml" created
|
||||
INFO OpenShift file "redis-slave-deploymentconfig.yaml" created
|
||||
INFO OpenShift file "redis-slave-imagestream.yaml" created
|
||||
INFO OpenShift file "frontend-service.yaml" created
|
||||
INFO OpenShift file "redis-master-service.yaml" created
|
||||
INFO OpenShift file "redis-slave-service.yaml" created
|
||||
INFO OpenShift file "frontend-deploymentconfig.yaml" created
|
||||
INFO OpenShift file "frontend-imagestream.yaml" created
|
||||
INFO OpenShift file "redis-master-deploymentconfig.yaml" created
|
||||
INFO OpenShift file "redis-master-imagestream.yaml" created
|
||||
INFO OpenShift file "redis-slave-deploymentconfig.yaml" created
|
||||
INFO OpenShift file "redis-slave-imagestream.yaml" created
|
||||
```
|
||||
|
||||
Then you can use `kubectl apply` to create these resources in OpenShift.
|
||||
|
||||
__Access the newly deployed service:__
|
||||
**Access the newly deployed service:**
|
||||
|
||||
After deployment, you must create an OpenShift route in order to access the service.
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
layout: index
|
||||
---
|
||||
|
||||
```sh
|
||||
$ kompose convert -f docker-compose.yaml
|
||||
|
||||
|
||||
+12
-10
@@ -2,15 +2,15 @@
|
||||
layout: default
|
||||
permalink: /installation/
|
||||
title: Installation
|
||||
redirect_from:
|
||||
redirect_from:
|
||||
- /docs/installation.md/
|
||||
- /docs/installation/
|
||||
---
|
||||
|
||||
# Installation
|
||||
|
||||
* TOC
|
||||
{:toc}
|
||||
- TOC
|
||||
{:toc}
|
||||
|
||||
We have multiple ways to install Kompose. Our preferred method is downloading the binary from the latest GitHub release.
|
||||
|
||||
@@ -18,7 +18,7 @@ We have multiple ways to install Kompose. Our preferred method is downloading th
|
||||
|
||||
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).
|
||||
|
||||
__Linux and macOS:__
|
||||
**Linux and macOS:**
|
||||
|
||||
```sh
|
||||
# Linux
|
||||
@@ -31,7 +31,7 @@ chmod +x kompose
|
||||
sudo mv ./kompose /usr/local/bin/kompose
|
||||
```
|
||||
|
||||
__Windows:__
|
||||
**Windows:**
|
||||
|
||||
Download from [GitHub](https://github.com/kubernetes/kompose/releases/download/v1.28.0/kompose-windows-amd64.exe) and add the binary to your PATH.
|
||||
|
||||
@@ -46,7 +46,7 @@ go install github.com/kubernetes/kompose@latest
|
||||
## CentOS
|
||||
|
||||
Kompose is in [EPEL](https://fedoraproject.org/wiki/EPEL) CentOS repository.
|
||||
If you don't have [EPEL](https://fedoraproject.org/wiki/EPEL) repository already installed and enabled you can do it by running `sudo yum install epel-release`
|
||||
If you don't have [EPEL](https://fedoraproject.org/wiki/EPEL) repository already installed and enabled you can do it by running `sudo yum install epel-release`
|
||||
|
||||
If you have [EPEL](https://fedoraproject.org/wiki/EPEL) enabled in your system, you can install Kompose like any other package.
|
||||
|
||||
@@ -55,6 +55,7 @@ sudo yum -y install kompose
|
||||
```
|
||||
|
||||
## Fedora
|
||||
|
||||
Kompose is in Fedora 24, 25 and 26 repositories. You can install it just like any other package.
|
||||
|
||||
```bash
|
||||
@@ -63,7 +64,7 @@ sudo dnf -y install kompose
|
||||
|
||||
## Ubuntu/Debian
|
||||
|
||||
A deb package is released for compose. Download latest package in the assets in [github releases](https://github.com/kubernetes/kompose/releases).
|
||||
A deb package is released for compose. Download the latest package in the assets in [GitHub releases](https://github.com/kubernetes/kompose/releases).
|
||||
|
||||
```bash
|
||||
wget https://github.com/kubernetes/kompose/releases/download/v1.28.0/kompose_1.28.0_amd64.deb # Replace 1.28.0 with latest tag
|
||||
@@ -71,8 +72,8 @@ sudo apt install ./kompose_1.28.0_amd64.deb
|
||||
```
|
||||
|
||||
## macOS
|
||||
On macOS you can install latest release via [Homebrew](https://brew.sh) or [MacPorts](https://www.macports.org/).
|
||||
|
||||
On macOS, you can install the latest release via [Homebrew](https://brew.sh) or [MacPorts](https://www.macports.org/).
|
||||
```bash
|
||||
# Homebrew
|
||||
brew install kompose
|
||||
@@ -82,6 +83,7 @@ port install kompose
|
||||
```
|
||||
|
||||
## Windows
|
||||
|
||||
Kompose can be installed via [Chocolatey](https://chocolatey.org/packages/kubernetes-kompose)
|
||||
|
||||
```console
|
||||
@@ -89,6 +91,7 @@ choco install kubernetes-kompose
|
||||
```
|
||||
|
||||
## openSUSE/SLE
|
||||
|
||||
Kompose is available in the official repositories of openSUSE Tumbleweed and in openSUSE Leap starting with 15.2. On SUSE Linux Enterprise Server 15 SP2 - and following - you can install kompose from [PackageHub](https://packagehub.suse.com/). Please refer to the SUSE documentation on how to activate [PackageHub](https://packagehub.suse.com/) on your SUSE Linux Enterprise distribution.
|
||||
|
||||
```bash
|
||||
@@ -109,10 +112,9 @@ To run `kompose` without installing it, use [nix-shell](https://nixos.org/manual
|
||||
nix-shell -p kompose --run "kompose convert"
|
||||
```
|
||||
|
||||
|
||||
## Docker
|
||||
|
||||
You can build an image from the offical repo for [Docker](https://docs.docker.com/engine/reference/commandline/build/) or [Podman](https://docs.podman.io/en/latest/markdown/podman-build.1.html):
|
||||
You can build an image from the official repo for [Docker](https://docs.docker.com/engine/reference/commandline/build/) or [Podman](https://docs.podman.io/en/latest/markdown/podman-build.1.html):
|
||||
|
||||
```bash
|
||||
docker build -t kompose https://github.com/kubernetes/kompose.git
|
||||
|
||||
+19
-19
@@ -2,56 +2,56 @@
|
||||
layout: default
|
||||
permalink: /integrations/
|
||||
title: Integrations
|
||||
redirect_from:
|
||||
redirect_from:
|
||||
- /docs/integrations.md/
|
||||
- /docs/integrations/
|
||||
---
|
||||
|
||||
# Integrations
|
||||
|
||||
* TOC
|
||||
{:toc}
|
||||
- TOC
|
||||
{:toc}
|
||||
|
||||
There are some projects out there known to use Kompose integrated in some form or another
|
||||
|
||||
### Kompose UI by Jad Chamoun (ICANN) and Joe Haddad (Anghami)
|
||||
|
||||
__Description:__ "A web interface to convert Docker Compose files to Kubernetes YAML"
|
||||
**Description:** "A web interface to convert Docker Compose files to Kubernetes YAML"
|
||||
|
||||
__Link:__ [https://github.com/JadCham/komposeui](https://github.com/JadCham/komposeui)
|
||||
**Link:** [https://github.com/JadCham/komposeui](https://github.com/JadCham/komposeui)
|
||||
|
||||
### Kompose Docker Container by Cloudfind
|
||||
|
||||
__Description:__ "A Docker container for the Kompose translator for docker-compose"
|
||||
**Description:** "A Docker container for the Kompose translator for docker-compose"
|
||||
|
||||
__Link:__ [https://github.com/cloudfind/kompose-docker](https://github.com/cloudfind/kompose-docker)
|
||||
**Link:** [https://github.com/cloudfind/kompose-docker](https://github.com/cloudfind/kompose-docker)
|
||||
|
||||
### KPM by CoreOS
|
||||
|
||||
__Description:__ "KPM is a tool to deploy and manage application stacks on Kubernetes"
|
||||
**Description:** "KPM is a tool to deploy and manage application stacks on Kubernetes"
|
||||
|
||||
__Link:__ [https://github.com/coreos/kpm](https://github.com/coreos/kpm)
|
||||
**Link:** [https://github.com/coreos/kpm](https://github.com/coreos/kpm)
|
||||
|
||||
### Docker Image for Adobe Enterprise Manager by Adfinis SyGroup AG
|
||||
|
||||
__Description:__ "Docker Image for Adobe Enterprise Manager"
|
||||
**Description:** "Docker Image for Adobe Enterprise Manager"
|
||||
|
||||
__Link:__ [https://github.com/adfinis-sygroup/aem-docker/tree/master](https://github.com/adfinis-sygroup/aem-docker/tree/master)
|
||||
**Link:** [https://github.com/adfinis-sygroup/aem-docker/tree/master](https://github.com/adfinis-sygroup/aem-docker/tree/master)
|
||||
|
||||
### Kompose Ansible Playbook by Chris Houseknecht (Red Hat)
|
||||
|
||||
__Description:__ "Download and unarchive the latest kompose release asset for your OS"
|
||||
**Description:** "Download and unarchive the latest kompose release asset for your OS"
|
||||
|
||||
__Link:__ [https://github.com/chouseknecht/kompose-install-role](https://github.com/chouseknecht/kompose-install-role)
|
||||
**Link:** [https://github.com/chouseknecht/kompose-install-role](https://github.com/chouseknecht/kompose-install-role)
|
||||
|
||||
### Fabric8 Maven Plugin by Red Hat
|
||||
|
||||
__Description:__ "Maven is one of the widely used build tools for Java applications. The Fabric8 Maven Plugin is a maven extension that simplifies the deployment of Java applications to Kubernetes or OpenShift cluster.
|
||||
The main task of this plugin is to build Docker images, generate Kubernetes or OpenShift resource descriptors and run/deploy the application on Kubernetes or OpenShift cluster.
|
||||
Plugin has wide range of configuration options. Docker Compose is one of the option to bring up deployments on Kubernetes or OpenShift cluster.
|
||||
**Description:** "Maven is one of the widely used build tools for Java applications. The Fabric8 Maven Plugin is a maven extension that simplifies the deployment of Java applications to Kubernetes or OpenShift clusters.
|
||||
The main task of this plugin is to build Docker images, generate Kubernetes or OpenShift resource descriptors and run/deploy the application on Kubernetes or OpenShift cluster.
|
||||
The plugin has a wide range of configuration options. Docker Compose is one of the options to bring up deployments on Kubernetes or OpenShift clusters.
|
||||
Technically, Fabric8 Maven Plugin processes the external docker-compose.yml file and generates Kubernetes or OpenShift resources via Kompose."
|
||||
|
||||
__Links:__
|
||||
**Links:**
|
||||
|
||||
* [Quickstart](/docs/maven-example.md)
|
||||
* [Documentation](https://maven.fabric8.io/#docker-compose)
|
||||
- [Quickstart](/docs/maven-example.md)
|
||||
- [Documentation](https://maven.fabric8.io/#docker-compose)
|
||||
|
||||
+24
-13
@@ -2,45 +2,52 @@
|
||||
layout: default
|
||||
permalink: /maven-example/
|
||||
title: Maven Example
|
||||
redirect_from:
|
||||
redirect_from:
|
||||
- /docs/maven-example.md/
|
||||
- /docs/maven-example/
|
||||
---
|
||||
|
||||
# Fabric8 Maven Plugin + Kompose:
|
||||
|
||||
Let's deploy a Springboot Java application with Docker Compose file using Fabric8 Maven Plugin to Kubernetes or OpenShift.
|
||||
|
||||
##### Requirements
|
||||
* Linux or MacOS or Windows
|
||||
* JDK 1.7+ - [JDK Quick Installation Guide](http://openjdk.java.net/install/)
|
||||
* Maven 3.x+ - [Maven Installation Guide](http://www.baeldung.com/install-maven-on-windows-linux-mac)
|
||||
* Kompose - [Kompose Installation Guide](/docs/installation.md)
|
||||
|
||||
__1. Clone the example project from GitHub__
|
||||
- Linux or MacOS or Windows
|
||||
- JDK 1.7+ - [JDK Quick Installation Guide](http://openjdk.java.net/install/)
|
||||
- Maven 3.x+ - [Maven Installation Guide](http://www.baeldung.com/install-maven-on-windows-linux-mac)
|
||||
- Kompose - [Kompose Installation Guide](/docs/installation.md)
|
||||
|
||||
**1. Clone the example project from GitHub**
|
||||
|
||||
```bash
|
||||
$ git clone https://github.com/piyush1594/kompose-maven-example.git
|
||||
```
|
||||
|
||||
Change current directory to `kompose-maven-example` directory.
|
||||
|
||||
```bash
|
||||
$ cd kompose-maven-example
|
||||
```
|
||||
|
||||
__2. Add Fabric8 Maven Plugin to your project__
|
||||
**2. Add Fabric8 Maven Plugin to your project**
|
||||
|
||||
```bash
|
||||
$ mvn io.fabric8:fabric8-maven-plugin:3.5.28:setup
|
||||
```
|
||||
|
||||
Add the Fabric8 Maven Plugin configuration to `pom.xml` of project. `pom.xml` is manifest or deployment descriptor file of a maven project.
|
||||
|
||||
__3. Install Kompose through Maven__
|
||||
**3. Install Kompose through Maven**
|
||||
|
||||
```bash
|
||||
$ mvn fabric8:install
|
||||
```
|
||||
|
||||
This command installs the `kompose` on the host.
|
||||
|
||||
__4. Configure Fabric8 Maven Plugin to use a Docker Compose file__
|
||||
**4. Configure Fabric8 Maven Plugin to use a Docker Compose file**
|
||||
|
||||
```bash
|
||||
<plugin>
|
||||
<groupId>io.fabric8</groupId>
|
||||
@@ -61,19 +68,22 @@ __4. Configure Fabric8 Maven Plugin to use a Docker Compose file__
|
||||
|
||||
Add the `<configuration>` and `<executions>` sections to `pom.xml` as shown in above `pom.xml` snippet. Update the `<composeFile>` to provide the relative path of Docker Compose file from `pom.xml`
|
||||
|
||||
__5. Deploy application on Kubernetes or OpenShift__
|
||||
**5. Deploy application on Kubernetes or OpenShift**
|
||||
|
||||
Make sure that Kubernetes/OpenShift cluster or Minikube/Minishift is running. In case, if anything of this is not running, you can run Minishift to test this application by using the following command.
|
||||
|
||||
Make sure that Kubernetes/OpenShift cluster or Minikube/minishift is running. In case, if anything of this is not running, you can run minishift to test this application by using following command.
|
||||
```bash
|
||||
$ minishift start
|
||||
```
|
||||
|
||||
Below command deploys this application on Kubernetes or OpenShift.
|
||||
Below command deploys this application on Kubernetes or OpenShift.
|
||||
|
||||
```bash
|
||||
$ mvn fabric8:deploy
|
||||
$ mvn fabric8:deploy
|
||||
```
|
||||
|
||||
Now that your service has been deployed, let's access it by querying `pod`, `service` from Kubernetes or OpenShift.
|
||||
|
||||
```bash
|
||||
$ oc get pods
|
||||
NAME READY STATUS RESTARTS AGE
|
||||
@@ -88,6 +98,7 @@ springboot-docker-compose 172.30.205.137 <none> 8080/TCP 6m
|
||||
```
|
||||
|
||||
Let's access the Springboot service.
|
||||
|
||||
```bash
|
||||
$ minishift openshift service --in-browser springboot-docker-compose
|
||||
Created the new window in existing browser session.
|
||||
|
||||
+89
-91
@@ -2,20 +2,19 @@
|
||||
layout: default
|
||||
permalink: /user-guide/
|
||||
title: User Guide
|
||||
redirect_from:
|
||||
redirect_from:
|
||||
- /docs/user-guide.md/
|
||||
- /docs/user-guide/
|
||||
---
|
||||
|
||||
# User Guide
|
||||
|
||||
* TOC
|
||||
{:toc}
|
||||
- TOC
|
||||
{:toc}
|
||||
|
||||
Kompose has support for two providers: OpenShift and Kubernetes.
|
||||
You can choose a targeted provider using global option `--provider`. If no provider is specified, Kubernetes is set by default.
|
||||
|
||||
|
||||
## Kompose Convert
|
||||
|
||||
Kompose supports conversion of V1, V2, and V3 Docker Compose files into Kubernetes and OpenShift objects.
|
||||
@@ -46,60 +45,60 @@ You can also provide multiple docker-compose files at the same time:
|
||||
|
||||
```sh
|
||||
$ kompose -f docker-compose.yml -f docker-guestbook.yml convert
|
||||
INFO Kubernetes file "frontend-service.yaml" created
|
||||
INFO Kubernetes file "mlbparks-service.yaml" created
|
||||
INFO Kubernetes file "mongodb-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 "mlbparks-deployment.yaml" created
|
||||
INFO Kubernetes file "mongodb-deployment.yaml" created
|
||||
INFO Kubernetes file "mongodb-claim0-persistentvolumeclaim.yaml" created
|
||||
INFO Kubernetes file "redis-master-deployment.yaml" created
|
||||
INFO Kubernetes file "redis-slave-deployment.yaml" created
|
||||
INFO Kubernetes file "frontend-service.yaml" created
|
||||
INFO Kubernetes file "mlbparks-service.yaml" created
|
||||
INFO Kubernetes file "mongodb-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 "mlbparks-deployment.yaml" created
|
||||
INFO Kubernetes file "mongodb-deployment.yaml" created
|
||||
INFO Kubernetes file "mongodb-claim0-persistentvolumeclaim.yaml" created
|
||||
INFO Kubernetes file "redis-master-deployment.yaml" created
|
||||
INFO Kubernetes file "redis-slave-deployment.yaml" created
|
||||
|
||||
$ ls
|
||||
mlbparks-deployment.yaml mongodb-service.yaml redis-slave-service.jsonmlbparks-service.yaml
|
||||
mlbparks-deployment.yaml mongodb-service.yaml redis-slave-service.jsonmlbparks-service.yaml
|
||||
frontend-deployment.yaml mongodb-claim0-persistentvolumeclaim.yaml redis-master-service.yaml
|
||||
frontend-service.yaml mongodb-deployment.yaml redis-slave-deployment.yaml
|
||||
redis-master-deployment.yaml
|
||||
```
|
||||
```
|
||||
|
||||
When multiple docker-compose files are provided the configuration is merged. Any configuration that is common will be over ridden by subsequent file.
|
||||
|
||||
|
||||
### OpenShift
|
||||
|
||||
```sh
|
||||
$ kompose --provider openshift --file docker-voting.yml convert
|
||||
WARN [worker] Service cannot be created because of missing port.
|
||||
INFO OpenShift file "vote-service.yaml" created
|
||||
INFO OpenShift file "db-service.yaml" created
|
||||
INFO OpenShift file "redis-service.yaml" created
|
||||
INFO OpenShift file "result-service.yaml" created
|
||||
INFO OpenShift file "vote-deploymentconfig.yaml" created
|
||||
INFO OpenShift file "vote-imagestream.yaml" created
|
||||
INFO OpenShift file "worker-deploymentconfig.yaml" created
|
||||
INFO OpenShift file "worker-imagestream.yaml" created
|
||||
INFO OpenShift file "db-deploymentconfig.yaml" created
|
||||
INFO OpenShift file "db-imagestream.yaml" created
|
||||
INFO OpenShift file "redis-deploymentconfig.yaml" created
|
||||
INFO OpenShift file "redis-imagestream.yaml" created
|
||||
INFO OpenShift file "result-deploymentconfig.yaml" created
|
||||
INFO OpenShift file "result-imagestream.yaml" created
|
||||
INFO OpenShift file "vote-service.yaml" created
|
||||
INFO OpenShift file "db-service.yaml" created
|
||||
INFO OpenShift file "redis-service.yaml" created
|
||||
INFO OpenShift file "result-service.yaml" created
|
||||
INFO OpenShift file "vote-deploymentconfig.yaml" created
|
||||
INFO OpenShift file "vote-imagestream.yaml" created
|
||||
INFO OpenShift file "worker-deploymentconfig.yaml" created
|
||||
INFO OpenShift file "worker-imagestream.yaml" created
|
||||
INFO OpenShift file "db-deploymentconfig.yaml" created
|
||||
INFO OpenShift file "db-imagestream.yaml" created
|
||||
INFO OpenShift file "redis-deploymentconfig.yaml" created
|
||||
INFO OpenShift file "redis-imagestream.yaml" created
|
||||
INFO OpenShift file "result-deploymentconfig.yaml" created
|
||||
INFO OpenShift file "result-imagestream.yaml" created
|
||||
```
|
||||
|
||||
It also supports creating buildconfig for build directive in a service. By default, it uses the remote repo for the current git branch as the source repo, and the current branch as the source branch for the build. You can specify a different source repo and branch using ``--build-repo`` and ``--build-branch`` options respectively.
|
||||
It also supports creating buildconfig for build directive in a service. By default, it uses the remote repository for the current git branch as the source repository, and the current branch as the source branch for the build. You can specify a different source repository and branch using `--build-repo` and `--build-branch` options respectively.
|
||||
|
||||
```sh
|
||||
$ kompose --provider openshift --file buildconfig/docker-compose.yml convert
|
||||
WARN [foo] Service cannot be created because of missing port.
|
||||
INFO OpenShift Buildconfig using git@github.com:rtnpro/kompose.git::master as source.
|
||||
INFO OpenShift file "foo-deploymentconfig.yaml" created
|
||||
INFO OpenShift file "foo-imagestream.yaml" created
|
||||
INFO OpenShift file "foo-buildconfig.yaml" created
|
||||
WARN [foo] Service cannot be created because of missing port.
|
||||
INFO OpenShift Buildconfig using git@github.com:rtnpro/kompose.git::master as source.
|
||||
INFO OpenShift file "foo-deploymentconfig.yaml" created
|
||||
INFO OpenShift file "foo-imagestream.yaml" created
|
||||
INFO OpenShift file "foo-buildconfig.yaml" created
|
||||
```
|
||||
|
||||
**Note**: If you are manually pushing the Openshift artifacts using ``oc create -f``, you need to ensure that you push the imagestream artifact before the buildconfig artifact, to workaround this Openshift issue: https://github.com/openshift/origin/issues/4518 .
|
||||
**Note**: If you are manually pushing the Openshift artifacts using `oc create -f`, you need to ensure that you push the imagestream artifact before the buildconfig artifact, to work around this Openshift issue: https://github.com/openshift/origin/issues/4518 .
|
||||
|
||||
## Alternative Conversions
|
||||
|
||||
@@ -112,6 +111,7 @@ INFO Kubernetes file "web-svc.json" created
|
||||
INFO Kubernetes file "redis-deployment.json" created
|
||||
INFO Kubernetes file "web-deployment.json" created
|
||||
```
|
||||
|
||||
The `*-deployment.json` files contain the Deployment objects.
|
||||
|
||||
```sh
|
||||
@@ -136,19 +136,18 @@ The `*-daemonset.yaml` files contain the Daemon Set objects
|
||||
|
||||
```sh
|
||||
$ kompose convert --controller statefulset
|
||||
INFO Kubernetes file "db-service.yaml" created
|
||||
INFO Kubernetes file "wordpress-service.yaml" created
|
||||
INFO Kubernetes file "db-statefulset.yaml" created
|
||||
INFO Kubernetes file "wordpress-statefulset.yaml" created
|
||||
INFO Kubernetes file "db-service.yaml" created
|
||||
INFO Kubernetes file "wordpress-service.yaml" created
|
||||
INFO Kubernetes file "db-statefulset.yaml" created
|
||||
INFO Kubernetes file "wordpress-statefulset.yaml" created
|
||||
```
|
||||
|
||||
The `*statefulset-.yaml` files contain the Statefulset objects.
|
||||
|
||||
|
||||
If you want to generate a Chart to be used with [Helm](https://github.com/kubernetes/helm) simply do:
|
||||
|
||||
```sh
|
||||
$ kompose convert -c
|
||||
$ kompose convert -c
|
||||
INFO Kubernetes file "web-svc.yaml" created
|
||||
INFO Kubernetes file "redis-svc.yaml" created
|
||||
INFO Kubernetes file "web-deployment.yaml" created
|
||||
@@ -175,44 +174,42 @@ explicitly define the generated resources' behavior upon conversion, like Servic
|
||||
|
||||
The currently supported options are:
|
||||
|
||||
| Key | Value |
|
||||
|----------------------|-------------------------------------|
|
||||
| kompose.service.type | nodeport / clusterip / loadbalancer / headless |
|
||||
| kompose.service.group | name to group the containers contained in a single pod |
|
||||
| kompose.service.expose | true / hostnames (separated by comma) |
|
||||
| kompose.service.nodeport.port | port value (string) |
|
||||
| kompose.service.expose.tls-secret | secret name |
|
||||
| kompose.service.expose.ingress-class-name | ingress class name |
|
||||
| kompose.volume.size | kubernetes supported volume size |
|
||||
| kompose.volume.storage-class-name | kubernetes supported volume storageClassName |
|
||||
| kompose.volume.type | use k8s volume type, eg "configMap", "persistentVolumeClaim", "emptyDir", "hostPath" |
|
||||
| kompose.controller.type | deployment / daemonset / replicationcontroller |
|
||||
| kompose.image-pull-policy | kubernetes pods imagePullPolicy |
|
||||
| kompose.image-pull-secret | kubernetes secret name for imagePullSecrets |
|
||||
| kompose.service.healthcheck.readiness.disable | kubernetes readiness disable |
|
||||
| kompose.service.healthcheck.readiness.test | kubernetes readiness exec command |
|
||||
| kompose.service.healthcheck.readiness.http_get_path | kubernetes readiness httpGet path |
|
||||
| kompose.service.healthcheck.readiness.http_get_port | kubernetes readiness httpGet port |
|
||||
| kompose.service.healthcheck.readiness.tcp_port | kubernetes readiness tcpSocket port |
|
||||
| kompose.service.healthcheck.readiness.interval | kubernetes readiness interval value |
|
||||
| kompose.service.healthcheck.readiness.timeout | kubernetes readiness timeout value |
|
||||
| kompose.service.healthcheck.readiness.retries | kubernetes readiness retries value |
|
||||
| kompose.service.healthcheck.readiness.start_period | kubernetes readiness start_period |
|
||||
| kompose.service.healthcheck.liveness.http_get_path | kubernetes liveness httpGet path |
|
||||
| kompose.service.healthcheck.liveness.http_get_port | kubernetes liveness httpGet port |
|
||||
| kompose.service.healthcheck.liveness.tcp_port | kubernetes liveness tcpSocket port |
|
||||
| Key | Value |
|
||||
| --------------------------------------------------- | ------------------------------------------------------------------------------------ |
|
||||
| kompose.service.type | nodeport / clusterip / loadbalancer / headless |
|
||||
| kompose.service.group | name to group the containers contained in a single pod |
|
||||
| kompose.service.expose | true / hostnames (separated by comma) |
|
||||
| kompose.service.nodeport.port | port value (string) |
|
||||
| kompose.service.expose.tls-secret | secret name |
|
||||
| kompose.service.expose.ingress-class-name | ingress class name |
|
||||
| kompose.volume.size | kubernetes supported volume size |
|
||||
| kompose.volume.storage-class-name | kubernetes supported volume storageClassName |
|
||||
| kompose.volume.type | use k8s volume type, eg "configMap", "persistentVolumeClaim", "emptyDir", "hostPath" |
|
||||
| kompose.controller.type | deployment / daemonset / replicationcontroller |
|
||||
| kompose.image-pull-policy | kubernetes pods imagePullPolicy |
|
||||
| kompose.image-pull-secret | kubernetes secret name for imagePullSecrets |
|
||||
| kompose.service.healthcheck.readiness.disable | kubernetes readiness disable |
|
||||
| kompose.service.healthcheck.readiness.test | kubernetes readiness exec command |
|
||||
| kompose.service.healthcheck.readiness.http_get_path | kubernetes readiness httpGet path |
|
||||
| kompose.service.healthcheck.readiness.http_get_port | kubernetes readiness httpGet port |
|
||||
| kompose.service.healthcheck.readiness.tcp_port | kubernetes readiness tcpSocket port |
|
||||
| kompose.service.healthcheck.readiness.interval | kubernetes readiness interval value |
|
||||
| kompose.service.healthcheck.readiness.timeout | kubernetes readiness timeout value |
|
||||
| kompose.service.healthcheck.readiness.retries | kubernetes readiness retries value |
|
||||
| kompose.service.healthcheck.readiness.start_period | kubernetes readiness start_period |
|
||||
| kompose.service.healthcheck.liveness.http_get_path | kubernetes liveness httpGet path |
|
||||
| kompose.service.healthcheck.liveness.http_get_port | kubernetes liveness httpGet port |
|
||||
| kompose.service.healthcheck.liveness.tcp_port | kubernetes liveness tcpSocket port |
|
||||
|
||||
**Note**: `kompose.service.type` label should be defined with `ports` only (except for headless service), otherwise `kompose` will fail.
|
||||
|
||||
|
||||
|
||||
- `kompose.service.type` defines the type of service to be created.
|
||||
|
||||
For example:
|
||||
|
||||
```yaml
|
||||
version: "2"
|
||||
services:
|
||||
services:
|
||||
nginx:
|
||||
image: nginx
|
||||
dockerfile: foobar
|
||||
@@ -220,11 +217,11 @@ services:
|
||||
cap_add:
|
||||
- ALL
|
||||
container_name: foobar
|
||||
labels:
|
||||
labels:
|
||||
kompose.service.type: nodeport
|
||||
```
|
||||
|
||||
- `kompose.service.group` defines the group of containers included in a single pod.
|
||||
- `kompose.service.group` defines the group of containers included in a single pod.
|
||||
|
||||
For example:
|
||||
|
||||
@@ -236,19 +233,19 @@ services:
|
||||
image: nginx
|
||||
depends_on:
|
||||
- logs
|
||||
labels:
|
||||
labels:
|
||||
- kompose.service.group=sidecar
|
||||
|
||||
logs:
|
||||
image: busybox
|
||||
command: ["tail -f /var/log/nginx/access.log"]
|
||||
labels:
|
||||
labels:
|
||||
- kompose.service.group=sidecar
|
||||
```
|
||||
|
||||
- `kompose.service.expose` defines if the service needs to be made accessible from outside the cluster or not. 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.
|
||||
- For the Kubernetes provider, an ingress resource is created and it is assumed that an ingress controller has already been configured. If the value is set to a comma sepatated list, multiple hostnames are supported.Hostname with path is also supported.
|
||||
- For the OpenShift provider, a route is created.
|
||||
- For the Kubernetes provider, an ingress resource is created, and it is assumed that an ingress controller has already been configured. If the value is set to a comma-separated list, multiple hostnames are supported. Hostname with the path is also supported.
|
||||
- For the OpenShift provider, a route is created.
|
||||
- `kompose.service.nodeport.port` defines the port value when service type is `nodeport`, this label should only be set when the service only contains 1 port. Usually kubernetes define a port range for node port values, kompose will not validate this.
|
||||
- `kompose.service.expose.tls-secret` provides the name of the TLS secret to use with the Kubernetes ingress controller. This requires kompose.service.expose to be set.
|
||||
- `kompose.service.expose.ingress-class-name` provides the name of ingress class to use with the Kubernetes ingress controller. This requires kompose.service.
|
||||
@@ -288,8 +285,8 @@ services:
|
||||
```
|
||||
|
||||
- `kompose.image-pull-secret` defines a kubernetes secret name for imagePullSecrets podspec field.
|
||||
This secret will be used for pulling private images.
|
||||
For example:
|
||||
This secret will be used for pulling private images.
|
||||
For example:
|
||||
|
||||
```yaml
|
||||
version: '2'
|
||||
@@ -300,8 +297,8 @@ services:
|
||||
kompose.image-pull-secret: "example-kubernetes-secret"
|
||||
```
|
||||
|
||||
- `kompose.volume.size` defines the requests storage's size in the PersistentVolumeClaim, or you can use command line parameter `--pvc-request-size`.
|
||||
The priority follow label (kompose.volume.size) > command parameter(--pvc-request-size) > defaultSize (100Mi)
|
||||
- `kompose.volume.size` defines the requests storage's size in the PersistentVolumeClaim, or you can use the command line parameter `--pvc-request-size`.
|
||||
- The priority follows label (kompose.volume.size) > command parameter(--pvc-request-size) > defaultSize (100Mi)
|
||||
|
||||
For example:
|
||||
|
||||
@@ -378,7 +375,6 @@ services:
|
||||
kompose.image-pull-policy: "Never"
|
||||
```
|
||||
|
||||
|
||||
For example:
|
||||
|
||||
```yaml
|
||||
@@ -412,6 +408,7 @@ services:
|
||||
kompose.service.healthcheck.readiness.retries: 3
|
||||
kompose.service.healthcheck.readiness.start_period: 30s
|
||||
```
|
||||
|
||||
- `kompose.service.healthcheck.readiness` defines Kubernetes [readiness](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-readiness-probes)
|
||||
|
||||
## Restart
|
||||
@@ -419,7 +416,7 @@ services:
|
||||
If you want to create normal pods without controller you can use `restart` construct of docker-compose to define that. Follow table below to see what happens on the `restart` value.
|
||||
|
||||
| `docker-compose` `restart` | object created | Pod `restartPolicy` |
|
||||
|----------------------------|-------------------|---------------------|
|
||||
| -------------------------- | ----------------- | ------------------- |
|
||||
| `""` | controller object | `Always` |
|
||||
| `always` | controller object | `Always` |
|
||||
| `unless-stopped` | controller object | `Always` |
|
||||
@@ -452,9 +449,9 @@ Please note that changing service name might break some `docker-compose` files.
|
||||
|
||||
If the Docker Compose file has `build` or `build:context, build:dockerfile` keys, build will run when `--build` specified.
|
||||
|
||||
And Image will push to *docker.io* (default) when `--push-image=true` specified.
|
||||
And Image will push to _docker.io_ (default) when `--push-image=true` specified.
|
||||
|
||||
It is possible to push to custom registry by specify `--push-image-registry`, which will override the registry from image name.
|
||||
It is possible to push to custom registry by specify `--push-image-registry`, which will override the registry from image name.
|
||||
|
||||
### Authentication on registry
|
||||
|
||||
@@ -463,12 +460,13 @@ Kompose uses the docker authentication from file `$DOCKER_CONFIG/config.json`, `
|
||||
**This only works fine on Linux but macOS would fail when using `"credsStore": "osxkeychain"`.**
|
||||
|
||||
However, there is an approach to push successfully on macOS, by not using `osxkeychain` for `credsStore`. To disable `osxkeychain`:
|
||||
* remove `credsStore` from `config.json` file, and `docker login` again.
|
||||
* for some docker desktop versions, there is a setting `Securely store Docker logins in macOS keychain`, which should be unchecked. Then restart docker desktop if needed, and `docker login` again.
|
||||
|
||||
- remove `credsStore` from `config.json` file, and `docker login` again.
|
||||
- for some docker desktop versions, there is a setting `Securely store Docker logins in macOS keychain`, which should be unchecked. Then restart docker desktop if needed, and `docker login` again.
|
||||
|
||||
Now `config.json` should contain base64 encoded passwords, then push image should succeed. Working, but not safe though! Use it at your risk.
|
||||
|
||||
For Windows, there is also `credsStore` which is `wincred`. Technically it will fail on authentication as macOS does, but you can try the approach above like macOS too.
|
||||
For Windows, there is also `credsStore` which is `wincred`. Technically it will fail on authentication as macOS does, but you can try the approach above like macOS too.
|
||||
|
||||
## Docker Compose Versions
|
||||
|
||||
|
||||
Reference in New Issue
Block a user