apiVersion: apps/v1
kind: ReplicaSet
metadata:
name: httpd-replicaset
labels:
app: httpd_app
type: front-end
spec:
replicas: 4
selector:
matchLabels:
app: httpd_app
type: front-end
template:
metadata:
labels:
app: httpd_app
type: front-end
spec:
containers:
- name: httpd-container
image: httpd:latestApply the ReplicaSet
kubectl apply -f httpd-replicaset.yamlVerify the ReplicaSet
kubectl get replicaset httpd-replicasetCheck the pods created by the ReplicaSet
kubectl get pods -l app=httpd_app