Stateless Deployment to Kubernetes#

To accomplish this milestone you will redeploy the application you put into CloudRun on your Google Kubernetes Engine (GKE) cluster. In order to accomplish this you’ll need to research how to update the YAML example from the Hello Kubernetes lab to add the necessary environment variables.

Kubernetes Manifests#

A YAML file for Kubernetes is called a manifest. It’s a description of the desired state of your application. Going forward you will be editing manifests to turn the container image you built in the first half of the class into a description of a running and scalable application. In the root of your repository you should create a deployment directory. Inside the deployment directory you should have two files, pod.yaml and service.yaml. Like this:

$ tree
└── deployment
    ├── pod.yaml
    └── service.yaml


When you apply both manifests you should see that your service recieves an IP address. Visit that addres with your browser to confirm that you application is running. Since you’re using an older container image you should have the integrated database from the Milestion 4 release and should be able to login using the student and Cabri11o credentials.

Unlike CloudRun, GKE does not zero-scale. Therefore, you will be chared money for the time that your container is operating. When I check this milestone I’ll run your manifests locally so there’s no need to leave the application running after you’re satisfied with it.


Use kubectl delete to remove your resources to save money.

Test Procedure#

I will test your manfiests on my own infrastructure, there’s no need to leave it running. Here’s a summary of how I will test this milestone:

  1. Clone your GitHub repository

  2. Apply all of the yaml files in the deployment directory

  3. Check the application


  1. You should reuse the container image from the milestone-4.x release

    1. Set the secret in the pod definition using environment variables (for now)

  2. The service definition should be a LoadBalancer type.

Turn In#

  1. Tag this milestone milestone-6.x.

  2. A URL to your release. It should look like this: