We need to extend the API server with these 3 endpoints:
-
- GET /logs/<namespace>/<podname>/<container_name>?starttime=0&endtime=0?&limit=100&level=debug - this will provide the same funcitonality we have now, but with the API path parameters and additional parameter *container_name.
-
- GET /logs_by_parent/namespace/<deployment | stateful set | daemonset >*?starttime=0&endtime=0?&limit=100&level=debug - this is still to be discussed. But, let's add a dummy method for it now.
-
- GET /logs_by_labels/<key1=val1,key2=val2>/?starttime=0&endtime=0?&limit=100&level=debug -* this will provide logs based on the K8S labels in the log entry
UPD:
After another discussion, we decided to join logs and logs_by_parent endpoints. So, we'd like to have one endpoint (the old one "logs/filter" will remain for backward compatibility), so it will allow specifying more parameters to narrow the search.
For example, the most wide search is like this:
/logs?starttime=0&endtime=0?&limit=100&level=debug
we can add a namespace:
/logs/namespace/{namespace}?starttime=0&endtime=0?&limit=100&level=debug
add pod name:
/logs/namespace/{namespace}/pod/{podname}?starttime=0&endtime=0?&limit=100&level=debug
or a container name:
/logs/namespace/{namespace}/pod/{podname}/container/{containername}?starttime=0&endtime=0?&limit=100&level=debug
or a high-level entity like deployment, daemonset, statefulset:
/logs/namespace/{namespace}/deployment/{deployment}?starttime=0&endtime=0?&limit=100&level=debug
/logs/namespace/{namespace}/daemonset/{daemonset}?starttime=0&endtime=0?&limit=100&level=debug
/logs/namespace/{namespace}/statefulset/{statefulset}?starttime=0&endtime=0?&limit=100&level=debug
or we can filter logs by labels:
/logs/bylabels/<k1=val1>,<k2=val2>...?starttime=0&endtime=0?&limit=100&level=debug
Acceptance criteria:
- All API endpoints added. (logs with the high-level entity is not tested but added as with dummy handler responding with something like "Not implemented"
- All API endpoints tested. (except logs with the high-level entity)
- In case of any changes in the ES provider, E2E test should be modified as well