From 445c2ece117a3fe4f23cc90b34e4e972211f0d75 Mon Sep 17 00:00:00 2001 From: Marcin Ciszak Date: Fri, 18 Jun 2021 15:48:07 +0100 Subject: [PATCH] Updates examples/wordpress-mysql (#578) Co-authored-by: marcinc --- .gitignore | 3 ++ examples/wordpress-mysql/README.md | 3 +- .../docker-compose.kev.dev.yaml | 26 ++++++++++ .../docker-compose.kev.local.yaml | 47 +++-------------- .../docker-compose.kev.stage.yaml | 51 +++---------------- examples/wordpress-mysql/kev.yaml | 3 +- 6 files changed, 47 insertions(+), 86 deletions(-) create mode 100644 examples/wordpress-mysql/docker-compose.kev.dev.yaml diff --git a/.gitignore b/.gitignore index 7eb4848c..382cd832 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,9 @@ examples/node-app/docker-compose.kev* examples/node-app/kev.yaml examples/node-app/k8s +### Wordpress app example +examples/wordpress-mysql/k8s + ### Go mod vendor ### vendor diff --git a/examples/wordpress-mysql/README.md b/examples/wordpress-mysql/README.md index 0a7a4bce..dbcc2104 100644 --- a/examples/wordpress-mysql/README.md +++ b/examples/wordpress-mysql/README.md @@ -2,11 +2,12 @@ This example defines one of the basic setups for Wordpress. -It also contains all the _Kev_ artefacts required to migrate the app from a Docker Compose Workflow to Kubernetes. +It also contains all the _Kev_ artefacts required to migrate the app from a Docker Compose Workflow to Kubernetes. Project structure: ``` . +├── docker-compose.kev.dev.yaml ├── docker-compose.kev.local.yaml ├── docker-compose.kev.stage.yaml ├── docker-compose.yaml diff --git a/examples/wordpress-mysql/docker-compose.kev.dev.yaml b/examples/wordpress-mysql/docker-compose.kev.dev.yaml new file mode 100644 index 00000000..b8d6ef20 --- /dev/null +++ b/examples/wordpress-mysql/docker-compose.kev.dev.yaml @@ -0,0 +1,26 @@ +version: "3.7" +services: + db: + x-k8s: + workload: + livenessProbe: + exec: + command: + - echo + - Define healthcheck command for service + type: exec + replicas: 1 + wordpress: + x-k8s: + workload: + livenessProbe: + exec: + command: + - echo + - Define healthcheck command for service + type: exec + replicas: 1 +volumes: + db_data: + x-k8s: + size: 100Mi diff --git a/examples/wordpress-mysql/docker-compose.kev.local.yaml b/examples/wordpress-mysql/docker-compose.kev.local.yaml index fe044456..b8d6ef20 100644 --- a/examples/wordpress-mysql/docker-compose.kev.local.yaml +++ b/examples/wordpress-mysql/docker-compose.kev.local.yaml @@ -2,58 +2,25 @@ version: "3.7" services: db: x-k8s: - service: - type: ClusterIP workload: - imagePull: - policy: IfNotPresent livenessProbe: - type: exec exec: command: - echo - Define healthcheck command for service - failureThreshold: 3 - successThreshold: 1 - initialDelay: 1m0s - period: 1m0s - timeout: 10s + type: exec replicas: 1 - resource: - cpu: 0.1 - maxCpu: 0.5 - maxMemory: 500Mi - memory: 10Mi - rollingUpdateMaxSurge: 1 - serviceAccountName: default - type: StatefulSet wordpress: x-k8s: - service: - type: LoadBalancer workload: - imagePull: - policy: IfNotPresent livenessProbe: - type: tcp - tcp: - port: 8000 - failureThreshold: 3 - successThreshold: 1 - initialDelay: 1m0s - period: 1m0s - timeout: 10s - replicas: 5 - resource: - cpu: 0.1 - maxCpu: 0.5 - maxMemory: 500Mi - memory: 10Mi - rollingUpdateMaxSurge: 1 - serviceAccountName: default - type: Deployment + exec: + command: + - echo + - Define healthcheck command for service + type: exec + replicas: 1 volumes: db_data: x-k8s: size: 100Mi - storageClass: standard diff --git a/examples/wordpress-mysql/docker-compose.kev.stage.yaml b/examples/wordpress-mysql/docker-compose.kev.stage.yaml index 68a34025..b8d6ef20 100644 --- a/examples/wordpress-mysql/docker-compose.kev.stage.yaml +++ b/examples/wordpress-mysql/docker-compose.kev.stage.yaml @@ -2,62 +2,25 @@ version: "3.7" services: db: x-k8s: - service: - type: ClusterIP workload: - imagePull: - policy: IfNotPresent livenessProbe: - type: exec exec: command: - echo - Define healthcheck command for service - failureThreshold: 3 - successThreshold: 1 - initialDelay: 1m0s - period: 1m0s - timeout: 10s - readinessProbe: - type: tcp - tcp: - port: 3306 + type: exec replicas: 1 - resource: - cpu: 0.1 - maxCpu: 0.5 - maxMemory: 500Mi - memory: 10Mi - rollingUpdateMaxSurge: 1 - serviceAccountName: default - type: StatefulSet wordpress: x-k8s: - service: - type: LoadBalancer workload: - imagePull: - policy: IfNotPresent livenessProbe: - type: tcp - tcp: - port: 8000 - failureThreshold: 3 - successThreshold: 1 - initialDelay: 1m0s - period: 1m0s - timeout: 10s - replicas: 5 - resource: - cpu: 0.1 - maxCpu: 0.5 - maxMemory: 500Mi - memory: 10Mi - rollingUpdateMaxSurge: 1 - serviceAccountName: default - type: Deployment + exec: + command: + - echo + - Define healthcheck command for service + type: exec + replicas: 1 volumes: db_data: x-k8s: size: 100Mi - storageClass: standard diff --git a/examples/wordpress-mysql/kev.yaml b/examples/wordpress-mysql/kev.yaml index 6ee74262..bfa157c0 100644 --- a/examples/wordpress-mysql/kev.yaml +++ b/examples/wordpress-mysql/kev.yaml @@ -1,6 +1,7 @@ -id: 10d61d9a-99c4-4721-9b80-dd6725c657cc +id: 98b5e7c9-4a40-4006-bb5e-57e496b183c4 compose: - docker-compose.yaml environments: + dev: docker-compose.kev.dev.yaml local: docker-compose.kev.local.yaml stage: docker-compose.kev.stage.yaml