tutorial

Monitoring Kubernetes Clusters Managed with K9s Using Vigilmon

K9s gives you a powerful terminal UI for Kubernetes, but it has no persistent uptime monitoring. Here's how to add external health checks, pod crash alerts, and cron heartbeats to your K9s-managed clusters with Vigilmon.

K9s is the go-to terminal UI for navigating and managing Kubernetes clusters — it turns kubectl commands into a live, navigable dashboard right inside your terminal. But K9s is an operational tool, not a monitoring one: close it and you lose visibility. Vigilmon picks up where K9s leaves off, providing external uptime checks, SSL certificate alerts, and cron heartbeat monitoring that run 24/7 regardless of whether you have a terminal session open.

What You'll Set Up

  • HTTP uptime monitors for services exposed by your K9s-managed cluster
  • TCP port checks for cluster API server and node ports
  • Cron heartbeats for scheduled Kubernetes Jobs and CronJobs
  • SSL certificate monitoring for ingress endpoints
  • Alert channels for downtime notification

Prerequisites

  • A running Kubernetes cluster you manage with K9s (local or remote)
  • At least one service or ingress exposed over HTTP/HTTPS
  • A free Vigilmon account

Step 1: Monitor Exposed Service Endpoints

Any service exposed via a LoadBalancer, NodePort, or Ingress in your cluster is a candidate for uptime monitoring. Add a Vigilmon HTTP monitor for each critical service:

  1. Log in to vigilmon.online and click Add Monitor.
  2. Set Type to HTTP / HTTPS.
  3. Enter the service URL — for an ingress: https://api.yourdomain.com, or for a NodePort: http://<node-ip>:30080.
  4. Set Check interval to 1 minute.
  5. Set Expected HTTP status to 200.
  6. Click Save.

To list all exposed services in K9s, press : and type services, then filter by LoadBalancer or NodePort type. The EXTERNAL-IP and PORT(S) columns give you the exact addresses to monitor.

For services with a health endpoint, use it:

https://api.yourdomain.com/healthz

Kubernetes-native health endpoints (liveness/readiness probes) are defined in the pod spec — expose the same path externally through the ingress for Vigilmon to probe.


Step 2: Add Kubernetes Health Endpoints to Your Services

If your services don't yet expose a health route, add one. Vigilmon's external probe validates that the full network path — ingress → service → pod — is working, not just that the process is alive internally.

Example: Go HTTP service

http.HandleFunc("/healthz", func(w http.ResponseWriter, r *http.Request) {
    w.Header().Set("Content-Type", "application/json")
    w.Write([]byte(`{"status":"ok"}`))
})

Example: Node.js / Express

app.get('/healthz', (req, res) => {
  res.json({ status: 'ok', uptime: process.uptime() });
});

After deploying, verify the endpoint is reachable from outside the cluster:

kubectl get ingress -A         # find the ingress hostname
curl https://api.yourdomain.com/healthz

In K9s, press :ingresses to confirm the ingress is bound and shows an ADDRESS.


Step 3: Monitor the Kubernetes API Server

The cluster API server (port 6443 by default) is the control plane entry point — if it goes down, kubectl and K9s both fail. Add a TCP monitor for it:

  1. In Vigilmon, click Add MonitorTCP Port.
  2. Set Host to your control plane node IP or hostname.
  3. Set Port to 6443.
  4. Set Check interval to 1 minute.
  5. Click Save.

For managed clusters (EKS, GKE, AKS), the API server is cloud-managed. Use the cluster's API endpoint URL from your kubeconfig:

kubectl config view --minify -o jsonpath='{.clusters[0].cluster.server}'
# e.g. https://12.34.56.78:6443

A TCP check here confirms the API server is accepting connections even before you open K9s.


Step 4: Heartbeat Monitoring for Kubernetes CronJobs

Kubernetes CronJobs run on a schedule but don't alert you if they fail silently or are never scheduled. Use Vigilmon's cron heartbeat to detect missed runs:

  1. In Vigilmon, click Add MonitorCron Heartbeat.
  2. Set the Expected ping interval to match your CronJob's schedule (e.g. 60 minutes for an hourly job).
  3. Copy the heartbeat URL: https://vigilmon.online/heartbeat/abc123.

Add a ping to your CronJob container command:

apiVersion: batch/v1
kind: CronJob
metadata:
  name: data-sync
spec:
  schedule: "0 * * * *"
  jobTemplate:
    spec:
      template:
        spec:
          restartPolicy: OnFailure
          containers:
            - name: sync
              image: your-sync-image:latest
              command:
                - /bin/sh
                - -c
                - |
                  python sync.py && \
                  wget -qO- https://vigilmon.online/heartbeat/abc123

The && ensures the ping only fires if the job succeeds. A missed ping after the expected interval triggers an alert — catching both job crashes and scheduler failures.

Apply the updated manifest:

kubectl apply -f cronjob.yaml

In K9s, press :cronjobs to confirm the schedule and last run time.


Step 5: SSL Certificate Monitoring for Ingress Endpoints

Ingress TLS certificates (managed by cert-manager or Let's Encrypt) can expire without warning if renewal fails. Add SSL monitoring in Vigilmon:

  1. Open the HTTP monitor for your ingress endpoint.
  2. Enable Monitor SSL certificate.
  3. Set Alert when certificate expires in less than 21 days.
  4. Click Save.

Check the current certificate status in K9s by pressing :certificates (requires cert-manager CRDs) or via kubectl:

kubectl get certificates -A
kubectl describe certificate my-cert -n default

A Vigilmon SSL alert at 21 days gives you time to investigate before cert-manager's own renewal window (typically 30 days before expiry).


Step 6: Configure Alert Channels

  1. Go to Alert Channels in Vigilmon and add Slack, email, PagerDuty, or a webhook.
  2. Set Consecutive failures before alert to 2 — rolling restarts and scheduling delays can cause a single probe to fail without the cluster being truly down.
  3. Add a Maintenance window when performing cluster upgrades. Automate it via the Vigilmon API:
# Before a cluster upgrade or node drain
curl -X POST https://vigilmon.online/api/maintenance \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{"monitor_id": "abc123", "duration_minutes": 15}'

# Upgrade your cluster
kubectl drain node1 --ignore-daemonsets
# ... perform upgrade ...
kubectl uncordon node1

# Maintenance window expires automatically

Summary

| Monitor | Target | What It Catches | |---|---|---| | HTTP uptime | https://api.yourdomain.com/healthz | Pod crash, ingress misconfiguration | | TCP port | Control plane :6443 | API server down | | Cron heartbeat | CronJob ping URL | Missed schedule, job failure | | SSL certificate | Ingress TLS endpoint | cert-manager renewal failure |

K9s makes Kubernetes operations fast and visual, but it's an active tool — it only watches while you're watching. Vigilmon runs continuously in the background, alerting you the moment a service drops, a certificate nears expiry, or a scheduled job goes silent. Together they give you both the control-plane visibility K9s excels at and the always-on uptime assurance your production workloads require.

Monitor your app with Vigilmon

Free plan — 5 monitors, no credit card required. Up and running in 60 seconds.

Start free →