diff --git a/src/utils/k8sUtils.py b/src/utils/k8sUtils.py index c28ea7ede..43d2e76e6 100755 --- a/src/utils/k8sUtils.py +++ b/src/utils/k8sUtils.py @@ -178,7 +178,7 @@ def GetPod(selector): return podInfo -def GetLog(jobId): +def GetLog(jobId, tail=3000): # assume our job only one container per pod. selector = "run=" + jobId @@ -194,7 +194,7 @@ def GetLog(jobId): if "status" in item and "containerStatuses" in item["status"] and "containerID" in item["status"]["containerStatuses"][0]: containerID = item["status"]["containerStatuses"][0]["containerID"].replace("docker://", "") log["containerID"] = containerID - log["containerLog"] = kubectl_exec(" logs " + log["podName"]) + log["containerLog"] = kubectl_exec(" logs %s --tail=%s" % (log["podName"], str(tail))) logs.append(log) return logs