-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathkubernetes.yml
37 lines (37 loc) · 919 Bytes
/
kubernetes.yml
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
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: sample-spring-boot
namespace: devopslab #added
spec:
replicas: 1 # 1 PODs at any given point of time
selector:
matchLabels:
app: sample-spring-boot
template:
metadata:
labels:
app: sample-spring-boot
spec:
containers:
- name: sample-spring-boot
image: dogistan/devopslab:latest #edited
ports:
- containerPort: 8080
---
apiVersion: v1
kind: Service
metadata:
name: sample-spring-boot-service
namespace: devopslab
labels:
name: sample-spring-boot
spec:
ports:
- port: 8080 # The service will publish the application on the default http port(80)
targetPort: 8080
protocol: TCP
selector:
app: sample-spring-boot-app
type: LoadBalancer # Type loadbalancer will use the underlying cloud provider to create an external url for accessing the app