Pods are giving error

I have created a replica set, but when I am running the command “kubectl get Pods” status of pods are “CrashLoopBackOff”.

Below the yaml file for replicaset

apiVersion: apps/v1
kind: ReplicaSet
metadata:
name: new-replica-set
labels:
app: myapp
spec:
replicas: 4
selector:
matchLabels:
app: frontend
template:
metadata:
labels:
app: frontend
spec:
containers:
- name: busybox
image: busybox

Please suggest where I am doing wrong ?

check the intended space

like
containers:

  • name: busybox
    image: busybox:latest

and labels should be same in every where. update the label name app: myapp with app: frontend

Please when pasting code,

use code blocks

so the formatting is preserved.

The pods are crashlooping because they have no work to do, so you must give it a sleep command so it stays running

command:
- sleep
- "3600"