【发布时间】:2023-04-03 11:45:02
【问题描述】:
刚读完 Nigel Poulton 的 The Kubernetes Book,但我对服务有点困惑。
可以以某种方式将服务添加到下面的部署清单中吗?或者服务是否必须自己发布?部署的全部目的不就是指定应用运行所需的一切吗?
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: hello-deploy
spec:
replicas: 10
selector:
matchLabels:
app: hello-world
minReadySeconds: 10
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 1
maxSurge: 1
template:
metadata:
labels:
app: hello-world
spec:
containers:
- name: hello-pod
image: nigelpoulton/k8sbook : latest
ports:
- containerPort: 8080
【问题讨论】: