Skip to content

Latest commit

 

History

History
92 lines (61 loc) · 2.89 KB

README.md

File metadata and controls

92 lines (61 loc) · 2.89 KB

Awesomeness is awesome

Prerequisites

Make sure the following tools are installed on your machine:

  • kubectl
  • git
  • docker
  • yq / jq
  • python3

Getting Started

Makefile targets

Target Description
env will spin up the development environment and pull dependencies.
clean delete the kubernetes namespace
py update dependencies as defined in the project.
build build the container image.
push push the container image to the local registry.
deploy apply the application manifests in the aetion namespace.
release build and deploy the application.

Environment

  • local container registry:

curl http://localhost:5001/v2/_catalog

  • local k8s cluster aetion:

kind get kubeconfig --name aetion # To get the kubeconfig file

Application

This awesome app fetches content from a backend service and displaying it in a frontend. The frontend service is a python/Flask application.

Kubernetes

Manifests are available in the ./deploy folder and objects are set to be deployed in the aetion namespace. By default, the kubernetes context generated by kind is kind-{cluster-name}, in this case: kind-aetion.

Frontend

To start the application locally: make py && cd ./frontend/awesome_app && flask run

  • Fetch content from the backend service and display it in the frontend as a json.

The backend service URL is configurable via the BACKEND_URL environment variable.

curl localhost:8000/
{"message":"Hello from the other side","service":"frontend","status":"ok"}
  • Verify the health of the frontend service, runs with a set delay of 3 seconds.
curl localhost:8000/healthz
{"execution_seconds":3,"service":"frontend","status":"ok"}
  • Provides information about kubernetes pods running in the application namespace.
curl localhost:8000/kube/info
[{"creationTime":"2024-01-01 00:00:01+00:00","podName":"frontend-5f7ffcd977-dr92z"},{"creationTime":"2024-01-01 00:00:01+00:00","podName":"webapp-79b6d86956-n229h"}]

Backend

Returns a simple json message.

curl localhost:8000/
{"message":"Hello"}

TODO

No code change is necessary

The manifests (e.g deploy/) values can be updated but keys should be preserved. It is allowed to add new ones.

  • Deploy the application, all deployments must be running.
  • The frontend / endpoint should return a 200 status code (and an awesome message).
  • The frontend /kube/info endpoint return the kube pods information from the namespace where it's deployed.
  • Add a readiness probe to the frontend service based off the /healthz endpoint.