Challenge 2: Deploying on GKE

Previous Challenge Next Challenge

Introduction

With your Docker image ready and tested, you are ready to get it running on GKE so players can start enjoying this retro-style rogue-like game. Your manager asks that you try to keep the node sizes small to keep costs down, and that for now you limit the number of nodes to 3.

Here are some helpful terms to know for this section:

  • Kubernetes - an open-source system for automating deployment, scaling, and management of containerized applications
  • Node - worker machines that run your containerized applications and other workloads
  • Cluster - a group of nodes that run containerized applications. Every cluster has at least one worker node
  • Node pool - a group of nodes within a cluster that all have the same configuration
  • Pod - the most basic deployable unit within a Kubernetes cluster, capable of running one or more containers
  • Namespace - an abstraction used by Kubernetes to organize objects in a cluster and provide a way to divide cluster resources
  • Deployment - an API object that manages a replicated application
  • Service - a method for exposing a network application that is running as one or more Pods in your cluster
  • K8s - an abbreviation for Kubernetes

Description

In this challenge, you will create a GKE cluster and use it to host playable Dungeon Crawl Stone Soup game server pods.

To help you be successful, here are some reminders of things you will need to do:

  • Create a cluster and node pool
  • Create a deployment for your application and a service to direct traffic to it. Don’t forget the liveness and readiness probes!
  • Create a namespace to help keep things organized

Note

  • Use e2-standard-2 nodes in your node pool as they will be the most cost effective. Don’t worry about performance for this gHack!
  • The general GKE best practices are (note: there are always exceptions!):
    • Don’t set CPU limits
    • Set memory limit equal to memory request

Success Criteria

  • A cluster with three nodes in a node pool
  • Default node pool deleted
  • Liveness and readiness probes implemented on the game server deployment
  • SSH into a game server container and verify the contents match with those of the crawl-ref folder
  • Demonstrate you can play the game by connecting to your service’s IP address

Learning Resources

Previous Challenge Next Challenge