forked from LaconicNetwork/kompose
adds a label for initContainers, test and user-guide (#1840)
* 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>
This commit is contained in:
co-authored by
dependabot[bot]
Kubernetes Prow Robot
parent
14152d4a81
commit
c9c1080306
@@ -211,6 +211,9 @@ The currently supported options are:
|
||||
| kompose.cronjob.schedule | kubernetes cronjob schedule (for example: '1 * * * *') |
|
||||
| kompose.cronjob.concurrency_policy | 'Forbid' / 'Allow' / 'Never' / '' |
|
||||
| kompose.cronjob.backoff_limit | kubernetes cronjob backoff limit (for example: '6') |
|
||||
| kompose.init.containers.name | kubernetes init container name |
|
||||
| kompose.init.containers.image | kubernetes init container image |
|
||||
| kompose.init.containers.command | kubernetes init container commands |
|
||||
|
||||
**Note**: `kompose.service.type` label should be defined with `ports` only (except for headless service), otherwise `kompose` will fail.
|
||||
|
||||
@@ -467,6 +470,48 @@ services:
|
||||
labels:
|
||||
kompose.volume.sub-path: pg-data
|
||||
```
|
||||
|
||||
- `kompose.init.containers.name` is used to specify the name of the Init Containers for a Pod [Init Container Name](https://kubernetes.io/docs/concepts/workloads/pods/init-containers/)
|
||||
|
||||
For example:
|
||||
|
||||
```yaml
|
||||
version: '3'
|
||||
services:
|
||||
example-service:
|
||||
image: example-image
|
||||
labels:
|
||||
kompose.init.containers.name: "initcontainername"
|
||||
```
|
||||
|
||||
- `kompose.init.containers.image` defines image to use for the Init Containers [Init Container Image](https://kubernetes.io/docs/concepts/workloads/pods/init-containers/)
|
||||
|
||||
For example:
|
||||
|
||||
```yaml
|
||||
version: '3'
|
||||
services:
|
||||
example-service:
|
||||
image: example-image
|
||||
labels:
|
||||
kompose.init.containers.image: perl
|
||||
```
|
||||
|
||||
|
||||
- `kompose.init.containers.command` defines the command that the Init Containers will run after they are started [Init Container Command](https://kubernetes.io/docs/concepts/workloads/pods/init-containers/)
|
||||
|
||||
For example:
|
||||
|
||||
```yaml
|
||||
version: '3'
|
||||
services:
|
||||
example-service:
|
||||
image: example-image
|
||||
labels:
|
||||
kompose.init.containers.command: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"]
|
||||
kompose.init.containers.image: perl
|
||||
```
|
||||
|
||||
## Restart
|
||||
|
||||
If you want to create normal pods without controller you can use `restart` construct of compose to define that. Follow table below to see what happens on the `restart` value.
|
||||
|
||||
Reference in New Issue
Block a user