【发布时间】:2017-06-30 10:45:17
【问题描述】:
我们在 AWS 上运行一个 kubernetes 集群。
当我尝试删除部署时 - 副本集也被删除 - 但 pod 仍然存在并且没有被删除。
当我重新部署时,我得到一个新的部署、新的副本集和一个新的 pod(所以现在有 2 个可用...)
apiVersion: v1
kind: Service
metadata:
name: helloworld
labels:
app: helloworld
spec:
ports:
-
port: 80
targetPort: 10000
selector:
service: helloworld
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: helloworld
spec:
replicas: 1
revisionHistoryLimit: 0
selector:
matchLabels:
service: helloworld
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
labels:
service: helloworld
spec:
containers:
-
name: helloworld
image: 'my.service.io/service/helloworld:latest'
imagePullPolicy: Always
ports:
- containerPort: 10000
command:
- node
args:
- "app.js"
imagePullSecrets:
- name: my-screts
restartPolicy: Always
terminationGracePeriodSeconds: 30
deployment 和 replica sets 删除时,为什么 pod 没有被删除?
【问题讨论】:
-
您使用声明式 (
kubectl apply) 还是命令式语法 (kubectl create)?您究竟如何删除部署?
标签: kubernetes