Skip to content
Pass Microsoft, Cisco, Sap and Salesforce Exams
Menu
  • Home
  • Exams
  • Certifications
  • Cloud Computing
  • Cyber Security
  • Contact Us
  • Log in
  • Sign up
Menu

Command line – Google Cloud Cert Guide

Posted on 2024-09-052024-09-05 by examcert

Removal of Pods utilizes the kubectl command. Before we start with the removal of a single Pod, we need to list existing Pods. To list all Pods, we can use the kubectl get pods command:

Figure 6.50 – Listing of existing Pods with kubectl command

To delete a single Pod, we can issue the kubectl delete pod frontend-4rk4w command. The Pod is deleted immediately, but we might ask ourselves the following: How do I know if the Pod is part of the deployment or otherwise? How was the Pod deployed in the first place?

To find this out, we can review the Pod configuration by using the kubectl describe pod frontend-dc4n4 command.

The command output contains a lot of information, and we need to scroll to the Controlled By: section:

Figure 6.51 – Detailed information about the Pod

The Controlled By: section allow us to identify how a Pod or set of Pods deployment has been done. Once we know that the Pod is part of a ReplicaSet, we need to find the name of the ReplicaSet. To find this out, we can use the kubectl get replicaset command:

Figure 6.52 – Existing ReplicaSet deployments

So, we discovered that the ReplicaSet with the name frontend contains six replicas and Pods associated with it:

Figure 6.53 – Detailed information about the frontend ReplicaSet

Finally, to delete it, we need to run the kubectl delete replicaset frontend command. After a moment, deletion completes.

We learned a lot about Pods, including how to deploy, manage and remove them. Our journey doesn’t stop here. We will now move to the services section, where we will learn about different types of services and how we can use them in GKE.

Service management

Services are a crucial part of GKE. GKE uses services to group Pods into a single resource that is going to be accessed from outside of the GKE cluster. After the deployment of the application, we can choose different ways to access applications running in GKE.

Types of services

We have a handful selection of services to choose from, as follows:

  • ClusterIP—This is a default service where clients’ requests are sent to an internal IP address.
  • NodePort—Clients send requests to the IP address of a node with a specific, configurable port value.
  • LoadBalancer—Clients access the application by using the IP address of the load balancer.
  • ExternalName—Clients access the application by using the DNS address.
  • Headless—A headless service that can be used to group Pods without an IP address.

Both the Kubernetes and GKE documentation describe in detail services with all their options, and we recommend diving deep if you want to learn more beyond the scope of the book:

  • https://kubernetes.io/docs/concepts/services-networking/service/
  • https://cloud.google.com/kubernetes-engine/docs/concepts/service

Post navigation

← Command line – Google Cloud Cert Guide
Viewing services – Google Cloud Cert Guide →

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • 100-150 Study Course
  • AWS Study Course
  • AZ-104 Study Course
  • Certified Advanced Salesforce Admin
  • Cisco Study Course
  • CLF-C02 Study Course
  • Google
  • Google Associate Cloud Engineer
  • Microsoft Study Course
  • Salesforce
  • Study Course
© 2024 Zeusexam, Inc. All rights reserved. | Privacy Statement | Terms of Use | Use of Cookies | Trust | Accessibility | Cookie Preferences | Your Privacy Choices