-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from csatib02/docs/add-documentation
docs: add initial documentation
- Loading branch information
Showing
5 changed files
with
85 additions
and
42 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Kube Pod Autocomplete documentation | ||
|
||
Kube Pod Autocomplete is a service designed to enhance the user experience when navigating resource lists in Kubernetes clusters. It can retrieve specific data based on the requested resource type and supported filters. | ||
|
||
## Supported resources | ||
|
||
| **Resource** | available Filters | | ||
|------------------|---------------------------------------| | ||
| pods ✅ | namespace, phase, labels, annotations | | ||
| services 🟡 | _Next up_ | | ||
|
||
## API-Spec | ||
|
||
Checkout the [openapi](openapi.yaml) file, or use the [swagger spec](swagger.html). | ||
|
||
## Quick-start | ||
|
||
Create a Cluster: | ||
|
||
```shell | ||
make up | ||
``` | ||
|
||
Deploy Kube Pod Autocomplete: | ||
|
||
```shell | ||
make deploy | ||
``` | ||
|
||
Deploy some pods: | ||
|
||
```shell | ||
make deploy-testdata | ||
``` | ||
|
||
Port-forward to Kube Pod Autocomplete: | ||
|
||
```shell | ||
kubectl port-forward -n kube-pod-autocomplete $(kubectl get pods -n kube-pod-autocomplete -o jsonpath='{.items[0].metadata.name}') 8080:8080 1>/dev/null & | ||
``` | ||
|
||
Hit the endpoint: | ||
|
||
```shell | ||
curl -X GET http://localhost:8080/search/autocomplete/pods | ||
``` | ||
|
||
## Future improvements | ||
|
||
- [ ] Add support for caching. (Based on tests with the current implementation with small amount of pods, the response speed is blazingly fast, but there can be problems in production environments.) | ||
- [ ] Generate API specification from OpenAPI spec. (The current implementation is a really simple POC, if the project is later expanded with additional endpoints code generation should be utilised.) |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<title>API Documentation</title> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/5.17.14/swagger-ui.css" /> | ||
</head> | ||
<body> | ||
<div id="swagger-ui"></div> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/5.17.14/swagger-ui-bundle.js"></script> | ||
<script> | ||
window.onload = () => { | ||
SwaggerUIBundle({ | ||
url: "./openapi.yaml", | ||
dom_id: '#swagger-ui', | ||
}); | ||
}; | ||
</script> | ||
</body> | ||
</html> |
This file contains 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