Add label 'kompose.controller.type' set service convert controller type

This commit is contained in:
xianlubird
2018-05-12 11:52:23 +08:00
parent b0debf7f03
commit a4efdd6cca
9 changed files with 786 additions and 3 deletions
@@ -0,0 +1,29 @@
version: '3'
services:
web:
image: wordpress:4
environment:
- WORDPRESS_DB_PASSWORD=password
- WORDPRESS_AUTH_KEY=changeme
- WORDPRESS_SECURE_AUTH_KEY=changeme
- WORDPRESS_LOGGED_IN_KEY=changeme
- WORDPRESS_NONCE_KEY=changeme
- WORDPRESS_AUTH_SALT=changeme
- WORDPRESS_SECURE_AUTH_SALT=changeme
- WORDPRESS_LOGGED_IN_SALT=changeme
- WORDPRESS_NONCE_SALT=changeme
- WORDPRESS_NONCE_AA=changeme
ports:
- 80
depends_on:
- mysql
deploy:
replicas: 3
labels:
port: wordpress
mysql:
image: mysql:5.7
environment:
- MYSQL_ROOT_PASSWORD=password
labels:
kompose.controller.type: daemonset
@@ -0,0 +1,25 @@
web:
image: wordpress:4.5
ports:
- '80'
environment:
WORDPRESS_AUTH_KEY: changeme
WORDPRESS_SECURE_AUTH_KEY: changeme
WORDPRESS_LOGGED_IN_KEY: changeme
WORDPRESS_NONCE_KEY: changeme
WORDPRESS_AUTH_SALT: changeme
WORDPRESS_SECURE_AUTH_SALT: changeme
WORDPRESS_LOGGED_IN_SALT: changeme
WORDPRESS_NONCE_SALT: changeme
WORDPRESS_NONCE_AA: changeme
restart: always
links:
- 'db:mysql'
db:
image: mysql:5.7
environment:
MYSQL_ROOT_PASSWORD: password
restart: always
labels:
project.logs: /var/log/mysql
kompose.controller.type: daemonset
@@ -0,0 +1,166 @@
{
"kind": "List",
"apiVersion": "v1",
"metadata": {},
"items": [
{
"kind": "Service",
"apiVersion": "v1",
"metadata": {
"name": "web",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "web"
},
"annotations": {
"kompose.cmd": "%CMD%",
"kompose.version": "%VERSION%"
}
},
"spec": {
"ports": [
{
"name": "80",
"port": 80,
"targetPort": 80
}
],
"selector": {
"io.kompose.service": "web"
}
},
"status": {
"loadBalancer": {}
}
},
{
"kind": "DaemonSet",
"apiVersion": "extensions/v1beta1",
"metadata": {
"name": "db",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "db"
},
"annotations": {
"kompose.cmd": "%CMD%",
"kompose.version": "%VERSION%",
"kompose.controller.type": "daemonset",
"project.logs": "/var/log/mysql"
}
},
"spec": {
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"io.kompose.service": "db"
}
},
"spec": {
"containers": [
{
"name": "db",
"image": "mysql:5.7",
"env": [
{
"name": "MYSQL_ROOT_PASSWORD",
"value": "password"
}
],
"resources": {}
}
],
"restartPolicy": "Always"
}
}
},
"status": {
"currentNumberScheduled": 0,
"numberMisscheduled": 0,
"desiredNumberScheduled": 0
}
},
{
"kind": "Deployment",
"apiVersion": "extensions/v1beta1",
"metadata": {
"name": "web",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "web"
},
"annotations": {
"kompose.cmd": "%CMD%",
"kompose.version": "%VERSION%"
}
},
"spec": {
"replicas": 1,
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"io.kompose.service": "web"
}
},
"spec": {
"containers": [
{
"name": "web",
"image": "wordpress:4.5",
"ports": [
{
"containerPort": 80
}
],
"env": [
{
"name": "WORDPRESS_AUTH_KEY",
"value": "changeme"
},
{
"name": "WORDPRESS_AUTH_SALT",
"value": "changeme"
},
{
"name": "WORDPRESS_LOGGED_IN_KEY",
"value": "changeme"
},
{
"name": "WORDPRESS_LOGGED_IN_SALT",
"value": "changeme"
},
{
"name": "WORDPRESS_NONCE_AA",
"value": "changeme"
},
{
"name": "WORDPRESS_NONCE_KEY",
"value": "changeme"
},
{
"name": "WORDPRESS_NONCE_SALT",
"value": "changeme"
},
{
"name": "WORDPRESS_SECURE_AUTH_KEY",
"value": "changeme"
},
{
"name": "WORDPRESS_SECURE_AUTH_SALT",
"value": "changeme"
}
],
"resources": {}
}
],
"restartPolicy": "Always"
}
},
"strategy": {}
},
"status": {}
}
]
}
@@ -0,0 +1,171 @@
{
"kind": "List",
"apiVersion": "v1",
"metadata": {},
"items": [
{
"kind": "Service",
"apiVersion": "v1",
"metadata": {
"name": "web",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "web"
},
"annotations": {
"kompose.cmd": "%CMD%",
"kompose.version": "%VERSION%",
"port": "wordpress"
}
},
"spec": {
"ports": [
{
"name": "80",
"port": 80,
"targetPort": 80
}
],
"selector": {
"io.kompose.service": "web"
}
},
"status": {
"loadBalancer": {}
}
},
{
"kind": "DaemonSet",
"apiVersion": "extensions/v1beta1",
"metadata": {
"name": "mysql",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "mysql"
},
"annotations": {
"kompose.cmd": "%CMD%",
"kompose.version": "%VERSION%",
"kompose.controller.type": "daemonset"
}
},
"spec": {
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"io.kompose.service": "mysql"
}
},
"spec": {
"containers": [
{
"name": "mysql",
"image": "mysql:5.7",
"env": [
{
"name": "MYSQL_ROOT_PASSWORD",
"value": "password"
}
],
"resources": {}
}
],
"restartPolicy": "Always"
}
}
},
"status": {
"currentNumberScheduled": 0,
"numberMisscheduled": 0,
"desiredNumberScheduled": 0
}
},
{
"kind": "Deployment",
"apiVersion": "extensions/v1beta1",
"metadata": {
"name": "web",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "web"
},
"annotations": {
"kompose.cmd": "%CMD%",
"kompose.version": "%VERSION%",
"port": "wordpress"
}
},
"spec": {
"replicas": 3,
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"io.kompose.service": "web"
}
},
"spec": {
"containers": [
{
"name": "web",
"image": "wordpress:4",
"ports": [
{
"containerPort": 80
}
],
"env": [
{
"name": "WORDPRESS_AUTH_KEY",
"value": "changeme"
},
{
"name": "WORDPRESS_AUTH_SALT",
"value": "changeme"
},
{
"name": "WORDPRESS_DB_PASSWORD",
"value": "password"
},
{
"name": "WORDPRESS_LOGGED_IN_KEY",
"value": "changeme"
},
{
"name": "WORDPRESS_LOGGED_IN_SALT",
"value": "changeme"
},
{
"name": "WORDPRESS_NONCE_AA",
"value": "changeme"
},
{
"name": "WORDPRESS_NONCE_KEY",
"value": "changeme"
},
{
"name": "WORDPRESS_NONCE_SALT",
"value": "changeme"
},
{
"name": "WORDPRESS_SECURE_AUTH_KEY",
"value": "changeme"
},
{
"name": "WORDPRESS_SECURE_AUTH_SALT",
"value": "changeme"
}
],
"resources": {}
}
],
"restartPolicy": "Always"
}
},
"strategy": {}
},
"status": {}
}
]
}
@@ -0,0 +1,320 @@
{
"kind": "List",
"apiVersion": "v1",
"metadata": {},
"items": [
{
"kind": "Service",
"apiVersion": "v1",
"metadata": {
"name": "web",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "web"
},
"annotations": {
"kompose.cmd": "%CMD%",
"kompose.version": "%VERSION%",
"port": "wordpress"
}
},
"spec": {
"ports": [
{
"name": "80",
"port": 80,
"targetPort": 80
}
],
"selector": {
"io.kompose.service": "web"
}
},
"status": {
"loadBalancer": {}
}
},
{
"kind": "DaemonSet",
"apiVersion": "extensions/v1beta1",
"metadata": {
"name": "mysql",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "mysql"
},
"annotations": {
"kompose.cmd": "%CMD%",
"kompose.controller.type": "daemonset",
"kompose.version": "%VERSION%"
}
},
"spec": {
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"io.kompose.service": "mysql"
}
},
"spec": {
"containers": [
{
"name": "mysql",
"image": "mysql:5.7",
"env": [
{
"name": "MYSQL_ROOT_PASSWORD",
"value": "password"
}
],
"resources": {}
}
],
"restartPolicy": "Always"
}
}
},
"status": {
"currentNumberScheduled": 0,
"numberMisscheduled": 0,
"desiredNumberScheduled": 0
}
},
{
"kind": "DeploymentConfig",
"apiVersion": "v1",
"metadata": {
"name": "mysql",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "mysql"
},
"annotations": {
"kompose.cmd": "%CMD%",
"kompose.controller.type": "daemonset",
"kompose.version": "%VERSION%"
}
},
"spec": {
"strategy": {
"resources": {}
},
"triggers": [
{
"type": "ConfigChange"
},
{
"type": "ImageChange",
"imageChangeParams": {
"automatic": true,
"containerNames": [
"mysql"
],
"from": {
"kind": "ImageStreamTag",
"name": "mysql:5.7"
}
}
}
],
"replicas": 1,
"test": false,
"selector": {
"io.kompose.service": "mysql"
},
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"io.kompose.service": "mysql"
}
},
"spec": {
"containers": [
{
"name": "mysql",
"image": " ",
"env": [
{
"name": "MYSQL_ROOT_PASSWORD",
"value": "password"
}
],
"resources": {}
}
],
"restartPolicy": "Always"
}
}
},
"status": {}
},
{
"kind": "ImageStream",
"apiVersion": "v1",
"metadata": {
"name": "mysql",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "mysql"
}
},
"spec": {
"tags": [
{
"name": "5.7",
"annotations": null,
"from": {
"kind": "DockerImage",
"name": "mysql:5.7"
},
"generation": null,
"importPolicy": {}
}
]
},
"status": {
"dockerImageRepository": ""
}
},
{
"kind": "DeploymentConfig",
"apiVersion": "v1",
"metadata": {
"name": "web",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "web"
},
"annotations": {
"kompose.cmd": "%CMD%",
"kompose.version": "%VERSION%",
"port": "wordpress"
}
},
"spec": {
"strategy": {
"resources": {}
},
"triggers": [
{
"type": "ConfigChange"
},
{
"type": "ImageChange",
"imageChangeParams": {
"automatic": true,
"containerNames": [
"web"
],
"from": {
"kind": "ImageStreamTag",
"name": "web:4"
}
}
}
],
"replicas": 3,
"test": false,
"selector": {
"io.kompose.service": "web"
},
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"io.kompose.service": "web"
}
},
"spec": {
"containers": [
{
"name": "web",
"image": " ",
"ports": [
{
"containerPort": 80
}
],
"env": [
{
"name": "WORDPRESS_AUTH_KEY",
"value": "changeme"
},
{
"name": "WORDPRESS_AUTH_SALT",
"value": "changeme"
},
{
"name": "WORDPRESS_DB_PASSWORD",
"value": "password"
},
{
"name": "WORDPRESS_LOGGED_IN_KEY",
"value": "changeme"
},
{
"name": "WORDPRESS_LOGGED_IN_SALT",
"value": "changeme"
},
{
"name": "WORDPRESS_NONCE_AA",
"value": "changeme"
},
{
"name": "WORDPRESS_NONCE_KEY",
"value": "changeme"
},
{
"name": "WORDPRESS_NONCE_SALT",
"value": "changeme"
},
{
"name": "WORDPRESS_SECURE_AUTH_KEY",
"value": "changeme"
},
{
"name": "WORDPRESS_SECURE_AUTH_SALT",
"value": "changeme"
}
],
"resources": {}
}
],
"restartPolicy": "Always"
}
}
},
"status": {}
},
{
"kind": "ImageStream",
"apiVersion": "v1",
"metadata": {
"name": "web",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "web"
}
},
"spec": {
"tags": [
{
"name": "4",
"annotations": null,
"from": {
"kind": "DockerImage",
"name": "wordpress:4"
},
"generation": null,
"importPolicy": {}
}
]
},
"status": {
"dockerImageRepository": ""
}
}
]
}