Run a Stateful App on Kubernetes with HTTPS and Persistent Storage

Deploy an app with a database on VKE, give it a real certificate and storage that survives pod restarts.

+120

POINTS

What you will build

A small but complete Kubernetes application: web, database, storage, TLS and configuration done properly.

Starting point: you only need a Vultr account. This challenge is self-contained, so you can do it without having done any other.

The requirements

  • A Deployment for the app and a StatefulSet or Deployment for the database
  • A PersistentVolumeClaim backed by Vultr Block Storage
  • An Ingress controller with a certificate from cert-manager and Let's Encrypt
  • Configuration in a ConfigMap and credentials in a Secret, not in the image
  • Readiness and liveness probes on the app
  • A rolling update shown without errors

The drill

  1. Write a record through the app
  2. Delete the database pod with kubectl
  3. Wait for it to come back
  4. Read the record again and confirm it survived
  5. Push a new image tag and watch the rolling update
BASH
kubectl delete pod -l app=db
kubectl get pods -w
kubectl get pvc

Destroy the cluster and any load balancers or volumes it created when you are done so you are not billed for them.

Requirements

Cluster created on VKE

Database data stored on a PersistentVolumeClaim

HTTPS Ingress with a valid certificate

Credentials in a Secret, not the image

Data survives deleting the database pod

Rolling update without errors

Resources

Submit Your Build

Challenge Questions

No questions about this Challenge yet
Ask anything about this Challenge prep, agenda or joining.