This project implements a pathfinding algorithm that calculates the minimum-cost path in a matrix using only rightward and downward moves, starting from the top-left cell and ending at the bottom-right.
The computation is containerized using Docker and deployed as a Kubernetes Job, with the input matrix provided via a ConfigMap.
matrix-path/
├── Dockerfile # Container definition for the matrix job
├── main.py # Python script with pathfinding logic
├── matrix.txt # Input matrix file (used in ConfigMap)
├── job.yaml # Kubernetes Job definition
└── README.md # README.md file- Docker
- Kind (Kubernetes in Docker)
- kubectl
- Clone the repository (if not already done):
git clone https://your-repo-url/matrix-path.git cd matrix-path - Build the Docker image:
docker build -t matrix-job:latest . - Create a local Kubernetes cluster using Kind:
kind create cluster --name matrix-cluster
- Load the Docker image into the Kind cluster:
kind load docker-image matrix-job:latest --name matrix-cluster
- Create a ConfigMap from your input matrix:
kubectl create configmap matrix-config --from-file=matrix.txt
- Deploy the Kubernetes Job:
kubectl apply -f job.yaml
- Check the Job's output:
kubectl logs job/matrix-path-job
After completing the installation steps:
- Ensure the ConfigMap and Job are created (see Installation).
- To check the status of the job:
kubectl get jobs - To view the logs/output of the job:
kubectl logs job/matrix-path-job
Feel free to modify matrix.txt with your own matrix input.