apiVersion: v1
kind: Pod
metadata:
  name: pod-matching-replicaset
  labels:
    environment: production
spec:
  containers:
    - name: first-container
      image: nginx

# kubectl create -f pod-matching-replicaset.yaml  # create this pod
# kubectl create -f replicaset-nginx.yaml  # create replicaset with matchLabel same as this pod
# kubectl get rs nginx-replicaset          # to see if replicaset creation successful
# kubectl describe pod pod-matching-replicaset # Shows 'Controlled By: ReplicaSet/nginx-replicaset'
# kubectl describe rs nginx-replicaset     # shows that it created only one pod.
# kubectl delete rs nginx-replicaset
