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.
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,
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
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.
kubectl delete to remove your resources to save money.
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:
Clone your GitHub repository
Apply all of the yaml files in the
Check the application
You should reuse the container image from the
Set the secret in the pod definition using environment variables (for now)
The service definition should be a
Tag this milestone
A URL to your release. It should look like this: