Google Kubernetes Engine (GKE) - Scalable Deployment with Stable Network Identity and Persistent Disk

Deploying Your Application in GKE with Stable Network Identity and Persistent Disk

Question

You are planning to deploy your application in a Google Kubernetes Engine (GKE) cluster.

Your application can scale horizontally, and each instance of your application needs to have a stable network identity and its own persistent disk.

Which GKE object should you use?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

B.

https://livebook.manning.com/book/kubernetes-in-action/chapter-10/46

Based on the requirements mentioned in the question, the most appropriate GKE object to use would be a StatefulSet.

A StatefulSet is a Kubernetes object that is designed to manage stateful applications, where each instance needs a unique and stable network identity, and persistent storage. StatefulSets maintain a predictable identity for each pod that is created, even if the pods are scaled up or down, or the cluster is restarted. This is achieved by providing each pod with a unique hostname, and stable network identity.

In addition to providing stable network identity, StatefulSets also support persistent storage by allowing each pod to have its own persistent disk that is attached to it. This ensures that data is not lost even if the pod is terminated or restarted.

Deployments, ReplicaSets, and ReplicaControllers are Kubernetes objects that are designed to manage stateless applications. While they can scale horizontally and create multiple replicas of the same pod, they do not provide stable network identities or persistent storage for individual pods.

Therefore, in this scenario, the most appropriate GKE object to use would be a StatefulSet.