cat >> rs.yaml <<EOL
apiVersion: apps/v1
kind: ReplicaSet
metadata:
name: web
labels:
app: somewebapp
type: web
spec:
replicas: 2
selector:
matchLabels:
type: web
template:
metadata:
labels:
type: web
spec:
containers:
- name: httpd
image: registry.redhat.io/rhscl/httpd-24-rhel7
EOL
kubectl apply -f rs.yaml
kubectl get rs
# OR a more specific way: kubectl get -f rs.yaml
kubectl delete po <POD_NAME>
The same number of Pods. Since we defined 2 replicas, the ReplicaSet will make sure to create another Pod that will replace the one you've deleted.
kubectl delete -f rs.yaml
kubectl get rs
# OR a more specific way: kubectl get -f rs.yaml