Feat/separate swagger server#8
Merged
Merged
Conversation
This commit introduces a new SwaggerServer CRD and controller to manage the Swagger UI deployment independently. This decouples the Swagger UI from the OpenAPIAggregator controller.
Key changes:
- Added `SwaggerServer` CRD (`api/v1alpha1/swaggerserver_types.go`) and its controller (`internal/controller/swaggerserver_controller.go`).
- The `SwaggerServer` controller now deploys a pre-built Swagger UI image (`ghcr.io/hellices/openapi-multi-swagger:latest` by default) and configures it based on the `openapi-specs` ConfigMap.
- Modified `OpenAPIAggregator` controller:
- Replaced `spec.labelSelector` with `spec.watchNamespaces` for service discovery.
- If `watchNamespaces` is empty or not provided, it watches services in the OpenAPIAggregator CR's namespace.
- If `watchNamespaces` is `[""]` or `["*"]`, it watches services in all namespaces (requires cluster-level RBAC).
- The `openapi-specs` ConfigMap is always created in the OpenAPIAggregator CR's namespace.
- ConfigMap data keys are now in the format `namespace.serviceName`.
- Updated RBAC rules (`config/rbac/role.yaml`, `config/rbac/role_binding.yaml`) to grant necessary cluster-wide permissions for watching services and managing ConfigMaps when `watchNamespaces` is set to all namespaces.
- Created sample ClusterRole and ClusterRoleBinding for users who want to grant cluster-wide read access to services for the operator.
- Removed the custom Swagger UI server code from `pkg/swagger`.
- Updated `README.md` to reflect these changes.
- Resolved duplicate `run` target in `Makefile`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.