class_docstr: An orchestrator implmentation which uses Kubernetes to deploy the components such as training and rollout workers
  and Redis Pub/Sub in Coach when used in the distributed mode.
class_docstr_tok: ["An","orchestrator","implmentation","which","uses","Kubernetes","to","deploy","the","components","such","as","training","and","rollout","workers","and","Redis","Pub\/Sub","in","Coach","when","used","in","the","distributed","mode","."]
docstr: Get the logs from trainer.
docstr_tok: ["Get","the","logs","from","trainer","."]
code: def trainer_logs(self):
      """
      Get the logs from trainer.
      """
      trainer_params = self.params.run_type_params.get(
          str(RunType.TRAINER), None
      )
      if not trainer_params:
          return
  
      api_client = k8sclient.CoreV1Api()
      pod = None
      try:
          pods = api_client.list_namespaced_pod(
              self.params.namespace,
              label_selector="app={}".format(
                  trainer_params.orchestration_params["job_name"]
              ),
          )
  
          pod = pods.items[0]
      except k8sclient.rest.ApiException as e:
          screen.print("Got exception: %s\n while reading pods", e)
          return
  
      if not pod:
          return
  
      return self.tail_log(pod.metadata.name, api_client)
  
imports: import os
  import uuid
  import json
  import time
  import sys
  from enum import Enum
  from typing import List
  from configparser import ConfigParser, Error
  from multiprocessing import Process
  from rl_coach.base_parameters import RunType
  from rl_coach.orchestrators.deploy import Deploy, DeployParameters
  from kubernetes import client, config
  from rl_coach.memories.backend.memory import MemoryBackendParameters
  from rl_coach.memories.backend.memory_impl import get_memory_backend
  from rl_coach.data_stores.data_store import DataStoreParameters
  from rl_coach.data_stores.data_store_impl import get_data_store
  from rl_coach.logger import screen
label_desc: Use image node_id 7 for calling the Kubernetes obj's underlying member method code with example usage: obj.trainer_logs() and returns: self