---
title: "Analyze a cluster from an ad-hoc kubeconfig URL"
method: POST
path: "/api/v1/k8s/logs/analyze-adhoc"
tags: ["K8s Cluster Info"]
---

# Analyze a cluster from an ad-hoc kubeconfig URL

`POST /api/v1/k8s/logs/analyze-adhoc`

## Request

- Base URL: `http://localhost:8080`
- URL: `http://localhost:8080/api/v1/k8s/logs/analyze-adhoc`
- Auth: none declared

Run cluster, security, cost, and diagnosis analysis against a kubeconfig loaded directly from an S3/HTTPS URL, without registering the cluster in the DB

## Request body

- K8sLogsAdhocAnalyzeClusterRequest
  - `cluster_name` string
  - `kubeconfig_url` string

## Response `200`

Combined analysis report

- K8sLogsCombinedClusterReport
  - `analysis` K8sLogsClusterAnalysis
    - `namespaceCount` integer
    - `nodes` K8sLogsNodeInfo[]
      - `age` string
      - `architecture` string
      - `cpu` string
      - `externalIp` string
      - `internalIp` string
      - `kubeletVersion` string
      - `memory` string
      - `name` string
      - `os` string
      - `pods` string
      - `ready` string
      - `roles` string[]
      - `unschedulable` boolean
    - `podCount` integer
    - `version` string
  - `clusterId` string
  - `clusterName` string
  - `cost` K8sLogsCostAnalysisReport
    - `clusterCpuCapacity` string
    - `clusterId` string
    - `clusterMemoryCapacity` string
    - `podsResourceUsage` object: namespace -> podName -> utilization
    - `timestamp` string
    - `totalCpuLimit` string
    - `totalCpuRequest` string
    - `totalMemoryLimit` string
    - `totalMemoryRequest` string
  - `diagnosis` K8sLogsDiagnosisReport
    - `clusterId` string
    - `problems` K8sLogsProblematicResource[]
      - `events` string[]: Relevant recent events
      - `kind` string: e.g., "Pod", "Deployment", "StatefulSet"
      - `message` string: Detailed message from status or events
      - `name` string
      - `namespace` string
      - `reason` string: e.g., "CrashLoopBackOff", "ImagePullBackOff", "Pending"
      - `solution` string: A suggested solution (can be AI-generated externally)
    - `summary` object: e.g., {"HighSeverityProblems": 5}
    - `timestamp` string
  - `errors` object
  - `security` K8sLogsSecurityAnalysisReport
    - `clusterId` string
    - `findings` K8sLogsSecurityFinding[]
      - `category` string: e.g., "Privilege Escalation", "Network Policy", "Resource Misconfiguration"
      - `containerName` string
      - `description` string
      - `namespace` string
      - `podName` string
      - `recommendation` string
      - `severity` string: e.g., "Critical", "High", "Medium", "Low"
    - `summary` object: e.g., {"Critical": 5, "High": 10}
    - `timestamp` string
  - `timestamp` string

## Other responses

- `400`: Bad Request
- `500`: Internal Server Error

---

[API](https://skmtc.dev/nife/apis/nife-io-swagger-api.md) - [All operations](https://skmtc.dev/nife/apis/nife-io-swagger-api/llms.txt) - [OpenAPI document](https://skmtc.dev/nife/apis/nife-io-swagger-api/revisions/6e868dc62795?raw)
