Working with ReplicaSets
创建副本集
创建 rs.yaml
cat > rs.yaml << EOF
apiVersion: apps/v1
kind: ReplicaSet
metadata:
name: rs-one
spec:
replicas: 2
selector:
matchLabels:
system: ReplicaOne
template:
metadata:
labels:
system: ReplicaOne
spec:
containers:
- name: nginx
image: nginx:1.15.1
ports:
- containerPort: 80
EOF
创建并查看资源
删除副本集不删除关联的 pod
删除 rs 资源但不删除里边的 pod
查看资源
再次创建 rs 资源
编辑标签隔离副本集里的 pod
编辑某个 pod ,达到和 rs 隔离的目的
查看资源
删除 rs 再看 pod 资源
使用标签删除剩余的 pod
Last updated