forked from LaconicNetwork/kompose
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
This commit is contained in:
committed by
Charlie Drage
parent
40c1b8cf87
commit
66ac4aff4f
@@ -302,6 +302,8 @@ The currently supported options are:
|
||||
| kompose.service.expose.tls-secret | secret name |
|
||||
| kompose.volume.size | kubernetes supported volume size |
|
||||
| kompose.controller.type | deployment / daemonset / replicationcontroller |
|
||||
| kompose.image-pull-policy | kubernetes pods imagePullPolicy |
|
||||
| kompose.image-pull-secret | kubernetes secret name for imagePullSecrets |
|
||||
|
||||
**Note**: `kompose.service.type` label should be defined with `ports` only (except for headless service), otherwise `kompose` will fail.
|
||||
|
||||
@@ -350,6 +352,19 @@ services:
|
||||
- "6379"
|
||||
```
|
||||
|
||||
- `kompose.image-pull-secret` defines a kubernetes secret name for imagePullSecrets podspec field.
|
||||
This secret will be used for pulling private images.
|
||||
For example:
|
||||
|
||||
```yaml
|
||||
version: '2'
|
||||
services:
|
||||
tm-service:
|
||||
image: premium/private-image
|
||||
labels:
|
||||
kompose.image-pull-secret: "example-kubernetes-secret"
|
||||
```
|
||||
|
||||
- `kompose.volume.size` defines the requests storage's size in the PersistentVolumeClaim
|
||||
|
||||
For example:
|
||||
@@ -399,6 +414,19 @@ db:
|
||||
|
||||
Service `web` will be converted to `Deployment` as default, service `db` will be converted to `DaemonSet` because of `kompose.controller.type` label.
|
||||
|
||||
- `kompose.image-pull-policy` defines Kubernetes PodSpec imagePullPolicy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise.
|
||||
|
||||
For example:
|
||||
|
||||
```yaml
|
||||
version: '2'
|
||||
services:
|
||||
example-service:
|
||||
image: example-image
|
||||
labels:
|
||||
kompose.image-pull-policy: "Never"
|
||||
```
|
||||
|
||||
## Restart
|
||||
|
||||
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.
|
||||
|
||||
Reference in New Issue
Block a user