38 lines
752 B
YAML
38 lines
752 B
YAML
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 |