forked from vcu-chengx4/sample-spring-boot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkubernetes.yml
More file actions
35 lines (35 loc) · 868 Bytes
/
kubernetes.yml
File metadata and controls
35 lines (35 loc) · 868 Bytes
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
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: sample-spring-boot
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: springboot-sample
image: <Your Docker Image>:<Your Image Tag>
ports:
- containerPort: 8080
---
apiVersion: v1
kind: Service
metadata:
name: sample-spring-boot-service
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