Skip to content

Configuration Guide

This guide covers all configuration options for the Kubernetes Home Assistant Integration.

Required Settings

Setting Description Example
Cluster Name A friendly name to identify this Kubernetes cluster in Home Assistant Production Cluster
Host Your Kubernetes API server host (IP address or hostname) 192.168.1.100
API Token A valid Kubernetes service account token eyJhbGciOiJSUzI1NiIs...

Optional Settings

Setting Description Default
Port Kubernetes API port 6443
CA Certificate Path to your cluster's CA certificate null
Verify SSL Whether to verify SSL certificates true
Monitor All Namespaces Enable to monitor all namespaces true
Namespaces List of namespaces to monitor (only shown when "Monitor All Namespaces" is disabled) Selected from cluster
Device Grouping Mode How entities are organized: namespace creates a separate device per monitored namespace, cluster puts every entity on the single cluster device namespace
Switch Update Interval How often the integration polls the cluster for resource updates (seconds); all entities are refreshed from that one poll 60
Scale Verification Timeout Maximum time to wait for scaling operations (seconds) 30
Scale Cooldown Seconds after a scaling operation during which cluster refreshes do not overwrite the switch's new state 10

Configuration via UI

The integration uses a two-step configuration process:

  1. Go to Settings → Devices & Services
  2. Click Add Integration
  3. Search for "Kubernetes"
  4. Step 1 - Connection Details: Fill in the required connection information:
  5. Cluster Name (used as the integration name)
  6. Kubernetes API Host
  7. API Token
  8. Optional: Port, CA Certificate, Verify SSL, and other settings
  9. Monitor All Namespaces (defaults to true)
  10. Step 2 - Namespace Selection (only if "Monitor All Namespaces" is disabled):
  11. The integration will automatically fetch available namespaces from your cluster
  12. Select one or more namespaces from the dropdown list
  13. You can select multiple namespaces by clicking on them

Reconfiguring the Integration

To change connection details or settings for an existing integration entry:

  1. Go to Settings → Devices & Services
  2. Find the Kubernetes integration card
  3. Click the three-dot menu (...) and select Reconfigure
  4. Update the desired settings (host, port, API token, SSL, namespaces, polling intervals, grouping mode)
  5. If "Monitor All Namespaces" is disabled, you will be prompted to select namespaces in a second step

Note: The cluster name cannot be changed during reconfiguration as it serves as the unique identifier for the integration entry. To change the cluster name, remove and re-add the integration.

Re-authentication

If the Kubernetes API starts rejecting the stored API token (HTTP 401 — the token expired, was revoked, or its ServiceAccount was deleted), the integration stops polling and Home Assistant raises a "Reauthentication needed" notification for that entry. Opening it shows a form that asks for a new API token only; the host, port, CA certificate, SSL, and namespace settings stay as configured. Once a valid token is submitted, the entry is updated and reloaded automatically.

Entries using Prefer in-cluster ServiceAccount token re-read the projected token file and retry before reporting an authentication failure, so ordinary token rotation never triggers this prompt. If such an entry does reach re-authentication, the projected token is being rejected persistently — submitting a token therefore also turns Prefer in-cluster ServiceAccount token off for that entry, so the token you entered is the one actually used. Re-enable the checkbox via Reconfigure once the ServiceAccount is healthy again. See Authentication Issues for how to obtain a fresh token.

Dashboard Panel

Once the integration is set up, a Kubernetes entry appears in the Home Assistant sidebar. The panel provides a built-in cluster dashboard with six tabs:

  • Overview — Cluster health badge, Kubernetes version (shown verbatim from the API server, including distro suffixes like -eks-… or +k3s1), resource count cards (click one to open the matching tab, pre-filtered via the URL — e.g. Ingresses opens Network filtered to Ingresses), namespace breakdown, Watch API status, and alerts (nodes with pressure, degraded workloads, problem pods, restarting pods, failed jobs, certificate problems — the same lists the cluster alert sensors expose; a pod alert shows the pod's reason such as CrashLoopBackOff, and clicking any alert opens the matching tab — Pods, Workloads (Jobs for failed Jobs), Nodes or Network (Certificates for certificate problems) — with the resource name in the search field). Updates live whenever cluster data changes — immediately via the Watch API (enabled by default), otherwise on each coordinator poll cycle — with a 60-second fallback refresh.
  • Nodes — Expandable list of all cluster nodes with status, real-time CPU/memory usage (requires metrics-server), and, when expanded, IPs, capacity, OS/kernel/runtime/kubelet details and conditions. Filterable by name and status. Each node has a Cordon / Uncordon button (the equivalent of the Schedulable switch) and a Drain button, which opens a dialog with the drain_node options and then lists the evicted, skipped and still-blocked pods.
  • Workloads — Management view for Deployments, StatefulSets, DaemonSets, CronJobs, and Jobs. Deployments, StatefulSets and DaemonSets show their summed CPU/memory usage when metrics-server is available. Deployments and StatefulSets can be started (scale to 1), stopped (scale to 0), and rolling-restarted; an HPA badge marks HPA-managed ones, whose scale dialog only allows scaling to 0; a Rollout stalled badge marks Deployments whose rollout hit ProgressDeadlineExceeded, which count as Degraded even while every old replica is still ready; DaemonSets rolling-restarted; CronJobs suspended, resumed, and triggered; Jobs deleted (requires HA admin role). Filterable by type, namespace, and status.
  • Pods — Sortable table of all pods with status, containers, restarts, CPU and memory usage (like kubectl top, e.g. 120m and 256 Mi; requires metrics-server, a dash otherwise and with Pods data collection off), node, IP, and age. Existing users who customised the visible columns get the CPU and Memory columns added once; hide them again via the column menu. The Status column reads like kubectl get pods: a broken pod shows its reason (CrashLoopBackOff, ImagePullBackOff, Init:Error, Unschedulable, …) in red, every other pod its phase. Filterable by name, namespace, and phase, plus a Problems chip (pods the Problem Pods sensor counts); click a pod name to open a detail dialog with its summary, every container (init containers included; image, ready, restarts, current and last state with reason and exit code) and its recent Kubernetes events, like kubectl describe pod (fetched live when opened, nothing is stored; open to non-admins unless the panel is admin-only; the events need list on events, which minimal lacks - the dialog then shows the containers and an RBAC hint); each pod can be deleted (requires HA admin role). With the experimental pod logs option on, admins can also open a read-only log snapshot per pod.
  • Network — Up to four tables. Ingresses with class, clickable URLs (derived from TLS coverage), backing service, TLS status, and age. Gateway API HTTPRoutes (optional — the section only appears when the cluster has HTTPRoutes the integration may list) with clickable hostname URLs, the referenced Gateway(s), backend service(s), Accepted/Not Ready status (Accepted only when every parent Gateway accepted the route and resolved its references), and age; the clickable URL guesses https only when the route's parentRef pins port 443 or names a listener containing "https", "tls" or "websecure" (the integration doesn't fetch the Gateway itself, so it has no authoritative TLS info), else http. cert-manager Certificates (optional — the section only appears when the cluster has Certificates the integration may list) with DNS names, issuer, expiry (relative, plus the absolute date) and a status badge: Ready, Not Ready, Renewal Overdue (renewal time passed more than 24 hours ago) or Expired — the same rule as the Certificate Problems sensor. Services with type, cluster IP, external addresses, ports, and age — LoadBalancer and external IPs render as clickable links using a simple rule (port 443 → https, port 80 → http, any other TCP port → http://address:port). Filter by type with the dropdown (Ingress, HTTPRoute, Certificate, Services, or a single Service type); the search box matches every table by name, namespace, Ingress/HTTPRoute host, Certificate DNS name, or Service external address. Auto-refreshes every 60 seconds.
  • Settings — Read-only view of current integration configuration (connection, namespaces, timing, features). Links to the HA integration page for editing settings.

Links and reloads: the active tab and its filters live in the URL, so a reload keeps you where you were, the browser's back button moves between tabs, and a notification or dashboard button can link straight to a filtered view. Tabs are /kubernetes_panel (Overview), /kubernetes_panel/nodes, /workloads, /pods, /network and /settings; an unknown path opens Overview. Filters are query parameters, and a value that does not exist (a typo, a deleted namespace) falls back to "all":

Tab Parameters
Pods search, namespace, phase (Running, Pending, Succeeded, Failed, Unknown, or problems for the Problems chip), sort (namespace, name, phase, restarts, cpu, memory, node_name, age), dir (desc; ascending is the default)
Workloads search, namespace, category (deployments, statefulsets, daemonsets, cronjobs, jobs), status (healthy, degraded, stopped)
Nodes search, status (ready, not-ready)
Network search, type (Ingress, HTTPRoute, Certificate, Services, LoadBalancer, NodePort, ClusterIP, ExternalName)

Example: /kubernetes_panel/pods?phase=problems&namespace=default. The cluster is not part of the URL, and the pods table's column selection is a per-browser preference, not a link parameter. See the notification example.

Who sees the action buttons: every mutation control in the panel (start, stop, restart, scale, delete pod, delete Job, suspend/resume and trigger CronJob, cordon/uncordon node) is shown only to Home Assistant administrators, and so is the opt-in Logs button; non-admin users get the same tables without the buttons. The hiding is a convenience, not a security boundary: pod deletion, Job deletion and CronJob suspend/resume are also enforced server-side (admin-only WebSocket commands), but start/stop/restart/scale and cordon/uncordon go through the integration's services, and Home Assistant has no per-service admin restriction — a non-admin user can still call them from Developer Tools, a script or an automation. If you need a hard boundary, keep non-admin users away from the panel and the services via Home Assistant's user and dashboard settings.

The panel is registered automatically by default. To disable it, go to Settings > Devices & Services > Kubernetes > Configure and set Enable Sidebar Panel to off. The panel is shown if any configured cluster entry has it enabled.

Admin-only panel: turn on Admin-only Sidebar Panel in the same dialog to register the panel with Home Assistant's require_admin flag. Non-admin users then no longer see the sidebar entry, cannot open the panel's URL, and are refused by the WebSocket commands that serve the panel's cluster data. The panel shows all clusters, so it is admin-only as soon as one cluster entry sets the option, even an entry that has the panel itself turned off or is still starting up or retrying its connection. The WebSocket commands stay restricted while no entry shows the panel. The integration's services and entities are not affected: every user can still call the services and see the entities.

Advanced Configuration

Namespace Monitoring

  • All Namespaces (default): Set "Monitor All Namespaces" to true to monitor all namespaces in your cluster. Requires cluster-wide permissions.
  • Selected Namespaces: Set "Monitor All Namespaces" to false to select specific namespaces. You'll be prompted in a second step to choose which namespaces to monitor from a dropdown list populated from your cluster.

SSL Configuration

Verify SSL defaults to true. The connection test during setup, reconfiguration, and re-authentication uses exactly the TLS settings you enter, so a cluster whose certificate cannot be verified fails setup with Failed to connect instead of appearing to work and then breaking once the integration runs.

For clusters with a self-signed or custom Certificate Authority, do one of:

  • Provide the CA Certificate path (a file readable by Home Assistant) and keep Verify SSL on — this is the secure option
  • Turn Verify SSL off, which disables certificate verification entirely

Performance Tuning

  • Switch Update Interval: Lower values provide more responsive entities but increase API load. Entities themselves are never polled individually — they all update from the coordinator's single poll (or from the Watch API).
  • Scale Verification Timeout: Increase for slow clusters or large deployments
  • Scale Cooldown: After you switch a Deployment/StatefulSet on or off, the switch keeps showing the requested state for this many seconds even if a cluster refresh still reports the old replica count; increase it on slow clusters if switches flicker back briefly after scaling

Options (post-setup)

After the integration is set up, you can configure additional options by clicking Configure on the integration card in Settings → Devices & Services.

Watch API

Option Description Default
Enable Watch API Use the Kubernetes watch API for real-time updates instead of interval polling true

When enabled (the default), the integration establishes long-lived HTTP streams to the Kubernetes API server and receives ADDED, MODIFIED, and DELETED events as they happen. Pod and resource state changes typically appear in Home Assistant within seconds. Polling continues every 5 minutes as a fallback. Disable the option to use interval polling only (the Switch Update Interval, 60 seconds by default).

RBAC: The watch feature requires the service account to have watch permission on all monitored resources — granted by the full permission set, but not by minimal. If a watch connection keeps failing (network issues, an unreachable API server, or a server that keeps closing the stream right away without sending anything), the integration raises a repair issue and automatically falls back to regular interval polling, so data stays current. If the ServiceAccount is not allowed to watch a resource (HTTP 403), that stream retries once a minute and a Missing permissions repair issue names it; when every stream is forbidden (for example with the minimal RBAC mode) the integration polls at the regular interval instead. Add the RBAC rule (the chart's full mode and manifests/full/ include every rule the integration needs); the issue clears on its own once the watch delivers an event or stays open (after a list 403, on the next successful list). A short-lived 403 right after an API server restart (the RBAC authorizer has not loaded its rules yet) resolves the same way. See the RBAC guide for details.

Changing this option reloads the integration automatically.

Job and CronJob Pods

Option Description Default
Exclude Job and CronJob pods Skip pods owned by a Job or CronJob so they never become entities true

Every run of a Job or CronJob creates a pod with a fresh, single-use name. Tracking those pods means one new entity per run. Before the integration started purging pod tombstones (see Entity Management), Home Assistant kept a record of each one in its entity registry forever: one deployment reached 265,000 registry records (200 MB) from this alone. The records are now dropped an hour after the pod is gone, but every run still adds an entity, a recorder history and registry churn.

Excluding them is the default. Pods owned by a Deployment, StatefulSet, DaemonSet or ReplicaSet, and pods with no owner at all, are unaffected — only ownerReferences[0].kind == "Job" is filtered. Because a CronJob owns a Job which owns the pod, this covers both.

One side effect to be aware of:

  • Failed Job runs are no longer visible as pods. A Job pod that ends in phase Failed does not appear in the panel's failed-pods alerts, and there is no pod sensor with a problem attribute for it. Use the Job sensor (failed / succeeded / active attributes) or the Cluster Events entity (BackOff, OOMKilling, Failed, …) to alert on failing Jobs instead.

Turn the option off if you genuinely need an entity per Job run. Note that the Pods count sensor then also counts Job pods; with the filter on it counts only the tracked pods.

Changing this option reloads the integration automatically.

Cluster Events

Option Description Default
Enable Cluster Events Create a "Cluster events" event entity that fires Home Assistant events for Kubernetes cluster activity false
Event Types Which Kubernetes event types to surface — warning (Warning-type events only) or all (Warning and Normal) warning

When Enable Cluster Events is on, the integration creates one event entity per cluster named Cluster events. It tails the Kubernetes Events API using the same hardened watch infrastructure as the Watch API feature and dispatches matching events to Home Assistant.

The Kubernetes event reason becomes the HA event_type. A curated set of reasons (OOMKilling, FailedScheduling, BackOff, Evicted, Unhealthy, ImagePullBackOff, and others) are surfaced as distinct types; any unrecognised reason maps to other. Each event carries attributes for the involved object kind, name, namespace, message, count, and timestamp.

Note: The cluster event watch loop is independent of the Watch API toggle — enabling one does not enable the other.

RBAC: Reading Kubernetes events requires get, list, and watch verbs on the core v1 events resource. The full permission set (mode: full / manifests/full/) already grants these. The minimal set does not include events — with the Helm chart, add them via rbac.extraRules:

rbac:
  extraRules:
    - apiGroups: [""]
      resources: ["events"]
      verbs: ["get", "list", "watch"]

With the plain manifests, add the same rule to manifests/minimal/clusterrole.yaml by hand. See the RBAC guide for details.

Changing these options reloads the integration automatically.

Pod Logs (experimental)

Option Description Default
Enable pod logs in the panel (experimental) Adds a Logs button to each row of the panel's Pods tab false

The button opens a read-only snapshot of the pod's logs: pick the container (multi-container pods), the number of lines (100 / 500 / 2000), or the Previous container (the run before the last restart — usually where a crash is explained), then refresh or copy. Long lines wrap by default (untick Wrap lines for horizontal scrolling; the choice is remembered in the browser). Auto-refresh (off whenever the dialog opens) re-fetches every 5 seconds while the dialog is open and the browser tab is visible, and stops on close, on an error, or when Previous container is ticked; the view only follows the newest line while it is scrolled to the bottom. There is no live streaming — each refresh is a new snapshot. A snapshot is capped at 256 KiB; when the cap is hit, the newest part is shown and the dialog says so.

Security: logs routinely contain tokens, connection strings and personal data, which is why this is off by default. When it is on:

  • only Home Assistant administrators can fetch logs — the panel shows the button only to them, the WebSocket command rejects everyone else, and it refuses for every user while the option is off;
  • logs are fetched on demand and passed straight to the browser — they are never stored in the integration's data, never exposed as an entity or attribute, and not part of diagnostics.

RBAC: needs get on pods/log, which mode: full / manifests/full/ grants. The minimal set does not — add it via rbac.extraRules if you want logs there too, or remove the rule from your full ClusterRole if logs must never be readable. A missing rule shows up as an error in the log dialog, not as a repair issue.

Data Collection Opt-Out

Option Description Default
Disable data collection for Multi-select of data categories to stop collecting (empty — everything collected)

Large clusters can produce hundreds of entities and constant recorder writes. This option lets you opt out of categories you don't need, reducing entity count, database growth, and Kubernetes API load.

The categories come in two tiers:

Category Effect when disabled
Pods Pod detail fetch skipped entirely; no per-pod sensors and no Problem Pods or Restarting Pods sensor. The panel's Pods tab still works: it lists pods live from the API on each refresh while the tab is open (nothing is stored), so pod deletion and pod logs stay available
DaemonSets Fetch skipped entirely; no DaemonSet sensors
Jobs Fetch skipped entirely; no Job sensors and no Failed Jobs sensor
Ingresses Fetch skipped entirely; ingress data disappears from the panel
Services Fetch skipped entirely; service data disappears from the panel
HorizontalPodAutoscalers Fetch skipped entirely; workloads are never reported as HPA-managed, so the HPA scale guard and the panel's HPA badge are off. Use this if you don't want to grant the autoscaling RBAC rule
HTTPRoutes Fetch skipped entirely; the HTTPRoutes section disappears from the panel's Network tab. Use this if you don't use the Gateway API and don't want to grant the gateway.networking.k8s.io RBAC rule
Certificates Fetch skipped entirely; no Certificate Problems sensor and no Certificates section in the panel's Network tab. Use this if you don't run cert-manager (the sensor otherwise stays at 0) or don't want to grant the cert-manager.io RBAC rule
Node sensors Node status sensors, the 4 usage sensors, the 5 condition binary sensors (Ready + pressure) and the Nodes Under Pressure sensor are removed; the fetch continues so the cordon/uncordon switches keep working
Deployment sensors Status and CPU/memory sensors and the replica number entities removed; scale switches keep working
StatefulSet sensors Same as Deployment sensors
CronJob sensors CronJob status sensors removed; suspend switches keep working
CPU/memory metrics The Kubernetes Metrics API is never called — removes all workload and node CPU/memory sensors and node usage data (the "metrics server unavailable" repair issue is suppressed too)
Aggregate count sensors The 9 per-cluster count sensors (Pods Count, Nodes Count, …) are removed and their count API calls skipped

Notes:

  • Fully-skipped categories (Pods, DaemonSets, Jobs, Ingresses, Services, HorizontalPodAutoscalers, HTTPRoutes, Certificates) also stop their watch streams when the Watch API is enabled.
  • The Degraded Workloads sensor is removed only when Deployment sensors, StatefulSet sensors and DaemonSets are all disabled.
  • Existing entities of a disabled category are removed from Home Assistant automatically on the next update cycle.
  • If a fully-skipped category is disabled while Aggregate count sensors stay enabled, its count sensor keeps working via a lightweight count API call, and the panel's Overview count card shows the same number.
  • The delete_job service still works with Jobs disabled, but can no longer resolve a Job's namespace automatically — it falls back to the configured default namespace, so pass the namespace explicitly.

Changing this option reloads the integration automatically.