Support deploy update_config (#1232)

This commit is contained in:
Hang Yan 2020-01-05 19:30:41 +08:00 committed by GitHub
parent 4d864a9aab
commit e7f05588bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 602 additions and 538 deletions

View File

@ -32,7 +32,7 @@ __Glossary:__
| deploy: mode | - | - | ✓ | | |
| deploy: replicas | - | - | ✓ | Deployment.Spec.Replicas / DeploymentConfig.Spec.Replicas | |
| deploy: placement | - | - | ✓ | Pod.Spec.NodeSelector | |
| deploy: update_config | - | - | n | | |
| 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) |
| deploy: labels | - | - | ✓ | Workload.Metadata.Labels | Only applied to workload resource | |

View File

@ -19,9 +19,14 @@ package kobject
import (
dockerCliTypes "github.com/docker/cli/cli/compose/types"
"github.com/docker/libcompose/yaml"
deployapi "github.com/openshift/origin/pkg/deploy/api"
"github.com/pkg/errors"
"github.com/spf13/cast"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/util/intstr"
"path/filepath"
"time"
)
// KomposeObject holds the generic struct of Kompose transformation
@ -114,15 +119,16 @@ type ServiceConfig struct {
MemReservation yaml.MemStringorInt `compose:""`
DeployMode string `compose:""`
// DeployLabels mapping to kubernetes labels
DeployLabels map[string]string `compose:""`
TmpFs []string `compose:"tmpfs"`
Dockerfile string `compose:"dockerfile"`
Replicas int `compose:"replicas"`
GroupAdd []int64 `compose:"group_add"`
Volumes []Volumes `compose:""`
Secrets []dockerCliTypes.ServiceSecretConfig
HealthChecks HealthCheck `compose:""`
Placement map[string]string `compose:""`
DeployLabels map[string]string `compose:""`
DeployUpdateConfig dockerCliTypes.UpdateConfig `compose:""`
TmpFs []string `compose:"tmpfs"`
Dockerfile string `compose:"dockerfile"`
Replicas int `compose:"replicas"`
GroupAdd []int64 `compose:"group_add"`
Volumes []Volumes `compose:""`
Secrets []dockerCliTypes.ServiceSecretConfig
HealthChecks HealthCheck `compose:""`
Placement map[string]string `compose:""`
//This is for long LONG SYNTAX link(https://docs.docker.com/compose/compose-file/#long-syntax)
Configs []dockerCliTypes.ServiceConfigObjConfig `compose:""`
//This is for SHORT SYNTAX link(https://docs.docker.com/compose/compose-file/#configs)
@ -188,3 +194,67 @@ func (s *ServiceConfig) GetConfigMapKeyFromMeta(name string) (string, error) {
return filepath.Base(config.File), nil
}
// GetUpdateStrategy from compose update_config
// 1. only apply to Deployment, but the check is not happened here
// 2. only support `parallelism` and `order`
// return nil if not support
func (s *ServiceConfig) GetKubernetesUpdateStrategy() *extensions.RollingUpdateDeployment {
config := s.DeployUpdateConfig
r := extensions.RollingUpdateDeployment{}
if config.Order == "stop-first" {
if config.Parallelism != nil {
r.MaxUnavailable = intstr.FromInt(cast.ToInt(*config.Parallelism))
}
r.MaxSurge = intstr.FromInt(0)
return &r
}
if config.Order == "start-first" {
if config.Parallelism != nil {
r.MaxSurge = intstr.FromInt(cast.ToInt(*config.Parallelism))
}
r.MaxUnavailable = intstr.FromInt(0)
return &r
}
return nil
}
func (s *ServiceConfig) GetOCUpdateStrategy() *deployapi.RollingDeploymentStrategyParams {
config := s.DeployUpdateConfig
r := deployapi.RollingDeploymentStrategyParams{}
delay := time.Second * 1
if config.Delay != 0 {
delay = config.Delay
}
interval := cast.ToInt64(delay.Seconds())
if config.Order == "stop-first" {
if config.Parallelism != nil {
r.MaxUnavailable = intstr.FromInt(cast.ToInt(*config.Parallelism))
}
r.MaxSurge = intstr.FromInt(0)
r.UpdatePeriodSeconds = &interval
return &r
}
if config.Order == "start-first" {
if config.Parallelism != nil {
r.MaxSurge = intstr.FromInt(cast.ToInt(*config.Parallelism))
}
r.MaxUnavailable = intstr.FromInt(0)
r.UpdatePeriodSeconds = &interval
return &r
}
if cast.ToInt64(config.Delay) != 0 {
r.UpdatePeriodSeconds = &interval
return &r
}
return nil
}

View File

@ -351,6 +351,10 @@ func dockerComposeToKomposeMapping(composeObject *types.Config) (kobject.Kompose
// placement:
serviceConfig.Placement = loadV3Placement(composeServiceConfig.Deploy.Placement.Constraints)
if composeServiceConfig.Deploy.UpdateConfig != nil {
serviceConfig.DeployUpdateConfig = *composeServiceConfig.Deploy.UpdateConfig
}
// TODO: Build is not yet supported, see:
// https://github.com/docker/cli/blob/master/cli/compose/types/types.go#L9
// We will have to *manually* add this / parse.

View File

@ -411,6 +411,15 @@ func (k *Kubernetes) InitD(name string, service kobject.ServiceConfig, replicas
}
dc.Spec.Template.Labels = transformer.ConfigLabels(name)
update := service.GetKubernetesUpdateStrategy()
if update != nil {
dc.Spec.Strategy = extensions.DeploymentStrategy{
Type: extensions.RollingUpdateDeploymentStrategyType,
RollingUpdate: update,
}
log.Debugf("Set deployment '%s' rolling update: MaxSurge: %s, MaxUnavailable: %s", name, update.MaxSurge.String(), update.MaxUnavailable.String())
}
return dc
}

View File

@ -232,6 +232,16 @@ func (o *OpenShift) initDeploymentConfig(name string, service kobject.ServiceCon
},
},
}
update := service.GetOCUpdateStrategy()
if update != nil {
dc.Spec.Strategy = deployapi.DeploymentStrategy{
Type: deployapi.DeploymentStrategyTypeRolling,
RollingParams: update,
}
log.Debugf("Set deployment '%s' rolling update: MaxSurge: %s, MaxUnavailable: %s", name, update.MaxSurge.String(), update.MaxUnavailable.String())
}
return dc
}

View File

@ -652,12 +652,12 @@ convert::expect_success "$cmd" "/tmp/output-oc.json"
# Test V3 Support of Docker Compose
# Test deploy mode: global
cmd="kompose convert --stdout -j -f $KOMPOSE_ROOT/script/test/fixtures/v3/docker-compose-deploy-mode.yaml"
sed -e "s;%VERSION%;$version;g" -e "s;%CMD%;$cmd;g" "$KOMPOSE_ROOT/script/test/fixtures/v3/output-deploy-mode-k8s-template.json" > /tmp/output-k8s.json
cmd="kompose convert --stdout -j -f $KOMPOSE_ROOT/script/test/fixtures/v3/docker-compose-deploy.yaml"
sed -e "s;%VERSION%;$version;g" -e "s;%CMD%;$cmd;g" "$KOMPOSE_ROOT/script/test/fixtures/v3/output-deploy-k8s.json" > /tmp/output-k8s.json
convert::expect_success "$cmd" "/tmp/output-k8s.json"
cmd="kompose convert --stdout -j --provider=openshift -f $KOMPOSE_ROOT/script/test/fixtures/v3/docker-compose-deploy-mode.yaml"
sed -e "s;%VERSION%;$version;g" -e "s;%CMD%;$cmd;g" "$KOMPOSE_ROOT/script/test/fixtures/v3/output-deploy-mode-os-template.json" > /tmp/output-os.json
cmd="kompose convert --stdout -j --provider=openshift -f $KOMPOSE_ROOT/script/test/fixtures/v3/docker-compose-deploy.yaml"
sed -e "s;%VERSION%;$version;g" -e "s;%CMD%;$cmd;g" "$KOMPOSE_ROOT/script/test/fixtures/v3/output-deploy-os.json" > /tmp/output-os.json
convert::expect_success "$cmd" "/tmp/output-os.json"
# Test support for cpu and memory limits + reservations
@ -735,29 +735,6 @@ cmd="kompose convert -f $KOMPOSE_ROOT/script/test/fixtures/controller/docker-com
sed -e "s;%VERSION%;$version;g" -e "s;%CMD%;$cmd;g" $KOMPOSE_ROOT/script/test/fixtures/controller/output-k8s-rc-template.json > /tmp/output-k8s.json
convert::expect_success "$cmd" "/tmp/output-k8s.json"
# Test the `placement` key in v3
# Kubernetes
cmd="kompose convert --stdout -j -f $KOMPOSE_ROOT/script/test/fixtures/placement/docker-compose.yml"
sed -e "s;%VERSION%;$version;g" -e "s;%CMD%;$cmd;g" $KOMPOSE_ROOT/script/test/fixtures/placement/output-k8s-template.json > /tmp/output-k8s.json
convert::expect_success "$cmd" "/tmp/output-k8s.json"
## OpenShift
cmd="kompose convert --provider=openshift --stdout -j -f $KOMPOSE_ROOT/script/test/fixtures/placement/docker-compose.yml"
sed -e "s;%VERSION%;$version;g" -e "s;%CMD%;$cmd;g" $KOMPOSE_ROOT/script/test/fixtures/placement/output-os-template.json > /tmp/output-os.json
convert::expect_success "$cmd" "/tmp/output-os.json"
# Test the `placement` key with constraints in array in v3
# Kubernetes
cmd="kompose convert --stdout -j -f $KOMPOSE_ROOT/script/test/fixtures/placement/docker-compose-array.yml"
sed -e "s;%VERSION%;$version;g" -e "s;%CMD%;$cmd;g" $KOMPOSE_ROOT/script/test/fixtures/placement/output-k8s-array-template.json > /tmp/output-k8s.json
convert::expect_success "$cmd" "/tmp/output-k8s.json"
## OpenShift
cmd="kompose convert --provider=openshift --stdout -j -f $KOMPOSE_ROOT/script/test/fixtures/placement/docker-compose-array.yml"
sed -e "s;%VERSION%;$version;g" -e "s;%CMD%;$cmd;g" $KOMPOSE_ROOT/script/test/fixtures/placement/output-os-array-template.json > /tmp/output-os.json
convert::expect_success "$cmd" "/tmp/output-os.json"
# Test the "full example" from https://raw.githubusercontent.com/aanand/compose-file/master/loader/example1.env

View File

@ -1,8 +0,0 @@
version: '3'
services:
db:
image: postgres
deploy:
placement:
constraints: [node.hostname == machine]

View File

@ -1,10 +0,0 @@
version: '3'
services:
db:
image: postgres
deploy:
placement:
constraints:
- node.hostname == machine
- engine.labels.operatingsystem == ubuntu 14.04

View File

@ -1,60 +0,0 @@
{
"kind": "List",
"apiVersion": "v1",
"metadata": {},
"items": [
{
"apiVersion": "apps/v1",
"kind": "Deployment",
"metadata": {
"annotations": {
"kompose.cmd": "%CMD%",
"kompose.version": "%VERSION%"
},
"creationTimestamp": null,
"labels": {
"io.kompose.service": "db"
},
"name": "db"
},
"spec": {
"replicas": 1,
"selector": {
"matchLabels": {
"io.kompose.service": "db"
}
},
"strategy": {},
"template": {
"metadata": {
"annotations": {
"kompose.cmd": "%CMD%",
"kompose.version": "%VERSION%"
},
"creationTimestamp": null,
"labels": {
"io.kompose.service": "db"
}
},
"spec": {
"containers": [
{
"image": "postgres",
"imagePullPolicy": "",
"name": "db",
"resources": {}
}
],
"nodeSelector": {
"kubernetes.io/hostname": "machine"
},
"restartPolicy": "Always",
"serviceAccountName": "",
"volumes": null
}
}
},
"status": {}
}
]
}

View File

@ -1,61 +0,0 @@
{
"kind": "List",
"apiVersion": "v1",
"metadata": {},
"items": [
{
"apiVersion": "apps/v1",
"kind": "Deployment",
"metadata": {
"annotations": {
"kompose.cmd": "%CMD%",
"kompose.version": "%VERSION%"
},
"creationTimestamp": null,
"labels": {
"io.kompose.service": "db"
},
"name": "db"
},
"spec": {
"replicas": 1,
"selector": {
"matchLabels": {
"io.kompose.service": "db"
}
},
"strategy": {},
"template": {
"metadata": {
"annotations": {
"kompose.cmd": "%CMD%",
"kompose.version": "%VERSION%"
},
"creationTimestamp": null,
"labels": {
"io.kompose.service": "db"
}
},
"spec": {
"containers": [
{
"image": "postgres",
"imagePullPolicy": "",
"name": "db",
"resources": {}
}
],
"nodeSelector": {
"beta.kubernetes.io/os": "ubuntu 14.04",
"kubernetes.io/hostname": "machine"
},
"restartPolicy": "Always",
"serviceAccountName": "",
"volumes": null
}
}
},
"status": {}
}
]
}

View File

@ -1,100 +0,0 @@
{
"kind": "List",
"apiVersion": "v1",
"metadata": {},
"items": [
{
"kind": "DeploymentConfig",
"apiVersion": "v1",
"metadata": {
"name": "db",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "db"
},
"annotations": {
"kompose.cmd": "%CMD%",
"kompose.version": "%VERSION%"
}
},
"spec": {
"strategy": {
"resources": {}
},
"triggers": [
{
"type": "ConfigChange"
},
{
"type": "ImageChange",
"imageChangeParams": {
"automatic": true,
"containerNames": [
"db"
],
"from": {
"kind": "ImageStreamTag",
"name": "db:latest"
}
}
}
],
"replicas": 1,
"test": false,
"selector": {
"io.kompose.service": "db"
},
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"io.kompose.service": "db"
}
},
"spec": {
"containers": [
{
"name": "db",
"image": " ",
"resources": {}
}
],
"restartPolicy": "Always",
"nodeSelector": {
"kubernetes.io/hostname": "machine"
}
}
}
},
"status": {}
},
{
"kind": "ImageStream",
"apiVersion": "v1",
"metadata": {
"name": "db",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "db"
}
},
"spec": {
"tags": [
{
"name": "latest",
"annotations": null,
"from": {
"kind": "DockerImage",
"name": "postgres"
},
"generation": null,
"importPolicy": {}
}
]
},
"status": {
"dockerImageRepository": ""
}
}
]
}

View File

@ -1,101 +0,0 @@
{
"kind": "List",
"apiVersion": "v1",
"metadata": {},
"items": [
{
"kind": "DeploymentConfig",
"apiVersion": "v1",
"metadata": {
"name": "db",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "db"
},
"annotations": {
"kompose.cmd": "%CMD%",
"kompose.version": "%VERSION%"
}
},
"spec": {
"strategy": {
"resources": {}
},
"triggers": [
{
"type": "ConfigChange"
},
{
"type": "ImageChange",
"imageChangeParams": {
"automatic": true,
"containerNames": [
"db"
],
"from": {
"kind": "ImageStreamTag",
"name": "db:latest"
}
}
}
],
"replicas": 1,
"test": false,
"selector": {
"io.kompose.service": "db"
},
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"io.kompose.service": "db"
}
},
"spec": {
"containers": [
{
"name": "db",
"image": " ",
"resources": {}
}
],
"restartPolicy": "Always",
"nodeSelector": {
"beta.kubernetes.io/os": "ubuntu 14.04",
"kubernetes.io/hostname": "machine"
}
}
}
},
"status": {}
},
{
"kind": "ImageStream",
"apiVersion": "v1",
"metadata": {
"name": "db",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "db"
}
},
"spec": {
"tags": [
{
"name": "latest",
"annotations": null,
"from": {
"kind": "DockerImage",
"name": "postgres"
},
"generation": null,
"importPolicy": {}
}
]
},
"status": {
"dockerImageRepository": ""
}
}
]
}

View File

@ -1,12 +0,0 @@
version: "3"
services:
foo:
labels:
kompose.service.type: headless
deploy:
mode: global
replicas: 6
labels:
com.example.description: "This label will appear on the web service"
image: redis

View File

@ -0,0 +1,34 @@
version: "3.7"
services:
vote: # test placement and update_config
image: dockersamples/examplevotingapp_vote:before
depends_on:
- redis
deploy:
replicas: 2
placement:
constraints: [node.hostname == machine]
update_config:
parallelism: 2
delay: 10s
order: stop-first
db: # test placement
image: postgres
deploy:
placement:
constraints:
- node.hostname == machine
- engine.labels.operatingsystem == ubuntu 14.04
foo: # test labels
labels:
kompose.service.type: headless
deploy:
mode: global
replicas: 6
update_config:
parallelism: 2
delay: 10s
order: stop-first
labels:
com.example.description: "This label will appear on the web service"
image: redis

View File

@ -35,6 +35,60 @@
"loadBalancer": {}
}
},
{
"apiVersion": "apps/v1",
"kind": "Deployment",
"metadata": {
"annotations": {
"kompose.cmd": "%CMD%",
"kompose.version": "%VERSION%"
},
"creationTimestamp": null,
"labels": {
"io.kompose.service": "db"
},
"name": "db"
},
"spec": {
"replicas": 1,
"selector": {
"matchLabels": {
"io.kompose.service": "db"
}
},
"strategy": {},
"template": {
"metadata": {
"annotations": {
"kompose.cmd": "%CMD%",
"kompose.version": "%VERSION%"
},
"creationTimestamp": null,
"labels": {
"io.kompose.service": "db"
}
},
"spec": {
"containers": [
{
"image": "postgres",
"imagePullPolicy": "",
"name": "db",
"resources": {}
}
],
"nodeSelector": {
"beta.kubernetes.io/os": "ubuntu 14.04",
"kubernetes.io/hostname": "machine"
},
"restartPolicy": "Always",
"serviceAccountName": "",
"volumes": null
}
}
},
"status": {}
},
{
"apiVersion": "apps/v1",
"kind": "DaemonSet",
@ -81,95 +135,63 @@
}
},
{
"kind": "DeploymentConfig",
"apiVersion": "v1",
"apiVersion": "apps/v1",
"kind": "Deployment",
"metadata": {
"name": "foo",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "foo"
},
"annotations": {
"kompose.cmd": "%CMD%",
"kompose.service.type": "headless",
"kompose.version": "%VERSION%"
}
},
"creationTimestamp": null,
"labels": {
"io.kompose.service": "vote"
},
"name": "vote"
},
"spec": {
"strategy": {
"resources": {}
},
"triggers": [
{
"type": "ConfigChange"
},
{
"type": "ImageChange",
"imageChangeParams": {
"automatic": true,
"containerNames": [
"foo"
],
"from": {
"kind": "ImageStreamTag",
"name": "foo:latest"
}
}
}
],
"replicas": 1,
"test": false,
"replicas": 2,
"selector": {
"io.kompose.service": "foo"
"matchLabels": {
"io.kompose.service": "vote"
}
},
"strategy": {
"rollingUpdate": {
"maxSurge": 0,
"maxUnavailable": 2
},
"type": "RollingUpdate"
},
"template": {
"metadata": {
"annotations": {
"kompose.cmd": "%CMD%",
"kompose.version": "%VERSION%"
},
"creationTimestamp": null,
"labels": {
"io.kompose.service": "foo"
"io.kompose.service": "vote"
}
},
"spec": {
"containers": [
{
"name": "foo",
"image": " ",
"image": "dockersamples/examplevotingapp_vote:before",
"imagePullPolicy": "",
"name": "vote",
"resources": {}
}
],
"restartPolicy": "Always"
"nodeSelector": {
"kubernetes.io/hostname": "machine"
},
"restartPolicy": "Always",
"serviceAccountName": "",
"volumes": null
}
}
},
"status": {}
},
{
"kind": "ImageStream",
"apiVersion": "v1",
"metadata": {
"name": "foo",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "foo"
}
},
"spec": {
"tags": [
{
"name": "latest",
"annotations": null,
"from": {
"kind": "DockerImage",
"name": "redis"
},
"generation": null,
"importPolicy": {}
}
]
},
"status": {
"dockerImageRepository": ""
}
}
]
}

View File

@ -1,84 +0,0 @@
{
"kind": "List",
"apiVersion": "v1",
"metadata": {},
"items": [
{
"kind": "Service",
"apiVersion": "v1",
"metadata": {
"name": "foo",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "foo"
},
"annotations": {
"kompose.cmd": "%CMD%",
"kompose.service.type": "headless",
"kompose.version": "%VERSION%"
}
},
"spec": {
"ports": [
{
"name": "headless",
"port": 55555,
"targetPort": 0
}
],
"selector": {
"io.kompose.service": "foo"
},
"clusterIP": "None"
},
"status": {
"loadBalancer": {}
}
},
{
"apiVersion": "apps/v1",
"kind": "DaemonSet",
"metadata": {
"annotations": {
"kompose.cmd": "%CMD%",
"kompose.service.type": "headless",
"kompose.version": "%VERSION%"
},
"creationTimestamp": null,
"labels": {
"com.example.description": "This label will appear on the web service",
"io.kompose.service": "foo"
},
"name": "foo"
},
"spec": {
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"io.kompose.service": "foo"
}
},
"spec": {
"containers": [
{
"image": "redis",
"imagePullPolicy": "",
"name": "foo",
"resources": {}
}
],
"restartPolicy": "Always",
"serviceAccountName": "",
"volumes": null
}
}
},
"status": {
"currentNumberScheduled": 0,
"desiredNumberScheduled": 0,
"numberMisscheduled": 0
}
}
]
}

View File

@ -0,0 +1,374 @@
{
"kind": "List",
"apiVersion": "v1",
"metadata": {},
"items": [
{
"kind": "Service",
"apiVersion": "v1",
"metadata": {
"name": "foo",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "foo"
},
"annotations": {
"kompose.cmd": "%CMD%",
"kompose.service.type": "headless",
"kompose.version": "%VERSION%"
}
},
"spec": {
"ports": [
{
"name": "headless",
"port": 55555,
"targetPort": 0
}
],
"selector": {
"io.kompose.service": "foo"
},
"clusterIP": "None"
},
"status": {
"loadBalancer": {}
}
},
{
"kind": "DeploymentConfig",
"apiVersion": "v1",
"metadata": {
"name": "db",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "db"
},
"annotations": {
"kompose.cmd": "%CMD%",
"kompose.version": "%VERSION%"
}
},
"spec": {
"strategy": {
"resources": {}
},
"triggers": [
{
"type": "ConfigChange"
},
{
"type": "ImageChange",
"imageChangeParams": {
"automatic": true,
"containerNames": [
"db"
],
"from": {
"kind": "ImageStreamTag",
"name": "db:latest"
}
}
}
],
"replicas": 1,
"test": false,
"selector": {
"io.kompose.service": "db"
},
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"io.kompose.service": "db"
}
},
"spec": {
"containers": [
{
"name": "db",
"image": " ",
"resources": {}
}
],
"restartPolicy": "Always",
"nodeSelector": {
"beta.kubernetes.io/os": "ubuntu 14.04",
"kubernetes.io/hostname": "machine"
}
}
}
},
"status": {}
},
{
"kind": "ImageStream",
"apiVersion": "v1",
"metadata": {
"name": "db",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "db"
}
},
"spec": {
"tags": [
{
"name": "latest",
"annotations": null,
"from": {
"kind": "DockerImage",
"name": "postgres"
},
"generation": null,
"importPolicy": {}
}
]
},
"status": {
"dockerImageRepository": ""
}
},
{
"apiVersion": "apps/v1",
"kind": "DaemonSet",
"metadata": {
"annotations": {
"kompose.cmd": "%CMD%",
"kompose.service.type": "headless",
"kompose.version": "%VERSION%"
},
"creationTimestamp": null,
"labels": {
"com.example.description": "This label will appear on the web service",
"io.kompose.service": "foo"
},
"name": "foo"
},
"spec": {
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"io.kompose.service": "foo"
}
},
"spec": {
"containers": [
{
"image": "redis",
"imagePullPolicy": "",
"name": "foo",
"resources": {}
}
],
"restartPolicy": "Always",
"serviceAccountName": "",
"volumes": null
}
}
},
"status": {
"currentNumberScheduled": 0,
"desiredNumberScheduled": 0,
"numberMisscheduled": 0
}
},
{
"kind": "DeploymentConfig",
"apiVersion": "v1",
"metadata": {
"name": "foo",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "foo"
},
"annotations": {
"kompose.cmd": "%CMD%",
"kompose.service.type": "headless",
"kompose.version": "%VERSION%"
}
},
"spec": {
"strategy": {
"type": "Rolling",
"rollingParams": {
"updatePeriodSeconds": 10,
"maxUnavailable": 2,
"maxSurge": 0
},
"resources": {}
},
"triggers": [
{
"type": "ConfigChange"
},
{
"type": "ImageChange",
"imageChangeParams": {
"automatic": true,
"containerNames": [
"foo"
],
"from": {
"kind": "ImageStreamTag",
"name": "foo:latest"
}
}
}
],
"replicas": 1,
"test": false,
"selector": {
"io.kompose.service": "foo"
},
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"io.kompose.service": "foo"
}
},
"spec": {
"containers": [
{
"name": "foo",
"image": " ",
"resources": {}
}
],
"restartPolicy": "Always"
}
}
},
"status": {}
},
{
"kind": "ImageStream",
"apiVersion": "v1",
"metadata": {
"name": "foo",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "foo"
}
},
"spec": {
"tags": [
{
"name": "latest",
"annotations": null,
"from": {
"kind": "DockerImage",
"name": "redis"
},
"generation": null,
"importPolicy": {}
}
]
},
"status": {
"dockerImageRepository": ""
}
},
{
"kind": "DeploymentConfig",
"apiVersion": "v1",
"metadata": {
"name": "vote",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "vote"
},
"annotations": {
"kompose.cmd": "%CMD%",
"kompose.version": "%VERSION%"
}
},
"spec": {
"strategy": {
"type": "Rolling",
"rollingParams": {
"updatePeriodSeconds": 10,
"maxUnavailable": 2,
"maxSurge": 0
},
"resources": {}
},
"triggers": [
{
"type": "ConfigChange"
},
{
"type": "ImageChange",
"imageChangeParams": {
"automatic": true,
"containerNames": [
"vote"
],
"from": {
"kind": "ImageStreamTag",
"name": "vote:before"
}
}
}
],
"replicas": 2,
"test": false,
"selector": {
"io.kompose.service": "vote"
},
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"io.kompose.service": "vote"
}
},
"spec": {
"containers": [
{
"name": "vote",
"image": " ",
"resources": {}
}
],
"restartPolicy": "Always",
"nodeSelector": {
"kubernetes.io/hostname": "machine"
}
}
}
},
"status": {}
},
{
"kind": "ImageStream",
"apiVersion": "v1",
"metadata": {
"name": "vote",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "vote"
}
},
"spec": {
"tags": [
{
"name": "before",
"annotations": null,
"from": {
"kind": "DockerImage",
"name": "dockersamples/examplevotingapp_vote:before"
},
"generation": null,
"importPolicy": {}
}
]
},
"status": {
"dockerImageRepository": ""
}
}
]
}