menu
arrow_back

Running a MongoDB Database in Kubernetes with StatefulSets

Running a MongoDB Database in Kubernetes with StatefulSets

1 个小时 7 个积分

GSP022

Google Cloud Self-Paced Labs

Overview

Kubernetes is an open source container orchestration tool that handles the complexities of running containerized applications. You can run Kubernetes applications with Kubernetes Engine—a GCP computing service that offers many different customizations and integrations. In this lab, you will get some practical experience with Kubernetes by learning how to set up a MongoDB database with a StatefulSet. Running a stateful application (a database) on a stateless service (container) may sound contradictory. However, after getting hands-on practice with this lab you will quickly see how that's not the case. In fact, by using a few open-source tools you will see how Kubernetes and stateless services can go hand-in-hand.

What you'll learn

In this lab, you will learn the following:

  • How to deploy a Kubernetes cluster, a headless service, and a StatefulSet.

  • How to connect a Kubernetes cluster to a MongoDB replica set.

  • How to scale MongoDB replica set instances up and down.

  • How to clean up your environment and shutdown the above services.

加入 Qwiklabs 即可阅读本实验的剩余内容…以及更多精彩内容!

  • 获取对“Google Cloud Console”的临时访问权限。
  • 200 多项实验,从入门级实验到高级实验,应有尽有。
  • 内容短小精悍,便于您按照自己的节奏进行学习。
加入以开始此实验
分数

—/100

Create a new Cluster

运行步骤

/ 25

Create the StorageClass

运行步骤

/ 25

Deploying the Headless Service and StatefulSet

运行步骤

/ 25

Scaling the MongoDB replica set

运行步骤

/ 25