Search in sources :

Example 1 with PodLogs

use of io.kubernetes.client.PodLogs in project java by kubernetes-client.

the class LogsExample method main.

public static void main(String[] args) throws IOException, ApiException, InterruptedException {
    ApiClient client = Config.defaultClient();
    Configuration.setDefaultApiClient(client);
    CoreV1Api coreApi = new CoreV1Api(client);
    PodLogs logs = new PodLogs();
    V1Pod pod = coreApi.listNamespacedPod("default", "false", null, null, null, null, null, null, null, null).getItems().get(0);
    InputStream is = logs.streamNamespacedPodLog(pod);
    ByteStreams.copy(is, System.out);
}
Also used : PodLogs(io.kubernetes.client.PodLogs) InputStream(java.io.InputStream) V1Pod(io.kubernetes.client.models.V1Pod) ApiClient(io.kubernetes.client.ApiClient) CoreV1Api(io.kubernetes.client.apis.CoreV1Api)

Aggregations

ApiClient (io.kubernetes.client.ApiClient)1 PodLogs (io.kubernetes.client.PodLogs)1 CoreV1Api (io.kubernetes.client.apis.CoreV1Api)1 V1Pod (io.kubernetes.client.models.V1Pod)1 InputStream (java.io.InputStream)1