pydo.kubernetes.run_cluster_lint()

Description

Clusterlint helps operators conform to Kubernetes best practices around resources, security and reliability to avoid common problems while operating or upgrading the clusters.

To request a clusterlint run on your cluster, send a POST request to /v2/kubernetes/clusters/$K8S_CLUSTER_ID/clusterlint. This will run all checks present in the doks group by default, if a request body is not specified. Optionally specify the below attributes.

For information about the available checks, please refer to the clusterlint check documentation.

Parameters

Name Type Required Description Default Value
cluster_id string True A unique ID that can be used to reference a Kubernetes cluster.
body JSON or IO[bytes] False

Request Sample

import os
from pydo import Client

client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))

req = {
  "include_groups": [
    "basic",
    "doks",
    "security"
  ],
  "include_checks": [
    "bare-pods",
    "resource-requirements"
  ],
  "exclude_groups": [
    "workload-health"
  ],
  "exclude_checks": [
    "default-namespace"
  ]
}

resp = client.kubernetes.run_cluster_lint(cluster_id="1fd32a", body=req)

Responses

See the API spec for this endpoint to view additional detail on responses, headers, parameters, and more.

The response is a JSON object with a key called run_id that you can later use to fetch the run results.

Click to expand an example response.
{
  "run_id": "50c2f44c-011d-493e-aee5-361a4a0d1844"
}

Unauthorized

Click to expand an example response.
{
  "id": "unauthorized",
  "message": "Unable to authenticate you."
}

The resource was not found.

Click to expand an example response.
{
  "id": "not_found",
  "message": "The resource you requested could not be found."
}

API Rate limit exceeded

Click to expand an example response.
{
  "id": "too_many_requests",
  "message": "API Rate limit exceeded."
}

Server error.

Click to expand an example response.
{
  "id": "server_error",
  "message": "Unexpected server-side error"
}

Unexpected error

Click to expand an example response.
{
  "id": "example_error",
  "message": "some error message"
}