> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/api-reference/platform-apis/core-platform/k8s-pod-diagnostics.md).

# K8s Pod Diagnostics

APIs to view Kubernetes pod status, events and log references captured during deployments

## GET /cd/deployment/pod-diagnostics/overall

> Get a paginated, one-row-per-pod flattened view of pod diagnostics across a pipeline execution

```json
{"openapi":"3.0.1","info":{"title":"Harness NextGen Software Delivery Platform API Reference","version":"3.0"},"tags":[{"name":"K8s Pod Diagnostics","description":"APIs to view Kubernetes pod status, events and log references captured during deployments"}],"servers":[{"url":"https://ng-manager-7b6bb5bdbc-5jxjn/gateway/ng/api"}],"paths":{"/cd/deployment/pod-diagnostics/overall":{"get":{"tags":["K8s Pod Diagnostics"],"summary":"Get a paginated, one-row-per-pod flattened view of pod diagnostics across a pipeline execution","operationId":"getK8sPodDiagnosticsOverall","parameters":[{"name":"accountIdentifier","in":"query","description":"Account Identifier for the Entity.","required":true,"schema":{"type":"string"}},{"name":"orgIdentifier","in":"query","description":"Organization Identifier for the Entity.","required":true,"schema":{"type":"string"}},{"name":"projectIdentifier","in":"query","description":"Project Identifier for the Entity.","required":true,"schema":{"type":"string"}},{"name":"pipelineIdentifier","in":"query","description":"Pipeline identifier","required":true,"schema":{"type":"string"}},{"name":"planExecutionId","in":"query","description":"Plan execution Id","required":true,"schema":{"type":"string"}},{"name":"stageExecutionId","in":"query","description":"Optional stage execution Id filter","schema":{"type":"string"}},{"name":"stepIdentifier","in":"query","description":"Optional step identifier filter","schema":{"type":"string"}},{"name":"phase","in":"query","description":"Optional pod phase filter","schema":{"type":"string"}},{"name":"containerState","in":"query","description":"Optional container state filter","schema":{"type":"string"}},{"name":"namespace","in":"query","description":"Optional namespace filter","schema":{"type":"string"}},{"name":"podName","in":"query","description":"Optional pod name filter","schema":{"type":"string"}},{"name":"latestAttemptOnly","in":"query","description":"Return one row per step identifier (latest nodeExecutionId) when true","schema":{"type":"boolean","default":true}},{"name":"page","in":"query","description":"Page Index of the results to fetch.Default Value: 0","schema":{"type":"integer","format":"int32","default":0}},{"name":"size","in":"query","description":"Results per page","schema":{"type":"integer","format":"int32","default":50}}],"responses":{"default":{"description":"Returns the flattened Overall pod diagnostics page","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseDTOK8sPodDiagnosticsOverallResponse"}}}}}}}},"components":{"schemas":{"ResponseDTOK8sPodDiagnosticsOverallResponse":{"type":"object","properties":{"status":{"type":"string","enum":["SUCCESS","FAILURE","ERROR"]},"data":{"$ref":"#/components/schemas/K8sPodDiagnosticsOverallResponse"},"metaData":{"type":"object"},"correlationId":{"type":"string"}}},"K8sPodDiagnosticsOverallResponse":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/K8sPodDiagnosticsOverallItem"}},"facets":{"$ref":"#/components/schemas/K8sPodDiagnosticsOverallFacets"},"page":{"type":"integer","format":"int32"},"size":{"type":"integer","format":"int32"},"totalItems":{"type":"integer","format":"int64"},"latestAttemptOnly":{"type":"boolean"}},"description":"Paginated, one-row-per-pod flattened view across stages and steps, plus facets for filter UI"},"K8sPodDiagnosticsOverallItem":{"type":"object","properties":{"planExecutionId":{"type":"string"},"stageExecutionId":{"type":"string"},"stageIdentifier":{"type":"string"},"stageName":{"type":"string"},"nodeExecutionId":{"type":"string"},"stepIdentifier":{"type":"string"},"stepName":{"type":"string"},"stepType":{"type":"string"},"attempt":{"type":"integer","format":"int32"},"podUid":{"type":"string"},"podName":{"type":"string"},"namespace":{"type":"string"},"nodeName":{"type":"string"},"podIP":{"type":"string"},"workload":{"type":"string"},"image":{"type":"string"},"phase":{"type":"string"},"phaseSince":{"type":"integer","format":"int64"},"since":{"type":"integer","format":"int64"},"deletionTimestamp":{"type":"integer","format":"int64"},"ready":{"type":"boolean"},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/K8sPodDiagnosticsPodCondition"}},"readyContainers":{"type":"integer","format":"int32"},"totalContainers":{"type":"integer","format":"int32"},"restartCount":{"type":"integer","format":"int32"},"diagnosticReason":{"type":"string"},"collectionState":{"type":"string","enum":["DISCOVERING","COLLECTING","FINALIZING","COMPLETE","INCOMPLETE","ERROR","NOT_APPLICABLE"]},"capturedAt":{"type":"integer","format":"int64"},"truncated":{"$ref":"#/components/schemas/K8sPodDiagnosticsTruncated"},"logBaseKey":{"type":"string"},"containers":{"type":"array","items":{"$ref":"#/components/schemas/K8sPodDiagnosticsPodContainerStatus"}}},"description":"A single pod row in the flattened cross-stage/cross-step Overall view"},"K8sPodDiagnosticsPodCondition":{"type":"object","properties":{"type":{"type":"string"},"status":{"type":"string"},"reason":{"type":"string"},"message":{"type":"string"},"lastTransitionTime":{"type":"integer","format":"int64"}},"description":"A single Kubernetes pod condition"},"K8sPodDiagnosticsTruncated":{"type":"object","properties":{"pods":{"type":"boolean"},"events":{"type":"boolean"},"logs":{"type":"boolean"}},"description":"Indicates whether pods, events or logs were capped"},"K8sPodDiagnosticsPodContainerStatus":{"type":"object","properties":{"name":{"type":"string"},"image":{"type":"string"},"init":{"type":"boolean"},"state":{"type":"string"},"reason":{"type":"string"},"message":{"type":"string"},"since":{"type":"integer","format":"int64"},"ready":{"type":"boolean"},"started":{"type":"boolean"},"restartCount":{"type":"integer","format":"int32"},"exitCode":{"type":"integer","format":"int32"},"currentInstanceId":{"type":"string"},"previousInstanceId":{"type":"string"},"logInstances":{"type":"array","items":{"$ref":"#/components/schemas/K8sPodDiagnosticsLogInstance"}}},"description":"Latest observed status of a single container, plus captured log instance references"},"K8sPodDiagnosticsLogInstance":{"type":"object","properties":{"instanceId":{"type":"string"},"restartCount":{"type":"integer","format":"int32"},"startedAt":{"type":"integer","format":"int64"},"finishedAt":{"type":"integer","format":"int64"},"logKey":{"type":"string"},"logState":{"type":"string","enum":["STREAMING","ARCHIVED","EMPTY","PENDING","RBAC_DENIED","FAILED"]}},"description":"A captured container instance and its opaque log reference; never carries log bodies"},"K8sPodDiagnosticsOverallFacets":{"type":"object","properties":{"stages":{"type":"array","items":{"$ref":"#/components/schemas/K8sPodDiagnosticsStageFacet"}},"steps":{"type":"array","items":{"$ref":"#/components/schemas/K8sPodDiagnosticsStepFacet"}},"namespaces":{"type":"array","items":{"type":"string"}},"phases":{"type":"array","items":{"type":"string"}},"containerStates":{"type":"array","items":{"type":"string"}}},"description":"Distinct filter values present in the current Overall result set, for building filter UI"},"K8sPodDiagnosticsStageFacet":{"type":"object","properties":{"stageExecutionId":{"type":"string"},"stageIdentifier":{"type":"string"},"stageName":{"type":"string"}},"description":"A distinct stage present in the Overall result set"},"K8sPodDiagnosticsStepFacet":{"type":"object","properties":{"stepIdentifier":{"type":"string"},"stepName":{"type":"string"}},"description":"A distinct step present in the Overall result set"}}}}
```

## GET /cd/deployment/pod-diagnostics

> Get the latest captured pod diagnostics summary for a single step execution

```json
{"openapi":"3.0.1","info":{"title":"Harness NextGen Software Delivery Platform API Reference","version":"3.0"},"tags":[{"name":"K8s Pod Diagnostics","description":"APIs to view Kubernetes pod status, events and log references captured during deployments"}],"servers":[{"url":"https://ng-manager-7b6bb5bdbc-5jxjn/gateway/ng/api"}],"paths":{"/cd/deployment/pod-diagnostics":{"get":{"tags":["K8s Pod Diagnostics"],"summary":"Get the latest captured pod diagnostics summary for a single step execution","operationId":"getK8sPodDiagnosticsStepSummary","parameters":[{"name":"accountIdentifier","in":"query","description":"Account Identifier for the Entity.","required":true,"schema":{"type":"string"}},{"name":"orgIdentifier","in":"query","description":"Organization Identifier for the Entity.","required":true,"schema":{"type":"string"}},{"name":"projectIdentifier","in":"query","description":"Project Identifier for the Entity.","required":true,"schema":{"type":"string"}},{"name":"pipelineIdentifier","in":"query","description":"Pipeline identifier","required":true,"schema":{"type":"string"}},{"name":"planExecutionId","in":"query","description":"Plan execution Id","required":true,"schema":{"type":"string"}},{"name":"nodeExecutionId","in":"query","description":"Node execution Id of the step","required":true,"schema":{"type":"string"}}],"responses":{"default":{"description":"Returns the step pod diagnostics summary","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseDTOK8sPodDiagnosticsStepSummary"}}}}}}}},"components":{"schemas":{"ResponseDTOK8sPodDiagnosticsStepSummary":{"type":"object","properties":{"status":{"type":"string","enum":["SUCCESS","FAILURE","ERROR"]},"data":{"$ref":"#/components/schemas/K8sPodDiagnosticsStepSummary"},"metaData":{"type":"object"},"correlationId":{"type":"string"}}},"K8sPodDiagnosticsStepSummary":{"type":"object","properties":{"nodeExecutionId":{"type":"string"},"planExecutionId":{"type":"string"},"stageExecutionId":{"type":"string"},"stepIdentifier":{"type":"string"},"stepType":{"type":"string"},"stepName":{"type":"string"},"releaseName":{"type":"string"},"namespaces":{"type":"array","items":{"type":"string"}},"collectionState":{"type":"string","enum":["DISCOVERING","COLLECTING","FINALIZING","COMPLETE","INCOMPLETE","ERROR","NOT_APPLICABLE"]},"generation":{"type":"integer","format":"int64"},"capturedAt":{"type":"integer","format":"int64"},"truncated":{"$ref":"#/components/schemas/K8sPodDiagnosticsTruncated"},"namespaceIssues":{"type":"array","items":{"$ref":"#/components/schemas/K8sPodDiagnosticsNamespaceIssue"}},"summary":{"$ref":"#/components/schemas/K8sPodDiagnosticsSummary"},"logBaseKey":{"type":"string"},"message":{"type":"string"}},"description":"Latest pod diagnostics summary captured for a single step execution"},"K8sPodDiagnosticsTruncated":{"type":"object","properties":{"pods":{"type":"boolean"},"events":{"type":"boolean"},"logs":{"type":"boolean"}},"description":"Indicates whether pods, events or logs were capped"},"K8sPodDiagnosticsNamespaceIssue":{"type":"object","properties":{"namespace":{"type":"string"},"operation":{"type":"string"},"reason":{"type":"string"},"message":{"type":"string"}},"description":"A list-pods/list-events denial or failure observed for a namespace in the cohort"},"K8sPodDiagnosticsSummary":{"type":"object","properties":{"pods":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/K8sPodDiagnosticsPodStatus"}}},"description":"Latest observed pod cohort for a step, keyed by pod uid"},"K8sPodDiagnosticsPodStatus":{"type":"object","properties":{"name":{"type":"string"},"namespace":{"type":"string"},"nodeName":{"type":"string"},"podIP":{"type":"string"},"workload":{"type":"string"},"image":{"type":"string"},"phase":{"type":"string"},"phaseSince":{"type":"integer","format":"int64"},"deletionTimestamp":{"type":"integer","format":"int64"},"ready":{"type":"boolean"},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/K8sPodDiagnosticsPodCondition"}},"containers":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/K8sPodDiagnosticsPodContainerStatus"}}},"description":"Latest observed status of a single pod in the cohort"},"K8sPodDiagnosticsPodCondition":{"type":"object","properties":{"type":{"type":"string"},"status":{"type":"string"},"reason":{"type":"string"},"message":{"type":"string"},"lastTransitionTime":{"type":"integer","format":"int64"}},"description":"A single Kubernetes pod condition"},"K8sPodDiagnosticsPodContainerStatus":{"type":"object","properties":{"name":{"type":"string"},"image":{"type":"string"},"init":{"type":"boolean"},"state":{"type":"string"},"reason":{"type":"string"},"message":{"type":"string"},"since":{"type":"integer","format":"int64"},"ready":{"type":"boolean"},"started":{"type":"boolean"},"restartCount":{"type":"integer","format":"int32"},"exitCode":{"type":"integer","format":"int32"},"currentInstanceId":{"type":"string"},"previousInstanceId":{"type":"string"},"logInstances":{"type":"array","items":{"$ref":"#/components/schemas/K8sPodDiagnosticsLogInstance"}}},"description":"Latest observed status of a single container, plus captured log instance references"},"K8sPodDiagnosticsLogInstance":{"type":"object","properties":{"instanceId":{"type":"string"},"restartCount":{"type":"integer","format":"int32"},"startedAt":{"type":"integer","format":"int64"},"finishedAt":{"type":"integer","format":"int64"},"logKey":{"type":"string"},"logState":{"type":"string","enum":["STREAMING","ARCHIVED","EMPTY","PENDING","RBAC_DENIED","FAILED"]}},"description":"A captured container instance and its opaque log reference; never carries log bodies"}}}}
```

## GET /cd/deployment/pod-diagnostics/timeline

> Get a cursor-paginated page of historic container status transitions and Kubernetes events

```json
{"openapi":"3.0.1","info":{"title":"Harness NextGen Software Delivery Platform API Reference","version":"3.0"},"tags":[{"name":"K8s Pod Diagnostics","description":"APIs to view Kubernetes pod status, events and log references captured during deployments"}],"servers":[{"url":"https://ng-manager-7b6bb5bdbc-5jxjn/gateway/ng/api"}],"paths":{"/cd/deployment/pod-diagnostics/timeline":{"get":{"tags":["K8s Pod Diagnostics"],"summary":"Get a cursor-paginated page of historic container status transitions and Kubernetes events","operationId":"getK8sPodDiagnosticsTimeline","parameters":[{"name":"accountIdentifier","in":"query","description":"Account Identifier for the Entity.","required":true,"schema":{"type":"string"}},{"name":"orgIdentifier","in":"query","description":"Organization Identifier for the Entity.","required":true,"schema":{"type":"string"}},{"name":"projectIdentifier","in":"query","description":"Project Identifier for the Entity.","required":true,"schema":{"type":"string"}},{"name":"pipelineIdentifier","in":"query","description":"Pipeline identifier","required":true,"schema":{"type":"string"}},{"name":"planExecutionId","in":"query","description":"Plan execution Id","required":true,"schema":{"type":"string"}},{"name":"nodeExecutionId","in":"query","description":"Node execution Id of the step","required":true,"schema":{"type":"string"}},{"name":"types","in":"query","description":"Filter by entry kind: STATUS, EVENT, or both","schema":{"type":"array","items":{"type":"string","enum":["STATUS","EVENT"]}}},{"name":"podUid","in":"query","description":"Optional pod uid filter","schema":{"type":"string"}},{"name":"containerName","in":"query","description":"Optional container name filter","schema":{"type":"string"}},{"name":"from","in":"query","description":"Optional range start (epoch millis)","schema":{"type":"integer","format":"int64"}},{"name":"to","in":"query","description":"Optional range end (epoch millis)","schema":{"type":"integer","format":"int64"}},{"name":"cursor","in":"query","description":"Opaque pagination cursor","schema":{"type":"string"}},{"name":"limit","in":"query","description":"Max entries to return, capped server-side","schema":{"type":"integer","format":"int32","default":100}}],"responses":{"default":{"description":"Returns a page of timeline entries","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseDTOK8sPodDiagnosticsTimelinePage"}}}}}}}},"components":{"schemas":{"ResponseDTOK8sPodDiagnosticsTimelinePage":{"type":"object","properties":{"status":{"type":"string","enum":["SUCCESS","FAILURE","ERROR"]},"data":{"$ref":"#/components/schemas/K8sPodDiagnosticsTimelinePage"},"metaData":{"type":"object"},"correlationId":{"type":"string"}}},"K8sPodDiagnosticsTimelinePage":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/K8sPodDiagnosticsTimelineEvent"}},"nextCursor":{"type":"string"},"truncated":{"type":"boolean"}},"description":"A cursor-paginated page of historic status/event timeline entries for a step execution"},"K8sPodDiagnosticsTimelineEvent":{"type":"object","properties":{"kind":{"type":"string","enum":["STATUS","EVENT"]},"time":{"type":"integer","format":"int64"},"podUid":{"type":"string"},"containerName":{"type":"string"},"status":{"type":"string"},"reason":{"type":"string"},"ready":{"type":"boolean"},"started":{"type":"boolean"},"restartCount":{"type":"integer","format":"int32"},"exitCode":{"type":"integer","format":"int32"},"type":{"type":"string"},"message":{"type":"string"},"involvedObject":{"$ref":"#/components/schemas/K8sPodDiagnosticsInvolvedObject"}},"description":"A single historic container-status transition or Kubernetes event, discriminated by kind"},"K8sPodDiagnosticsInvolvedObject":{"type":"object","properties":{"kind":{"type":"string"},"name":{"type":"string"},"uid":{"type":"string"}},"description":"The Kubernetes object an event was raised against"}}}}
```
