mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-12 01:14:22 +00:00
capture springboot demo data
This commit is contained in:
35
demos/data/mySql/deployment.yaml
Normal file
35
demos/data/mySql/deployment.yaml
Normal file
@@ -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: {}
|
||||||
9
demos/data/mySql/secret.yaml
Normal file
9
demos/data/mySql/secret.yaml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
creationTimestamp: null
|
||||||
|
name: mysql-pass-d2gtcm2t2k
|
||||||
|
type: Opaque
|
||||||
|
data:
|
||||||
|
# Default password is "admin".
|
||||||
|
password: YWRtaW4=
|
||||||
11
demos/data/mySql/service.yaml
Normal file
11
demos/data/mySql/service.yaml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: mysql
|
||||||
|
labels:
|
||||||
|
app: mysql
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- port: 3306
|
||||||
|
selector:
|
||||||
|
app: mysql
|
||||||
27
demos/data/springboot/base/deployment.yaml
Normal file
27
demos/data/springboot/base/deployment.yaml
Normal file
@@ -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"
|
||||||
12
demos/data/springboot/base/service.yaml
Normal file
12
demos/data/springboot/base/service.yaml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: sbdemo
|
||||||
|
labels:
|
||||||
|
app: sbdemo
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- port: 8080
|
||||||
|
selector:
|
||||||
|
app: sbdemo
|
||||||
|
type: LoadBalancer
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
app.name=Staging Kinflate Demo
|
||||||
|
spring.jpa.hibernate.ddl-auto=update
|
||||||
|
spring.datasource.url=jdbc:mysql://<production_db_ip>:3306/db_example
|
||||||
|
spring.datasource.username=root
|
||||||
|
spring.datasource.password=admin
|
||||||
@@ -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
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
bases:
|
||||||
|
- ../../base
|
||||||
|
patches:
|
||||||
|
- patch.yaml
|
||||||
|
- healthcheck_patch.yaml
|
||||||
|
- memorylimit_patch.yaml
|
||||||
|
namePrefix: production-
|
||||||
@@ -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
|
||||||
13
demos/data/springboot/overlays/production/patch.yaml
Normal file
13
demos/data/springboot/overlays/production/patch.yaml
Normal file
@@ -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://<production_db_ip>:3306/db_example
|
||||||
|
spring.datasource.username=root
|
||||||
|
spring.datasource.password=admin
|
||||||
|
server.tomcat.max-threads=20
|
||||||
|
server.tomcat.min-spare-threads=3
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
app.name=Staging Kinflate Demo
|
||||||
|
spring.jpa.hibernate.ddl-auto=update
|
||||||
|
spring.datasource.url=jdbc:mysql://<staging_db_ip>:3306/db_example
|
||||||
|
spring.datasource.username=root
|
||||||
|
spring.datasource.password=admin
|
||||||
11
demos/data/springboot/overlays/staging/kustomization.yaml
Normal file
11
demos/data/springboot/overlays/staging/kustomization.yaml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
bases:
|
||||||
|
- ../../base
|
||||||
|
namePrefix: staging-
|
||||||
|
configMapGenerator:
|
||||||
|
- name: demo-configmap
|
||||||
|
behavior: merge
|
||||||
|
files:
|
||||||
|
- application.properties
|
||||||
|
literals:
|
||||||
|
- foo=bar
|
||||||
|
env: staging.env
|
||||||
1
demos/data/springboot/overlays/staging/staging.env
Normal file
1
demos/data/springboot/overlays/staging/staging.env
Normal file
@@ -0,0 +1 @@
|
|||||||
|
staging
|
||||||
Reference in New Issue
Block a user