This project fetches data from the Rick and Morty API and exposes a REST interface. The default filters are:
- Species = "Human"
- Status = "Alive"
- Origin contains the word "Earth"
-
main.py
A Flask application that provides:/healthcheck(returns{"status": "ok"})/characters(returns the JSON list of characters)
-
Dockerfile
Defines how to containerize the Flask application. -
yamls/
Kubernetes manifests:Deployment.yamlService.yamlIngress.yaml
-
helm/
Helm chart that includes:Chart.yamlvalues.yamltemplates/with Deployment, Service, and Ingress definitions
-
.github/workflows/main.yaml
A GitHub Actions workflow:- Creates a local Kind cluster.
- Builds and loads the Docker image into the cluster.
- Deploys the manifests.
- Tests the endpoints.
- Build the Docker image:
docker build -t rick-and-morty-app:latest . - Run the Docker container:
docker run -p 5000:5000 rick-and-morty-app:latest
- Test:
Healthcheck: http://localhost:5000/healthcheck Characters: http://localhost:5000/characters
- Make sure you have a running cluster (e.g., via Minikube or Kind).
- Apply the manifests:
kubectl apply -f yamls/Deployment.yaml kubectl apply -f yamls/Service.yaml kubectl apply -f yamls/Ingress.yaml - Verify pods and services:
kubectl get pods kubectl get svc kubectl get ingress
- Access the service. Example: if using an Ingress with host rick.local, add rick.local to your /etc/hosts pointing to your local cluster IP (or 127.0.0.1 if using port-forward), then open::
Healthcheck: http://localhost:5000/healthcheck Characters: http://localhost:5000/characters
- Install (or upgrade) the char:
helm install rick ./helm
- Check:
kubectl get pods kubectl get svc kubectl get ingress - By default, you can configure the domain/host in helm/values.yaml