今天來撰寫Spring Boot API的Deployment & Service yaml檔案
apiVersion: apps/v1
kind: Deployment
metadata:
name: teacherapi-deployment
spec:
selector:
matchLabels:
app: teacherapi
template:
metadata:
labels:
app: teacherapi
spec:
containers:
- name: teacherapi
image: allen030302/teacherapi:IT
resources:
ports:
- containerPort: 8080
name: teacherapi
apiVersion: v1
kind: Service
metadata:
name: teacherapi-service
spec:
type: NodePort
selector:
app: teacherapi
ports:
- protocol : TCP
nodePort: 30808
port: 8080
targetPort: 8080
明天來Spring Boot API測試與除錯,我們明天見~