Skip to main content

Kubernetes

Kubernetes is the industry-leading open-source container orchestration platform used for automating deployment, scaling, and management of containerized applications across clusters of hosts. This data integration platform provides comprehensive visibility into Kubernetes cluster resources, configurations, workloads, and deployments, enabling infrastructure teams, DevOps engineers, security professionals, and platform administrators to query, monitor, and audit their container orchestration environment.

CategoryContainers
DirectionQuery source
Sign-inKubeconfig File, In-Cluster Service Account
Query languagesSQLite
Tables38
Query templates146
Websitekubernetes.io

Before you start​

Huntbase signs in to Kubernetes with Kubeconfig File. Create the credential in Kubernetes first, then keep it to hand for the Connect step.

  1. For read-only access, bind the identity in your kubeconfig to the built-in view ClusterRole, for example kubectl create clusterrolebinding <binding-name> --clusterrole=view --serviceaccount=<namespace>:<serviceaccount-name>.
  2. Note the name of the kubeconfig context for the cluster you want to query.

Permissions:

  • view ClusterRole (read access to most namespaced objects, excluding Secrets)
Watch out for
  • The view role doesn't include Secrets or cluster-scoped resources. Grant a broader read-only role if you need those.
  • Clusters that use OpenID Connect (OIDC) authentication work without extra configuration.

For the vendor's own instructions, see Kubernetes RBAC and default roles.

tip

Use a dedicated, read-only credential for Huntbase where the product allows it. Huntbase only needs to read.

Connect Kubernetes​

  1. Go to Connections and click New connection, or click New connection on the Kubernetes product page.
  2. On Product, pick Kubernetes and choose the Owner.
  3. On Details, give the connection a Name and, optionally, a Description.
  4. On Connect, fill in the settings and credentials described below.
  5. On Verify, review the summary and click Create & check.

For everything else on the setup page — saving a draft, I'll do this later, and what each check result means — see Connections.

Settings​

Where your Kubernetes lives:

FieldRequiredNotes
Kubeconfig PathNoThe path to your kubeconfig file, which defaults to ~/.kube/config. You can also paste the kubeconfig contents here instead of a path.
Kubeconfig ContextNoThe kubeconfig context to use. If you leave it empty, the file's current context is used.
Custom Resource TablesNo
Source TypesNoSet to manifest to read only from the configured manifest files instead of a live cluster.
Manifest File PathsNo
Helm Rendered ChartsNo

Credentials​

Choose a Method, enter a Credential label (for example Production), then fill in the fields for that method.

Kubeconfig File​

No fields — choose this method to connect without credentials.

In-Cluster Service Account​

No fields — choose this method to connect without credentials.

Query it​

Once connected, Kubernetes can serve these languages in a query tab, and Scout can use it when you ask in Auto:

LanguageUse it for
SQLiteSQL over the 38 tables listed below, alongside every other connected source.

Example: SQLite​

Helm chart basic info — Retrieve basic information about Helm charts, including their names and paths.

select
chart_name,
path,
raw
from
helm_template;

Kubernetes ships with 146 query templates. Find them in Library › Queries — see Query templates.

Tables​

Kubernetes adds 38 tables. Browse their columns from Schema in the query bar's ⋯ menu.

All 38 tables
TableContains
helm_chartLists the configuration settings from the configured charts
helm_releaseList all of the releases of chart in a Kubernetes cluster
helm_templateLists the raw templates defined in the configured charts
helm_template_renderedLists the fully rendered templates using the values provided in the config
helm_valueLists the values from chart's values.yaml file as well as the values listed in the configured values override files
kubernetes_cluster_roleClusterRole contains rules that represent a set of permissions.
kubernetes_cluster_role_bindingA ClusterRoleBinding grants the permissions defined in a cluster role to a user or set of users. Access granted by ClusterRoleBinding is cluster-wide.
kubernetes_config_mapConfig Map can be used to store fine-grained information like individual properties or coarse-grained information like entire config files or JSON blobs.
kubernetes_cronjobCron jobs are useful for creating periodic and recurring tasks, like running backups or sending emails.
kubernetes_custom_resource_definitionKubernetes Custom Resource Definition.
kubernetes_daemonsetA DaemonSet ensures that all (or some) Nodes run a copy of a Pod.
kubernetes_deploymentKubernetes Deployment enables declarative updates for Pods and ReplicaSets.
kubernetes_endpointSet of addresses and ports that comprise a service. More info: https://kubernetes.io/docs/concepts/services-networking/service/#services-without-selectors.
kubernetes_endpoint_sliceEndpointSlice represents a subset of the endpoints that implement a service.
kubernetes_eventKubernetes Event is a report of an event somewhere in the cluster.
kubernetes_horizontal_pod_autoscalerKubernetes HorizontalPodAutoscaler is the configuration for a horizontal pod autoscaler, which automatically manages the replica count of any resource implementing the scale subresource based on the metrics specified.
kubernetes_ingressIngress exposes HTTP and HTTPS routes from outside the cluster to services within the cluster. Traffic routing is controlled by rules defined on the Ingress resource.
kubernetes_jobA Job creates one or more Pods and will continue to retry execution of the Pods until a specified number of them successfully terminate.
kubernetes_limit_rangeKubernetes Limit Range
kubernetes_namespaceKubernetes Namespace provides a scope for Names.
kubernetes_network_policyNetwork policy specifiy how pods are allowed to communicate with each other and with other network endpoints.
kubernetes_nodeKubernetes Node is a worker node in Kubernetes.
kubernetes_persistent_volumeA PersistentVolume (PV) is a piece of storage in the cluster that has been provisioned by an administrator or dynamically provisioned using Storage Classes. PVs are volume plugins like Volumes, but have a lifecycle independent of any individual Pod that uses the PV.
kubernetes_persistent_volume_claimA PersistentVolumeClaim (PVC) is a request for storage by a user.
kubernetes_podKubernetes Pod is a collection of containers that can run on a host. This resource is created by clients and scheduled onto hosts.
kubernetes_pod_disruption_budgetA Pod Disruption Budget limits the number of Pods of a replicated application that are down simultaneously from voluntary disruptions.
kubernetes_pod_security_policyA Pod Security Policy is a cluster-level resource that controls security sensitive aspects of the pod specification. The PodSecurityPolicy objects define a set of conditions that a pod must run with in order to be accepted into the system, as well as defaults for the related fields.
kubernetes_pod_templateKubernetes Pod Template is a collection of templates for creating copies of a predefined pod.
kubernetes_replicasetKubernetes replica set ensures that a specified number of pod replicas are running at any given time.
kubernetes_replication_controllerA Replication Controller makes sure that a pod or homogeneous set of pods are always up and available. If there are too many pods, it will kill some. If there are too few, the Replication Controller will start more.
kubernetes_resource_quotaKubernetes Resource Quota
kubernetes_roleRole contains rules that represent a set of permissions.
kubernetes_role_bindingA role binding grants the permissions defined in a role to a user or set of users. It holds a list of subjects (users, groups, or service accounts), and a reference to the role being granted.
kubernetes_secretSecrets can be used to store sensitive information either as individual properties or coarse-grained entries like entire files or JSON blobs.
kubernetes_serviceA service provides an abstract way to expose an application running on a set of Pods as a network service.
kubernetes_service_accountA service account provides an identity for processes that run in a Pod.
kubernetes_stateful_setA statefulSet is the workload API object used to manage stateful applications.
kubernetes_storage_classStorage class provides a way for administrators to describe the classes of storage they offer.

Next steps​