1
This commit is contained in:
38
k8s/a-service-deployment.yaml
Normal file
38
k8s/a-service-deployment.yaml
Normal file
@@ -0,0 +1,38 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: a-service-deployment
|
||||
labels:
|
||||
app: a-service
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: a-service
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: a-service
|
||||
spec:
|
||||
containers:
|
||||
- name: a-service
|
||||
image: 192.168.1.14:5000/a-service:v10
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 8091
|
||||
env:
|
||||
- name: SPRING_APPLICATION_NAME
|
||||
value: "re-config" # ← 可选,但推荐;也可在 ConfigMap 中设置
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: a-service
|
||||
spec:
|
||||
selector:
|
||||
app: a-service
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 8091
|
||||
targetPort: 8091
|
||||
type: LoadBalancer
|
||||
Reference in New Issue
Block a user