forked from LaconicNetwork/kompose
Merge pull request #666 from surajnarwade/add-restart-policy-v3
added support for `restart-policy` keys in v3
This commit is contained in:
commit
14dbb30735
@ -183,7 +183,6 @@ func dockerComposeToKomposeMapping(composeObject *types.Config) (kobject.Kompose
|
|||||||
serviceConfig.CapDrop = composeServiceConfig.CapDrop
|
serviceConfig.CapDrop = composeServiceConfig.CapDrop
|
||||||
serviceConfig.Expose = composeServiceConfig.Expose
|
serviceConfig.Expose = composeServiceConfig.Expose
|
||||||
serviceConfig.Privileged = composeServiceConfig.Privileged
|
serviceConfig.Privileged = composeServiceConfig.Privileged
|
||||||
serviceConfig.Restart = composeServiceConfig.Restart
|
|
||||||
serviceConfig.User = composeServiceConfig.User
|
serviceConfig.User = composeServiceConfig.User
|
||||||
serviceConfig.Stdin = composeServiceConfig.StdinOpen
|
serviceConfig.Stdin = composeServiceConfig.StdinOpen
|
||||||
serviceConfig.Tty = composeServiceConfig.Tty
|
serviceConfig.Tty = composeServiceConfig.Tty
|
||||||
@ -203,7 +202,12 @@ func dockerComposeToKomposeMapping(composeObject *types.Config) (kobject.Kompose
|
|||||||
if (composeServiceConfig.Deploy.Resources != types.Resources{}) {
|
if (composeServiceConfig.Deploy.Resources != types.Resources{}) {
|
||||||
serviceConfig.MemLimit = libcomposeyaml.MemStringorInt(composeServiceConfig.Deploy.Resources.Limits.MemoryBytes)
|
serviceConfig.MemLimit = libcomposeyaml.MemStringorInt(composeServiceConfig.Deploy.Resources.Limits.MemoryBytes)
|
||||||
}
|
}
|
||||||
|
//Here we handle all Docker Compose Deploy keys
|
||||||
|
|
||||||
|
//Handling restart-policy
|
||||||
|
if composeServiceConfig.Deploy.RestartPolicy != nil {
|
||||||
|
serviceConfig.Restart = composeServiceConfig.Deploy.RestartPolicy.Condition
|
||||||
|
}
|
||||||
// POOF. volumes_From is gone in v3. docker/cli will error out of volumes_from is added in v3
|
// POOF. volumes_From is gone in v3. docker/cli will error out of volumes_from is added in v3
|
||||||
// serviceConfig.VolumesFrom = composeServiceConfig.VolumesFrom
|
// serviceConfig.VolumesFrom = composeServiceConfig.VolumesFrom
|
||||||
|
|
||||||
|
|||||||
@ -441,9 +441,9 @@ func (k *Kubernetes) UpdateKubernetesObjects(name string, service kobject.Servic
|
|||||||
|
|
||||||
// Configure the container restart policy.
|
// Configure the container restart policy.
|
||||||
switch service.Restart {
|
switch service.Restart {
|
||||||
case "", "always":
|
case "", "always", "any":
|
||||||
template.Spec.RestartPolicy = api.RestartPolicyAlways
|
template.Spec.RestartPolicy = api.RestartPolicyAlways
|
||||||
case "no":
|
case "no", "none":
|
||||||
template.Spec.RestartPolicy = api.RestartPolicyNever
|
template.Spec.RestartPolicy = api.RestartPolicyNever
|
||||||
case "on-failure":
|
case "on-failure":
|
||||||
template.Spec.RestartPolicy = api.RestartPolicyOnFailure
|
template.Spec.RestartPolicy = api.RestartPolicyOnFailure
|
||||||
|
|||||||
@ -39,7 +39,7 @@ services:
|
|||||||
cpus: '0.0001'
|
cpus: '0.0001'
|
||||||
memory: 20M
|
memory: 20M
|
||||||
restart_policy:
|
restart_policy:
|
||||||
condition: on_failure
|
condition: on-failure
|
||||||
delay: 5s
|
delay: 5s
|
||||||
max_attempts: 3
|
max_attempts: 3
|
||||||
window: 120s
|
window: 120s
|
||||||
|
|||||||
494
script/test/fixtures/v3/output-k8s-full-example.json
vendored
494
script/test/fixtures/v3/output-k8s-full-example.json
vendored
@ -4,372 +4,212 @@
|
|||||||
"metadata": {},
|
"metadata": {},
|
||||||
"items": [
|
"items": [
|
||||||
{
|
{
|
||||||
"kind": "Service",
|
"kind": "Pod",
|
||||||
"apiVersion": "v1",
|
"apiVersion": "v1",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"name": "foo",
|
"name": "foo",
|
||||||
"creationTimestamp": null,
|
"creationTimestamp": null,
|
||||||
"labels": {
|
"labels": {
|
||||||
"io.kompose.service": "foo"
|
"io.kompose.service": "foo"
|
||||||
},
|
|
||||||
"annotations": {
|
|
||||||
"com.example.description": "Accounting webapp",
|
|
||||||
"com.example.empty-label": "",
|
|
||||||
"com.example.number": "42"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"spec": {
|
"spec": {
|
||||||
"ports": [
|
"volumes": [
|
||||||
{
|
{
|
||||||
"name": "3000",
|
"name": "foo-claim0",
|
||||||
"port": 3000,
|
"persistentVolumeClaim": {
|
||||||
"targetPort": 3000
|
"claimName": "foo-claim0"
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "3000",
|
|
||||||
"port": 3000,
|
|
||||||
"targetPort": 3000
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "3001",
|
|
||||||
"port": 3001,
|
|
||||||
"targetPort": 3001
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "3002",
|
|
||||||
"port": 3002,
|
|
||||||
"targetPort": 3002
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "3003",
|
|
||||||
"port": 3003,
|
|
||||||
"targetPort": 3003
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "3004",
|
|
||||||
"port": 3004,
|
|
||||||
"targetPort": 3004
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "3005",
|
|
||||||
"port": 3005,
|
|
||||||
"targetPort": 3005
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "8000",
|
|
||||||
"port": 8000,
|
|
||||||
"targetPort": 8000
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "9090",
|
|
||||||
"port": 9090,
|
|
||||||
"targetPort": 8080
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "9091",
|
|
||||||
"port": 9091,
|
|
||||||
"targetPort": 8081
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "49100",
|
|
||||||
"port": 49100,
|
|
||||||
"targetPort": 22
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "8001",
|
|
||||||
"port": 8001,
|
|
||||||
"targetPort": 8001
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "5000",
|
|
||||||
"port": 5000,
|
|
||||||
"targetPort": 5000
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "5001",
|
|
||||||
"port": 5001,
|
|
||||||
"targetPort": 5001
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "5002",
|
|
||||||
"port": 5002,
|
|
||||||
"targetPort": 5002
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "5003",
|
|
||||||
"port": 5003,
|
|
||||||
"targetPort": 5003
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "5004",
|
|
||||||
"port": 5004,
|
|
||||||
"targetPort": 5004
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "5005",
|
|
||||||
"port": 5005,
|
|
||||||
"targetPort": 5005
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "5006",
|
|
||||||
"port": 5006,
|
|
||||||
"targetPort": 5006
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "5007",
|
|
||||||
"port": 5007,
|
|
||||||
"targetPort": 5007
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "5008",
|
|
||||||
"port": 5008,
|
|
||||||
"targetPort": 5008
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "5009",
|
|
||||||
"port": 5009,
|
|
||||||
"targetPort": 5009
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "5010",
|
|
||||||
"port": 5010,
|
|
||||||
"targetPort": 5010
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"selector": {
|
|
||||||
"io.kompose.service": "foo"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"status": {
|
|
||||||
"loadBalancer": {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"kind": "Deployment",
|
|
||||||
"apiVersion": "extensions/v1beta1",
|
|
||||||
"metadata": {
|
|
||||||
"name": "foo",
|
|
||||||
"creationTimestamp": null,
|
|
||||||
"labels": {
|
|
||||||
"io.kompose.service": "foo"
|
|
||||||
},
|
|
||||||
"annotations": {
|
|
||||||
"com.example.description": "Accounting webapp",
|
|
||||||
"com.example.empty-label": "",
|
|
||||||
"com.example.number": "42"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"spec": {
|
|
||||||
"replicas": 6,
|
|
||||||
"template": {
|
|
||||||
"metadata": {
|
|
||||||
"creationTimestamp": null,
|
|
||||||
"labels": {
|
|
||||||
"io.kompose.service": "foo"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"spec": {
|
{
|
||||||
"volumes": [
|
"name": "foo-claim1",
|
||||||
|
"persistentVolumeClaim": {
|
||||||
|
"claimName": "foo-claim1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "foo-claim2",
|
||||||
|
"persistentVolumeClaim": {
|
||||||
|
"claimName": "foo-claim2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "foo-claim3",
|
||||||
|
"persistentVolumeClaim": {
|
||||||
|
"claimName": "foo-claim3"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "foo-claim4",
|
||||||
|
"persistentVolumeClaim": {
|
||||||
|
"claimName": "foo-claim4",
|
||||||
|
"readOnly": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "datavolume",
|
||||||
|
"persistentVolumeClaim": {
|
||||||
|
"claimName": "datavolume"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "foo-tmpfs0",
|
||||||
|
"emptyDir": {
|
||||||
|
"medium": "Memory"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "foo-tmpfs1",
|
||||||
|
"emptyDir": {
|
||||||
|
"medium": "Memory"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"containers": [
|
||||||
|
{
|
||||||
|
"name": "my-web-container",
|
||||||
|
"image": "redis",
|
||||||
|
"command": [
|
||||||
|
"/code/entrypoint.sh",
|
||||||
|
"-p",
|
||||||
|
"3000"
|
||||||
|
],
|
||||||
|
"args": [
|
||||||
|
"bundle",
|
||||||
|
"exec",
|
||||||
|
"thin",
|
||||||
|
"-p",
|
||||||
|
"3000"
|
||||||
|
],
|
||||||
|
"workingDir": "/code",
|
||||||
|
"ports": [
|
||||||
|
{
|
||||||
|
"containerPort": 3000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"containerPort": 3000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"containerPort": 3001
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"containerPort": 3002
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"containerPort": 3003
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"containerPort": 3004
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"containerPort": 3005
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"containerPort": 8000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"containerPort": 8080
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"containerPort": 8081
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"containerPort": 22
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"containerPort": 8001
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"containerPort": 5000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"containerPort": 5001
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"containerPort": 5002
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"containerPort": 5003
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"containerPort": 5004
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"containerPort": 5005
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"containerPort": 5006
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"containerPort": 5007
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"containerPort": 5008
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"containerPort": 5009
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"containerPort": 5010
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"resources": {
|
||||||
|
"limits": {
|
||||||
|
"memory": "52428800"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"volumeMounts": [
|
||||||
{
|
{
|
||||||
"name": "foo-claim0",
|
"name": "foo-claim0",
|
||||||
"persistentVolumeClaim": {
|
"mountPath": "/var/lib/mysql"
|
||||||
"claimName": "foo-claim0"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "foo-claim1",
|
"name": "foo-claim1",
|
||||||
"persistentVolumeClaim": {
|
"mountPath": "/var/lib/mysql"
|
||||||
"claimName": "foo-claim1"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "foo-claim2",
|
"name": "foo-claim2",
|
||||||
"persistentVolumeClaim": {
|
"mountPath": "/code"
|
||||||
"claimName": "foo-claim2"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "foo-claim3",
|
"name": "foo-claim3",
|
||||||
"persistentVolumeClaim": {
|
"mountPath": "/var/www/html"
|
||||||
"claimName": "foo-claim3"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "foo-claim4",
|
"name": "foo-claim4",
|
||||||
"persistentVolumeClaim": {
|
"readOnly": true,
|
||||||
"claimName": "foo-claim4",
|
"mountPath": "/etc/configs/"
|
||||||
"readOnly": true
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "datavolume",
|
"name": "datavolume",
|
||||||
"persistentVolumeClaim": {
|
"mountPath": "/var/lib/mysql"
|
||||||
"claimName": "datavolume"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "foo-tmpfs0",
|
"name": "foo-tmpfs0",
|
||||||
"emptyDir": {
|
"mountPath": "/run"
|
||||||
"medium": "Memory"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "foo-tmpfs1",
|
"name": "foo-tmpfs1",
|
||||||
"emptyDir": {
|
"mountPath": "/tmp"
|
||||||
"medium": "Memory"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"containers": [
|
"securityContext": {
|
||||||
{
|
"capabilities": {
|
||||||
"name": "my-web-container",
|
"add": [
|
||||||
"image": "redis",
|
"ALL"
|
||||||
"command": [
|
|
||||||
"/code/entrypoint.sh",
|
|
||||||
"-p",
|
|
||||||
"3000"
|
|
||||||
],
|
],
|
||||||
"args": [
|
"drop": [
|
||||||
"bundle",
|
"NET_ADMIN",
|
||||||
"exec",
|
"SYS_ADMIN"
|
||||||
"thin",
|
]
|
||||||
"-p",
|
},
|
||||||
"3000"
|
"privileged": true
|
||||||
],
|
},
|
||||||
"workingDir": "/code",
|
"stdin": true,
|
||||||
"ports": [
|
"tty": true
|
||||||
{
|
|
||||||
"containerPort": 3000
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"containerPort": 3000
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"containerPort": 3001
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"containerPort": 3002
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"containerPort": 3003
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"containerPort": 3004
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"containerPort": 3005
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"containerPort": 8000
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"containerPort": 8080
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"containerPort": 8081
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"containerPort": 22
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"containerPort": 8001
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"containerPort": 5000
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"containerPort": 5001
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"containerPort": 5002
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"containerPort": 5003
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"containerPort": 5004
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"containerPort": 5005
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"containerPort": 5006
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"containerPort": 5007
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"containerPort": 5008
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"containerPort": 5009
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"containerPort": 5010
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"resources": {
|
|
||||||
"limits": {
|
|
||||||
"memory": "52428800"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"volumeMounts": [
|
|
||||||
{
|
|
||||||
"name": "foo-claim0",
|
|
||||||
"mountPath": "/var/lib/mysql"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "foo-claim1",
|
|
||||||
"mountPath": "/var/lib/mysql"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "foo-claim2",
|
|
||||||
"mountPath": "/code"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "foo-claim3",
|
|
||||||
"mountPath": "/var/www/html"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "foo-claim4",
|
|
||||||
"readOnly": true,
|
|
||||||
"mountPath": "/etc/configs/"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "datavolume",
|
|
||||||
"mountPath": "/var/lib/mysql"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "foo-tmpfs0",
|
|
||||||
"mountPath": "/run"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "foo-tmpfs1",
|
|
||||||
"mountPath": "/tmp"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"securityContext": {
|
|
||||||
"capabilities": {
|
|
||||||
"add": [
|
|
||||||
"ALL"
|
|
||||||
],
|
|
||||||
"drop": [
|
|
||||||
"NET_ADMIN",
|
|
||||||
"SYS_ADMIN"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"privileged": true
|
|
||||||
},
|
|
||||||
"stdin": true,
|
|
||||||
"tty": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"restartPolicy": "Always"
|
|
||||||
}
|
}
|
||||||
},
|
],
|
||||||
"strategy": {
|
"restartPolicy": "OnFailure"
|
||||||
"type": "Recreate"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"status": {}
|
"status": {}
|
||||||
},
|
},
|
||||||
|
|||||||
513
script/test/fixtures/v3/output-os-full-example.json
vendored
513
script/test/fixtures/v3/output-os-full-example.json
vendored
@ -4,426 +4,215 @@
|
|||||||
"metadata": {},
|
"metadata": {},
|
||||||
"items": [
|
"items": [
|
||||||
{
|
{
|
||||||
"kind": "Service",
|
"kind": "Pod",
|
||||||
"apiVersion": "v1",
|
"apiVersion": "v1",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"name": "foo",
|
"name": "foo",
|
||||||
"creationTimestamp": null,
|
"creationTimestamp": null,
|
||||||
"labels": {
|
"labels": {
|
||||||
"io.kompose.service": "foo"
|
"io.kompose.service": "foo"
|
||||||
},
|
|
||||||
"annotations": {
|
|
||||||
"com.example.description": "Accounting webapp",
|
|
||||||
"com.example.empty-label": "",
|
|
||||||
"com.example.number": "42"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"spec": {
|
"spec": {
|
||||||
"ports": [
|
"volumes": [
|
||||||
{
|
{
|
||||||
"name": "3000",
|
"name": "foo-claim0",
|
||||||
"port": 3000,
|
"persistentVolumeClaim": {
|
||||||
"targetPort": 3000
|
"claimName": "foo-claim0"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "3000",
|
"name": "foo-claim1",
|
||||||
"port": 3000,
|
"persistentVolumeClaim": {
|
||||||
"targetPort": 3000
|
"claimName": "foo-claim1"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "3001",
|
"name": "foo-claim2",
|
||||||
"port": 3001,
|
"persistentVolumeClaim": {
|
||||||
"targetPort": 3001
|
"claimName": "foo-claim2"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "3002",
|
"name": "foo-claim3",
|
||||||
"port": 3002,
|
"persistentVolumeClaim": {
|
||||||
"targetPort": 3002
|
"claimName": "foo-claim3"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "3003",
|
"name": "foo-claim4",
|
||||||
"port": 3003,
|
"persistentVolumeClaim": {
|
||||||
"targetPort": 3003
|
"claimName": "foo-claim4",
|
||||||
|
"readOnly": true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "3004",
|
"name": "datavolume",
|
||||||
"port": 3004,
|
"persistentVolumeClaim": {
|
||||||
"targetPort": 3004
|
"claimName": "datavolume"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "3005",
|
"name": "foo-tmpfs0",
|
||||||
"port": 3005,
|
"emptyDir": {
|
||||||
"targetPort": 3005
|
"medium": "Memory"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "8000",
|
"name": "foo-tmpfs1",
|
||||||
"port": 8000,
|
"emptyDir": {
|
||||||
"targetPort": 8000
|
"medium": "Memory"
|
||||||
},
|
}
|
||||||
{
|
|
||||||
"name": "9090",
|
|
||||||
"port": 9090,
|
|
||||||
"targetPort": 8080
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "9091",
|
|
||||||
"port": 9091,
|
|
||||||
"targetPort": 8081
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "49100",
|
|
||||||
"port": 49100,
|
|
||||||
"targetPort": 22
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "8001",
|
|
||||||
"port": 8001,
|
|
||||||
"targetPort": 8001
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "5000",
|
|
||||||
"port": 5000,
|
|
||||||
"targetPort": 5000
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "5001",
|
|
||||||
"port": 5001,
|
|
||||||
"targetPort": 5001
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "5002",
|
|
||||||
"port": 5002,
|
|
||||||
"targetPort": 5002
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "5003",
|
|
||||||
"port": 5003,
|
|
||||||
"targetPort": 5003
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "5004",
|
|
||||||
"port": 5004,
|
|
||||||
"targetPort": 5004
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "5005",
|
|
||||||
"port": 5005,
|
|
||||||
"targetPort": 5005
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "5006",
|
|
||||||
"port": 5006,
|
|
||||||
"targetPort": 5006
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "5007",
|
|
||||||
"port": 5007,
|
|
||||||
"targetPort": 5007
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "5008",
|
|
||||||
"port": 5008,
|
|
||||||
"targetPort": 5008
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "5009",
|
|
||||||
"port": 5009,
|
|
||||||
"targetPort": 5009
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "5010",
|
|
||||||
"port": 5010,
|
|
||||||
"targetPort": 5010
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"selector": {
|
"containers": [
|
||||||
"io.kompose.service": "foo"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"status": {
|
|
||||||
"loadBalancer": {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"kind": "DeploymentConfig",
|
|
||||||
"apiVersion": "v1",
|
|
||||||
"metadata": {
|
|
||||||
"name": "foo",
|
|
||||||
"creationTimestamp": null,
|
|
||||||
"labels": {
|
|
||||||
"io.kompose.service": "foo"
|
|
||||||
},
|
|
||||||
"annotations": {
|
|
||||||
"com.example.description": "Accounting webapp",
|
|
||||||
"com.example.empty-label": "",
|
|
||||||
"com.example.number": "42"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"spec": {
|
|
||||||
"strategy": {
|
|
||||||
"type": "Recreate",
|
|
||||||
"resources": {}
|
|
||||||
},
|
|
||||||
"triggers": [
|
|
||||||
{
|
{
|
||||||
"type": "ConfigChange"
|
"name": "my-web-container",
|
||||||
},
|
"image": "redis",
|
||||||
{
|
"command": [
|
||||||
"type": "ImageChange",
|
"/code/entrypoint.sh",
|
||||||
"imageChangeParams": {
|
"-p",
|
||||||
"automatic": true,
|
"3000"
|
||||||
"containerNames": [
|
],
|
||||||
"my-web-container"
|
"args": [
|
||||||
],
|
"bundle",
|
||||||
"from": {
|
"exec",
|
||||||
"kind": "ImageStreamTag",
|
"thin",
|
||||||
"name": "foo:latest"
|
"-p",
|
||||||
|
"3000"
|
||||||
|
],
|
||||||
|
"workingDir": "/code",
|
||||||
|
"ports": [
|
||||||
|
{
|
||||||
|
"containerPort": 3000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"containerPort": 3000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"containerPort": 3001
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"containerPort": 3002
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"containerPort": 3003
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"containerPort": 3004
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"containerPort": 3005
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"containerPort": 8000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"containerPort": 8080
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"containerPort": 8081
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"containerPort": 22
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"containerPort": 8001
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"containerPort": 5000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"containerPort": 5001
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"containerPort": 5002
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"containerPort": 5003
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"containerPort": 5004
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"containerPort": 5005
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"containerPort": 5006
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"containerPort": 5007
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"containerPort": 5008
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"containerPort": 5009
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"containerPort": 5010
|
||||||
}
|
}
|
||||||
}
|
],
|
||||||
}
|
"resources": {
|
||||||
],
|
"limits": {
|
||||||
"replicas": 6,
|
"memory": "52428800"
|
||||||
"test": false,
|
}
|
||||||
"selector": {
|
},
|
||||||
"io.kompose.service": "foo"
|
"volumeMounts": [
|
||||||
},
|
|
||||||
"template": {
|
|
||||||
"metadata": {
|
|
||||||
"creationTimestamp": null,
|
|
||||||
"labels": {
|
|
||||||
"io.kompose.service": "foo"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"spec": {
|
|
||||||
"volumes": [
|
|
||||||
{
|
{
|
||||||
"name": "foo-claim0",
|
"name": "foo-claim0",
|
||||||
"persistentVolumeClaim": {
|
"mountPath": "/var/lib/mysql"
|
||||||
"claimName": "foo-claim0"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "foo-claim1",
|
"name": "foo-claim1",
|
||||||
"persistentVolumeClaim": {
|
"mountPath": "/var/lib/mysql"
|
||||||
"claimName": "foo-claim1"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "foo-claim2",
|
"name": "foo-claim2",
|
||||||
"persistentVolumeClaim": {
|
"mountPath": "/code"
|
||||||
"claimName": "foo-claim2"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "foo-claim3",
|
"name": "foo-claim3",
|
||||||
"persistentVolumeClaim": {
|
"mountPath": "/var/www/html"
|
||||||
"claimName": "foo-claim3"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "foo-claim4",
|
"name": "foo-claim4",
|
||||||
"persistentVolumeClaim": {
|
"readOnly": true,
|
||||||
"claimName": "foo-claim4",
|
"mountPath": "/etc/configs/"
|
||||||
"readOnly": true
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "datavolume",
|
"name": "datavolume",
|
||||||
"persistentVolumeClaim": {
|
"mountPath": "/var/lib/mysql"
|
||||||
"claimName": "datavolume"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "foo-tmpfs0",
|
"name": "foo-tmpfs0",
|
||||||
"emptyDir": {
|
"mountPath": "/run"
|
||||||
"medium": "Memory"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "foo-tmpfs1",
|
"name": "foo-tmpfs1",
|
||||||
"emptyDir": {
|
"mountPath": "/tmp"
|
||||||
"medium": "Memory"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"containers": [
|
"securityContext": {
|
||||||
{
|
"capabilities": {
|
||||||
"name": "my-web-container",
|
"add": [
|
||||||
"image": " ",
|
"ALL"
|
||||||
"command": [
|
|
||||||
"/code/entrypoint.sh",
|
|
||||||
"-p",
|
|
||||||
"3000"
|
|
||||||
],
|
],
|
||||||
"args": [
|
"drop": [
|
||||||
"bundle",
|
"NET_ADMIN",
|
||||||
"exec",
|
"SYS_ADMIN"
|
||||||
"thin",
|
]
|
||||||
"-p",
|
},
|
||||||
"3000"
|
"privileged": true
|
||||||
],
|
},
|
||||||
"workingDir": "/code",
|
"stdin": true,
|
||||||
"ports": [
|
"tty": true
|
||||||
{
|
|
||||||
"containerPort": 3000
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"containerPort": 3000
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"containerPort": 3001
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"containerPort": 3002
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"containerPort": 3003
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"containerPort": 3004
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"containerPort": 3005
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"containerPort": 8000
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"containerPort": 8080
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"containerPort": 8081
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"containerPort": 22
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"containerPort": 8001
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"containerPort": 5000
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"containerPort": 5001
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"containerPort": 5002
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"containerPort": 5003
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"containerPort": 5004
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"containerPort": 5005
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"containerPort": 5006
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"containerPort": 5007
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"containerPort": 5008
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"containerPort": 5009
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"containerPort": 5010
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"resources": {
|
|
||||||
"limits": {
|
|
||||||
"memory": "52428800"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"volumeMounts": [
|
|
||||||
{
|
|
||||||
"name": "foo-claim0",
|
|
||||||
"mountPath": "/var/lib/mysql"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "foo-claim1",
|
|
||||||
"mountPath": "/var/lib/mysql"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "foo-claim2",
|
|
||||||
"mountPath": "/code"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "foo-claim3",
|
|
||||||
"mountPath": "/var/www/html"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "foo-claim4",
|
|
||||||
"readOnly": true,
|
|
||||||
"mountPath": "/etc/configs/"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "datavolume",
|
|
||||||
"mountPath": "/var/lib/mysql"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "foo-tmpfs0",
|
|
||||||
"mountPath": "/run"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "foo-tmpfs1",
|
|
||||||
"mountPath": "/tmp"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"securityContext": {
|
|
||||||
"capabilities": {
|
|
||||||
"add": [
|
|
||||||
"ALL"
|
|
||||||
],
|
|
||||||
"drop": [
|
|
||||||
"NET_ADMIN",
|
|
||||||
"SYS_ADMIN"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"privileged": true
|
|
||||||
},
|
|
||||||
"stdin": true,
|
|
||||||
"tty": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"restartPolicy": "Always"
|
|
||||||
}
|
}
|
||||||
}
|
],
|
||||||
|
"restartPolicy": "OnFailure"
|
||||||
},
|
},
|
||||||
"status": {}
|
"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": "PersistentVolumeClaim",
|
"kind": "PersistentVolumeClaim",
|
||||||
"apiVersion": "v1",
|
"apiVersion": "v1",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user