Solution ReplicaSets optional

Source: https://notes.kodekloud.com/docs/CKA-Certification-Course-Certified-Kubernetes-Administrator/Core-Concepts/Solution-ReplicaSets-optional/page

Summary: This lab explores ReplicaSets in Kubernetes, covering verification, troubleshooting, scaling, and modifying ReplicaSets through practical commands and configurations.

Key Notes

  • In this lab, we explore ReplicaSets in Kubernetes. Follow along as we review lab steps, execute commands, and troubleshoot issues. This guide covers checking current resources, examining ReplicaSet configurations, troubleshooting image pull errors, scaling, and modifying ReplicaSets using definition files.
    1. Verify Existing Pods
  • Begin by checking the current pods in your cluster. Run the following command:
  • The result is expected to be:
  • No resources found in default namespace.
  • This indicates that there are no pods currently running.
    1. Review Existing ReplicaSets
  • Next, inspect if any ReplicaSets are present:
  • Initially, no ReplicaSets are available. After making configuration changes, a new ReplicaSet may be created. Check its details using the same command:
  • You might see an output similar to:
  • NAME DESIRED CURRENT READY AGE
  • new-replica-set 4 4 0 9s
    1. Analyze ReplicaSet Details
  • To obtain a detailed description of the ReplicaSet, execute:
  • Focus on the pod template section; observe the container configuration:
  • Image:
  • Command:
  • “echo Hello Kubernetes! && sleep 3600”
  • Below is an excerpt from the output:
  • Name:
  • Namespace:
  • Selector:
  • name=busybox-pod
  • Labels: