37 lines
828 B
YAML
37 lines
828 B
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: webapp-deployment
|
|
namespace: smartbuilding-namespace
|
|
labels:
|
|
app: webapp
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: webapp
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: webapp
|
|
spec:
|
|
initContainers:
|
|
- name: init-mysql
|
|
image: busybox:1.28
|
|
command: ['sh', '-c', 'until nc -z mysql-service 3306; do echo waiting for mysql; sleep 2; done;']
|
|
containers:
|
|
- name: webapp
|
|
image: web-app:1.0
|
|
imagePullPolicy: IfNotPresent
|
|
ports:
|
|
- containerPort: 3000
|
|
env:
|
|
- name: DB_HOST
|
|
value: "mysql-service"
|
|
- name: DB_USER
|
|
value: "root"
|
|
- name: DB_PASSWORD
|
|
value: "cytech0001"
|
|
- name: DB_NAME
|
|
value: "user"
|