rmn7 opened a new pull request, #19712:
URL: https://github.com/apache/druid/pull/19712
### Description
Adds a new API to inspect the peon pod templates currently loaded by the
Kubernetes task runner's custom template pod adapter. These are configured via
`druid.indexer.runner.k8s.podTemplate.*` runtime properties pointing to files
on disk. This adds a way to see which templates the Overlord actually has
loaded.
#### Added a new API `/druid/indexer/v1/k8s/taskrunner/podTemplates`
Returns a JSON array of the configured templates, each as `{ "name":
<pod-template-key>, "podTemplate": <pod-spec> }`.
- Exposes the templates through a new
`PodTemplateSelector.getPodTemplates()` method that returns
`List<PodTemplateWithName>` (reusing the existing PodTemplateWithName wrapper).
- Guarded by `ConfigResourceFilter` which is the same gate as the sibling
`executionconfig` endpoints.
- Pod templates only exist for the pod template adapter. The endpoint
checks `TaskAdapter instanceof PodTemplateTaskAdapter` and for any other
adapter it returns a 404.
#### Release note
You can now retrieve the peon pod templates currently configured on the
Overlord via the new GET `/druid/indexer/v1/k8s/taskrunner/podTemplates`
endpoint. It returns each configured template's name and full pod spec. The
endpoint requires CONFIG read permission and returns 404 when the Overlord is
not using the custom template pod adapter.
<hr>
##### Key changed/added classes in this PR
- `KubernetesTaskRunnerPodTemplateResource`
- `PodTemplateSelector#getPodTemplates()`
<hr>
This PR has:
- [x] been self-reviewed.
- [ ] using the [concurrency
checklist](https://github.com/apache/druid/blob/master/dev/code-review/concurrency.md)
(Remove this item if the PR doesn't have any relation to concurrency.)
- [x] added documentation for new or modified features or behaviors.
- [x] a release note entry in the PR description.
- [x] added Javadocs for most classes and all non-trivial methods. Linked
related entities via Javadoc links.
- [ ] added or updated version, license, or notice information in
[licenses.yaml](https://github.com/apache/druid/blob/master/dev/license.md)
- [x] added comments explaining the "why" and the intent of the code
wherever would not be obvious for an unfamiliar reader.
- [x] added unit tests or modified existing tests to cover new code paths,
ensuring the threshold for [code
coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md)
is met.
- [ ] added integration tests.
- [ ] been tested in a test Druid cluster.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]