-
Notifications
You must be signed in to change notification settings - Fork 0
/
app-deployment.yaml
43 lines (41 loc) · 1.27 KB
/
app-deployment.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
33
34
35
36
37
38
39
40
41
42
43
apiVersion: apps/v1
kind: Deployment
metadata:
name: springboot-crud-deployment
spec:
selector:
matchLabels:
app: springboot-k8s-mysql
replicas: 3
template:
metadata:
labels:
app: springboot-k8s-mysql
spec:
containers:
- name: springboot-crud-k8s
image: praveensingam1994/springboot-crud-k8s:1.0
ports:
- containerPort: 8080
env: # Setting Enviornmental Variables
- name: DB_HOST # Setting Database host address from configMap
value: mysql
- name: DB_NAME # Setting Database name from configMap
value: singamlabs
- name: DB_USERNAME # Setting Database username from Secret
value: root
- name: DB_PASSWORD # Setting Database password from Secret
value: root
---
apiVersion: v1 # Kubernetes API version
kind: Service # Kubernetes resource kind we are creating
metadata: # Metadata of the resource kind we are creating
name: springboot-crud-svc
spec:
selector:
app: springboot-k8s-mysql
ports:
- protocol: "TCP"
port: 8080 # The port that the service is running on in the cluster
targetPort: 8080 # The port exposed by the service
type: NodePort # type of the service.