We have an application called my-nginx running as a deployment with two Pods. We want to create a service of type ClusterIP for the workload running under the name my-nginx. To create a service of type ClusterIP, we can use the following code:apiVersion: v1kind: Servicemetadata: name: my-nginx labels: run: my-nginxspec: ports: – port: 80 protocol: TCP selector: run: my-nginx The preceding code can…
Author: examcert
Viewing services – Google Cloud Cert Guide
By default, GKE creates services that are used by GKE itself. Those default services are set out here: The next screenshot shows these services in Cloud console, but as those are GKE core services, we should avoid interaction with them unless there is a clear reason to do so. Changing them might result in GKE…
Command line – Google Cloud Cert Guide
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…
Command line – Google Cloud Cert Guide
To modify deployed Pods, we have several possibilities, but it will depend on how the Pods are deployed. Let’s try to modify the ReplicaSet deployment used in the previous section of the chapter. We have a deployment with the name frontend with three replicas and we would like to change the number of replicas to…
Command line – Google Cloud Cert Guide
The most popular option to create Pods using the command line is to use two main commands. The first option is to use the kubectl apply -f filename.yaml command, where the YAML file contains all details of the Pod. If you don’t know how to create a Pod YAML file, you can use an example…
Command line – Google Cloud Cert Guide
Now, after switching to the CLI, we will view the Pods’ details using the kubectl utility. To view all Pods in all namespaces, we need to use the following command:kubectl get pods -A However, the command output will show us all cluster resources alongside our deployed Pods. To view Pods deployed into the default namespace,…
DaemonSet – Google Cloud Cert Guide
If we need to ensure that Pods will be scheduled on all or some GKE nodes, we can use the DaemonSet deployment type. When a new node is added to the cluster, Pods are scheduled on them. The most typical use cases of a DaemonSet are outlined here: Jobs A Job deployment type is used…
Namespace – Google Cloud Cert Guide
By default, GKE creates several namespaces such as kube-node-lease, kube-public, and kube-system. When creating a GKE Autopilot cluster, the default namespace is created for our workloads. GKE Standard mode allows us to specify a node pool’s newly created namespace manually. Namespaces are used to isolate groups of resources within a single cluster. The name of…
Pod lifecycle – Google Cloud Cert Guide
Pods go through a specific sequence of stages throughout their lifecycle. It begins with the Pending phase, progresses to the Running phase if at least one of its primary containers starts successfully, and ultimately transitions to either the Succeeded or Failed phase based on whether any container within the Pod terminates with a failure. Pods…
Modifying node pools – Google Cloud Exam Guide
Command line The creation of a minimalistic deployment pool (bare minimum without any extra settings) can be achieved by executing the following command:gcloud container node-pools create POOL_NAME –cluster CLUSTER_NAME –region=REGION_NAME Execution of this command results in default settings configured for the node pool—three nodes with e2-medium as the machine type: Figure 6.21 – Default and…