{"id":18798576,"url":"https://github.com/liteobject/k8s-with-python-api","last_synced_at":"2026-01-02T02:30:14.252Z","repository":{"id":249187099,"uuid":"830694424","full_name":"LiteObject/k8s-with-python-api","owner":"LiteObject","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-02T22:45:11.000Z","size":21,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-29T18:21:17.162Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LiteObject.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-18T19:37:53.000Z","updated_at":"2024-07-25T03:44:07.000Z","dependencies_parsed_at":"2024-07-25T04:43:24.272Z","dependency_job_id":"e984cc0b-6a64-4661-859c-c133bab09e47","html_url":"https://github.com/LiteObject/k8s-with-python-api","commit_stats":null,"previous_names":["liteobject/k8s-with-python-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiteObject%2Fk8s-with-python-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiteObject%2Fk8s-with-python-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiteObject%2Fk8s-with-python-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LiteObject%2Fk8s-with-python-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LiteObject","download_url":"https://codeload.github.com/LiteObject/k8s-with-python-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239727055,"owners_count":19687099,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T22:12:24.336Z","updated_at":"2026-01-02T02:30:14.208Z","avatar_url":"https://github.com/LiteObject.png","language":"Python","readme":"# FastAPI Simple Application Setup Guide\n\nThis guide will help you set up and run the demo FastAPI.\n\n## Prerequisites\n\n- Python 3.7 or higher\n- pip (Python package installer)\n\n## Setup Steps\n\n1. Clone the repository:\n\n2. Create a virtual environment (optional but recommended):\n   ```\n   virtualenv .venv --python=python3.11 \n   ```\n3. Activate the virtual environment:\n- On Windows:\n  ```\n  .venv\\Scripts\\activate\n  ```\n- On macOS and Linux:\n  ```\n  source .venv/bin/activate\n  ```\n\n4. Install the required dependencies:\n   ```\n   pip install -r requirements.txt\n   ```     \n\n5. Create a file named `main.py` and copy the provided code into it.\n\n6. Run the application:\n   ```\n   uvicorn main:app --reload\n   ```\n\n7. The application should now be running. You can access it at `http://127.0.0.1:8000`.\n\n## API Endpoints\n\n1. Root Endpoint:\n- URL: `http://127.0.0.1:8000/`\n- Method: GET\n- Response: `{\"Hello\": \"World\"}`\n\n2. Item Details Endpoint:\n- URL: `http://127.0.0.1:8000/items/{item_id}`\n- Method: GET\n- Path Parameter: `item_id` (integer)\n- Query Parameter: `q` (optional, string)\n- Response: `{\"item_id\": item_id, \"q\": q}`\n\n## Testing the API\n\nYou can test the API using a web browser or a tool like curl:\n\n1. For the root endpoint:\n\n2. For the item details endpoint:\n\n## Development\n\nTo make changes to the application, edit the `main.py` file. The server will automatically reload when changes are detected if you used the `--reload` flag with uvicorn.\n\n## Stopping the Application\n\nTo stop the application, press `CTRL+C` in the terminal where it's running.\n\n---\n## Setup in docker\n### Create a docker image\n    docker build -t liteobject/my-fast-api .\n\n### Create a container using the image created in the previus step\n    docker run -p 8000:8000 liteobject/my-fast-api\n--- \n## Setup in K8s cluster\n### Run pods by applying the deployment.yaml file\n    kubectl apply -f deployment.yaml\n### Access the FastAPI application from a browser, you'll need to:\n    kubectl apply -f service.yaml \n   \n---\n### Run multiple commands together in PowerShell\n    docker build -t liteobject/my-fast-api . \u0026\u0026 docker push liteobject/my-fast-api:latest \u0026\u0026 kubectl rollout restart deployment/my-fastapi  \n\n### Check logs\nFind the name of your deployment:\n\n    kubectl get deployment\n\nCheck all logs from all the pods of the deployment:\n\n    kubectl logs deployment/\u003cDEPLOYEMENT_NAME\u003e -f\n\n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliteobject%2Fk8s-with-python-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliteobject%2Fk8s-with-python-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliteobject%2Fk8s-with-python-api/lists"}