{"id":28198625,"url":"https://github.com/ziul/swagger-operator","last_synced_at":"2026-04-13T22:31:39.156Z","repository":{"id":293530252,"uuid":"980761696","full_name":"Ziul/swagger-operator","owner":"Ziul","description":"A Kubernetes operator that automatically discovers services annotated with OpenAPI/Swagger documentation and aggregates their documentation in a single UI.","archived":false,"fork":false,"pushed_at":"2025-07-31T14:28:34.000Z","size":143,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-31T18:13:55.069Z","etag":null,"topics":["containers","fastapi","helm","kopf","kubernetes","kubernetes-operator","openapi","python","swagger-ui"],"latest_commit_sha":null,"homepage":"https://ziul.github.io/swagger-operator/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ziul.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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,"zenodo":null},"funding":{"github":["Ziul","gutorc92"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":"Ziul","thanks_dev":null,"custom":null}},"created_at":"2025-05-09T17:07:45.000Z","updated_at":"2025-07-31T14:28:37.000Z","dependencies_parsed_at":"2025-06-03T14:30:57.591Z","dependency_job_id":"336f7db9-f5f4-42ce-a6c8-26b4cebcdc2c","html_url":"https://github.com/Ziul/swagger-operator","commit_stats":null,"previous_names":["ziul/swagger-operator"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/Ziul/swagger-operator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ziul%2Fswagger-operator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ziul%2Fswagger-operator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ziul%2Fswagger-operator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ziul%2Fswagger-operator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ziul","download_url":"https://codeload.github.com/Ziul/swagger-operator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ziul%2Fswagger-operator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31773985,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T20:17:16.280Z","status":"ssl_error","status_checked_at":"2026-04-13T20:17:08.216Z","response_time":93,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["containers","fastapi","helm","kopf","kubernetes","kubernetes-operator","openapi","python","swagger-ui"],"created_at":"2025-05-16T18:13:44.900Z","updated_at":"2026-04-13T22:31:39.149Z","avatar_url":"https://github.com/Ziul.png","language":"Python","funding_links":["https://github.com/sponsors/Ziul","https://github.com/sponsors/gutorc92","https://buymeacoffee.com/Ziul"],"categories":[],"sub_categories":[],"readme":"# Swagger Operator\n\n[![Build Status](https://github.com/Ziul/swagger-operator/actions/workflows/cicd.yaml/badge.svg)](https://github.com/Ziul/swagger-operator/actions)\n[![Latest Release](https://img.shields.io/github/v/release/Ziul/swagger-operator?label=release\u0026color=blue)](https://github.com/Ziul/swagger-operator/releases)\n[![Docker Pulls](https://img.shields.io/docker/pulls/ziuloliveira/swagger-operator)](https://hub.docker.com/r/ziuloliveira/swagger-operator)\n[![License](https://img.shields.io/github/license/Ziul/swagger-operator)](https://github.com/Ziul/swagger-operator/blob/main/LICENSE)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n[![security: bandit](https://img.shields.io/badge/security-bandit-yellow.svg)](https://github.com/PyCQA/bandit)\n\nA Kubernetes operator that automatically discovers services annotated with OpenAPI/Swagger documentation and aggregates their documentation in a single UI.\n\n\n## Table of Contents\n\n- [Features](#features)\n- [Getting Started (Helm)](#getting-started-helm)\n- [How to Annotate Your Services](#how-to-annotate-your-services)\n- [Accessing the UI](#accessing-the-ui)\n- [Configuration \u0026 Customization](#configuration--customization)\n  - [Environment Variables](#environment-variables)\n  - [OIDC Authentication (SSO)](#oidc-authentication-sso)\n- [Local Development](#local-development)\n- [License](#license)\n\n\n## Features\n\n- Watches Kubernetes services for specific annotations.\n- Aggregates OpenAPI/Swagger endpoints from discovered services.\n- Serves a dynamic Swagger UI or Redoc using FastAPI.\n- Easy deployment with Helm.\n\n\n## Getting Started (Helm)\n\nInstall the Swagger Operator using the Helm Chart:\n\n```bash\nhelm repo add swagger-operator https://ziul.github.io/swagger-operator/\nhelm repo update\nhelm install my-release swagger-operator/swagger-operator\n```\n\n\n### How to Annotate Your Services\n\nAdd the following annotations to your Kubernetes services:\n\n```yaml\nmetadata:\n  annotations:\n    swagger-operator-path: \"/openapi.json\"   # Path to your OpenAPI spec\n    swagger-operator-name: \"My Service\"      # (Optional) Display name\n    swagger-operator-port: \"8080\"            # (Optional) Service port\n    swagger-operator-header: |\n      Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=\n      X-Custom-Header: my-value\n      Another-Header: another-value\n    # (Optional) Extra headers\n```\n\n\n### Accessing the UI\n\nExpose the operator service (default port: 80) and access `/` to see the aggregated documentation.\n\n---\n\n## Configuration \u0026 Customization\n\n### Environment Variables\n\nYou can customize the operator's behavior via environment variables:\n\n| Variable                        | Default                     | Description                                                                 |\n|----------------------------------|-----------------------------|-----------------------------------------------------------------------------|\n| `SWAGGER_OPERATOR_PATH_KEY`      | `swagger-operator-path`     | Annotation key for the OpenAPI path.                                        |\n| `SWAGGER_OPERATOR_NAME_KEY`      | `swagger-operator-name`     | Annotation key for the service display name.                                |\n| `SWAGGER_OPERATOR_PORT_KEY`      | `swagger-operator-port`     | Annotation key for the service port.                                        |\n| `SWAGGER_OPERATOR_HEADER_KEY`    | `swagger-operator-header`   | Annotation key for extra headers.                                           |\n| `PROXY_TIMEOUT`                  | `10`                        | Timeout for proxy requests (in seconds).                                    |\n| `ENABLE_OIDC`                    | `false`                     | Enables (`true`) or disables (`false`) OIDC authentication.                 |\n| `TITLE`                          | `API Documentation`         | Title for the UI.                                                           |\n| `INTERFACE`                      | `swagger-ui`                | UI interface (`swagger-ui` or `redoc`).                                     |\n\n\n### OIDC Authentication (SSO)\n\nBy default, SSO is configured through the Helm chart. The following values can be set in your `values.yaml`:\n\n```yaml\nsso:\n  enabled: false\n  existingSecret: \"\"\n  metadataUrl: \"\"\n  clientSecret: \"\"\n  clientID: \"\"\n  authCallback: \"\"\n```\n\nYou have two options to configure SSO:\n\n#### 1. Using an existing Kubernetes Secret\n\nSet `sso.existingSecret` to the name of your secret. The Secret must contain the following fields:\n\n- `OIDC_CLIENT_SECRET`\n- `ENABLE_OIDC`\n- `OIDC_METADATA_URL`\n- `OIDC_CLIENT_ID`\n- `AUTH_CALLBACK`\n\n**Example:**\n\n```yaml\nsso:\n  enabled: true\n  existingSecret: your-secret-name\n```\n\n**Example Secret:**\n\n```yaml\napiVersion: v1\nkind: Secret\nmetadata:\n  name: your-secret-name\ntype: Opaque\nstringData:\n  OIDC_CLIENT_SECRET: your-client-secret\n  ENABLE_OIDC: \"true\"\n  OIDC_METADATA_URL: https://your-oidc-provider.com/.well-known/openid-configuration\n  OIDC_CLIENT_ID: your-client-id\n  AUTH_CALLBACK: https://your-app.com/auth/callback\n```\n\n#### 2. Setting values directly in the Helm chart\n\nAlternatively, you can provide the SSO configuration directly in your `values.yaml`:\n\n```yaml\nsso:\n  enabled: true\n  existingSecret: \"\"\n  metadataUrl: https://your-oidc-provider.com/.well-known/openid-configuration\n  clientSecret: your-client-secret\n  clientID: your-client-id\n  authCallback: https://your-app.com/auth/callback\n```\n\nIf both `existingSecret` and the direct values are provided, the operator will prioritize the existing secret.\n\n---\n\n## Local Development\n\nFor local development:\n\n1. Install dependencies with [Poetry](https://python-poetry.org/):\n\n    ```bash\n    poetry install\n    ```\n\n2. Run the FastAPI server locally:\n\n    ```bash\n    poetry run fastapi run server.py\n    ```\n\n3. Run the operator:\n\n    ```bash\n    poetry run kopf run controller.py\n    ```\n\n\n## License\n\nMIT License\n\n---\n\nMade with ❤️ by [Luiz Oliveira](https://github.com/ziul) and [Gustavo Coelho](https://github.com/gutorc92).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fziul%2Fswagger-operator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fziul%2Fswagger-operator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fziul%2Fswagger-operator/lists"}