-
Notifications
You must be signed in to change notification settings - Fork 0
/
6-banking-deploy.yaml
32 lines (32 loc) · 1.37 KB
/
6-banking-deploy.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
apiVersion: apps/v1 #version we are using
kind: Deployment # kind describe what purpose we are using this yaml file
metadata: # It helps to identify the object
name: banking-app # Identifier for this file
labels: # used to specify api
app: banking-app
spec: # specifications
replicas: 1 # define how many pods are created
selector: #selects all the pods with same key value pair
matchLabels: # it helps to match with the labels
app: banking-app
template: # this need to be applied for all the pods we have created
metadata:
labels:
app: banking-app
spec:
containers: # containers we have used
- name: banking-app # name
image: devanshuz/app1 # image which we got from docker hub
ports: # ports that are used to provide output
- containerPort: 8080
env: # these are the variables we got from the image
- name: DB_HOST
value: "bankmysql" # database we have choosen
- name: DB_PORT # port number specified for mysql
value: "3306"
- name: DB_NAME
value: "onlinebanking" #name for the database
- name: DB_USER
value: "root" #username for database
- name: DB_PASS
value: "root" # password to enter database