From 40640e25173ba14bfd1c25ae149008be1e3829ad Mon Sep 17 00:00:00 2001 From: Jeffrey Regan Date: Tue, 1 May 2018 13:56:28 -0700 Subject: [PATCH] capture springboot demo data --- demos/data/mySql/deployment.yaml | 35 +++++++++++++++++++ demos/data/mySql/secret.yaml | 9 +++++ demos/data/mySql/service.yaml | 11 ++++++ demos/data/springboot/base/deployment.yaml | 27 ++++++++++++++ demos/data/springboot/base/service.yaml | 12 +++++++ .../production/application.properties | 5 +++ .../production/healthcheck_patch.yaml | 22 ++++++++++++ .../overlays/production/kustomization.yaml | 7 ++++ .../production/memorylimit_patch.yaml | 20 +++++++++++ .../springboot/overlays/production/patch.yaml | 13 +++++++ .../overlays/staging/application.properties | 5 +++ .../overlays/staging/kustomization.yaml | 11 ++++++ .../springboot/overlays/staging/staging.env | 1 + 13 files changed, 178 insertions(+) create mode 100644 demos/data/mySql/deployment.yaml create mode 100644 demos/data/mySql/secret.yaml create mode 100644 demos/data/mySql/service.yaml create mode 100644 demos/data/springboot/base/deployment.yaml create mode 100644 demos/data/springboot/base/service.yaml create mode 100644 demos/data/springboot/overlays/production/application.properties create mode 100644 demos/data/springboot/overlays/production/healthcheck_patch.yaml create mode 100644 demos/data/springboot/overlays/production/kustomization.yaml create mode 100644 demos/data/springboot/overlays/production/memorylimit_patch.yaml create mode 100644 demos/data/springboot/overlays/production/patch.yaml create mode 100644 demos/data/springboot/overlays/staging/application.properties create mode 100644 demos/data/springboot/overlays/staging/kustomization.yaml create mode 100644 demos/data/springboot/overlays/staging/staging.env diff --git a/demos/data/mySql/deployment.yaml b/demos/data/mySql/deployment.yaml new file mode 100644 index 000000000..6aa7bc72b --- /dev/null +++ b/demos/data/mySql/deployment.yaml @@ -0,0 +1,35 @@ +apiVersion: apps/v1beta2 # for versions before 1.9.0 use apps/v1beta2 +kind: Deployment +metadata: + name: mysql + labels: + app: mysql +spec: + selector: + matchLabels: + app: mysql + strategy: + type: Recreate + template: + metadata: + labels: + app: mysql + spec: + containers: + - image: mysql:5.6 + name: mysql + env: + - name: MYSQL_ROOT_PASSWORD + valueFrom: + secretKeyRef: + name: mysql-pass + key: password + ports: + - containerPort: 3306 + name: mysql + volumeMounts: + - name: mysql-persistent-storage + mountPath: /var/lib/mysql + volumes: + - name: mysql-persistent-storage + emptyDir: {} diff --git a/demos/data/mySql/secret.yaml b/demos/data/mySql/secret.yaml new file mode 100644 index 000000000..935f2305e --- /dev/null +++ b/demos/data/mySql/secret.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +kind: Secret +metadata: + creationTimestamp: null + name: mysql-pass-d2gtcm2t2k +type: Opaque +data: + # Default password is "admin". + password: YWRtaW4= diff --git a/demos/data/mySql/service.yaml b/demos/data/mySql/service.yaml new file mode 100644 index 000000000..aa3f970b6 --- /dev/null +++ b/demos/data/mySql/service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: mysql + labels: + app: mysql +spec: + ports: + - port: 3306 + selector: + app: mysql diff --git a/demos/data/springboot/base/deployment.yaml b/demos/data/springboot/base/deployment.yaml new file mode 100644 index 000000000..62fb2e343 --- /dev/null +++ b/demos/data/springboot/base/deployment.yaml @@ -0,0 +1,27 @@ +apiVersion: apps/v1beta2 +kind: Deployment +metadata: + name: sbdemo + labels: + app: sbdemo +spec: + selector: + matchLabels: + app: sbdemo + template: + metadata: + labels: + app: sbdemo + spec: + containers: + - name: sbdemo + image: jingfang/sbdemo + ports: + - containerPort: 8080 + volumeMounts: + - name: demo-config + mountPath: /config + volumes: + - name: "demo-config" + configMap: + name: "demo-configmap" diff --git a/demos/data/springboot/base/service.yaml b/demos/data/springboot/base/service.yaml new file mode 100644 index 000000000..88f3cdd48 --- /dev/null +++ b/demos/data/springboot/base/service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: sbdemo + labels: + app: sbdemo +spec: + ports: + - port: 8080 + selector: + app: sbdemo + type: LoadBalancer diff --git a/demos/data/springboot/overlays/production/application.properties b/demos/data/springboot/overlays/production/application.properties new file mode 100644 index 000000000..253ffd85e --- /dev/null +++ b/demos/data/springboot/overlays/production/application.properties @@ -0,0 +1,5 @@ +app.name=Staging Kinflate Demo +spring.jpa.hibernate.ddl-auto=update +spring.datasource.url=jdbc:mysql://:3306/db_example +spring.datasource.username=root +spring.datasource.password=admin diff --git a/demos/data/springboot/overlays/production/healthcheck_patch.yaml b/demos/data/springboot/overlays/production/healthcheck_patch.yaml new file mode 100644 index 000000000..c8a0cfaec --- /dev/null +++ b/demos/data/springboot/overlays/production/healthcheck_patch.yaml @@ -0,0 +1,22 @@ +apiVersion: apps/v1beta2 +kind: Deployment +metadata: + name: sbdemo +spec: + replicas: 2 + template: + spec: + containers: + - name: sbdemo + livenessProbe: + httpGet: + path: /actuator/health + port: 8080 + initialDelaySeconds: 10 + periodSeconds: 3 + readinessProbe: + initialDelaySeconds: 20 + periodSeconds: 10 + httpGet: + path: /actuator/info + port: 8080 diff --git a/demos/data/springboot/overlays/production/kustomization.yaml b/demos/data/springboot/overlays/production/kustomization.yaml new file mode 100644 index 000000000..121f384b0 --- /dev/null +++ b/demos/data/springboot/overlays/production/kustomization.yaml @@ -0,0 +1,7 @@ +bases: +- ../../base +patches: +- patch.yaml +- healthcheck_patch.yaml +- memorylimit_patch.yaml +namePrefix: production- diff --git a/demos/data/springboot/overlays/production/memorylimit_patch.yaml b/demos/data/springboot/overlays/production/memorylimit_patch.yaml new file mode 100644 index 000000000..a46d33311 --- /dev/null +++ b/demos/data/springboot/overlays/production/memorylimit_patch.yaml @@ -0,0 +1,20 @@ +apiVersion: apps/v1beta2 +kind: Deployment +metadata: + name: sbdemo +spec: + replicas: 2 + template: + spec: + containers: + - name: sbdemo + resources: + limits: + memory: 1250Mi + requests: + memory: 1250Mi + env: + - name: MEM_TOTAL_MB + valueFrom: + resourceFieldRef: + resource: limits.memory diff --git a/demos/data/springboot/overlays/production/patch.yaml b/demos/data/springboot/overlays/production/patch.yaml new file mode 100644 index 000000000..16dcd086a --- /dev/null +++ b/demos/data/springboot/overlays/production/patch.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: demo-configmap +data: + application.properties: | + app.name=Staging Kinflate Demo + spring.jpa.hibernate.ddl-auto=update + spring.datasource.url=jdbc:mysql://:3306/db_example + spring.datasource.username=root + spring.datasource.password=admin + server.tomcat.max-threads=20 + server.tomcat.min-spare-threads=3 diff --git a/demos/data/springboot/overlays/staging/application.properties b/demos/data/springboot/overlays/staging/application.properties new file mode 100644 index 000000000..5ed56eb97 --- /dev/null +++ b/demos/data/springboot/overlays/staging/application.properties @@ -0,0 +1,5 @@ +app.name=Staging Kinflate Demo +spring.jpa.hibernate.ddl-auto=update +spring.datasource.url=jdbc:mysql://:3306/db_example +spring.datasource.username=root +spring.datasource.password=admin diff --git a/demos/data/springboot/overlays/staging/kustomization.yaml b/demos/data/springboot/overlays/staging/kustomization.yaml new file mode 100644 index 000000000..f2f34a742 --- /dev/null +++ b/demos/data/springboot/overlays/staging/kustomization.yaml @@ -0,0 +1,11 @@ +bases: +- ../../base +namePrefix: staging- +configMapGenerator: +- name: demo-configmap + behavior: merge + files: + - application.properties + literals: + - foo=bar + env: staging.env diff --git a/demos/data/springboot/overlays/staging/staging.env b/demos/data/springboot/overlays/staging/staging.env new file mode 100644 index 000000000..9f854e54d --- /dev/null +++ b/demos/data/springboot/overlays/staging/staging.env @@ -0,0 +1 @@ +staging \ No newline at end of file