https://github.com/kludex/fastapi-skaffold-debug
Need to debug your FastAPI application with Skaffold? Don't worry! :sunglasses:
https://github.com/kludex/fastapi-skaffold-debug
Last synced: 6 months ago
JSON representation
Need to debug your FastAPI application with Skaffold? Don't worry! :sunglasses:
- Host: GitHub
- URL: https://github.com/kludex/fastapi-skaffold-debug
- Owner: Kludex
- License: mit
- Created: 2021-01-10T21:37:23.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-01-10T21:44:47.000Z (over 4 years ago)
- Last Synced: 2025-03-28T07:12:23.456Z (6 months ago)
- Language: Makefile
- Size: 4.88 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
FastAPI Skaffold Debug - Single Pod 🐳Following the [FastAPI Docker Debug](https://github.com/Kludex/fastapi-docker-debug) repository, the [FastAPI Skaffold Debug - Single Pod](https://github.com/Kludex/fastapi-docker-debug) was born. 😎
We'll make use of the following tools:
* [minikube](https://minikube.sigs.k8s.io/docs/start/)
* [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/)
* [Skaffold](https://skaffold.dev/docs/install/)
* [Docker](https://docs.docker.com/get-docker/)
* [VSCode](https://code.visualstudio.com/download)So please, if you don't have them installed, feel free to do so.
## Usage
Make sure `minikube` is running.
``` bash
minikube start
```Run `skaffold`, you can use either the `dev` or `debug` command.
``` bash
skaffold dev # or debug
```Now you can press **F5** on your VSCode and the debugger will be attached to your pod.
Let's go inside the pod.
```bash
export POD_NAME=$(kubectl get pods -o go-template --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')
kubectl exec --stdin --tty $POD_NAME -- /bin/bash
```Make a request.
```bash
curl localhost:8080
```And 🎉! Now you're able to debug your FastAPI application that lives inside the pod. 😇
## License
This project is licensed under the terms of the MIT license.