Project reference ↗

GCP Night King addressed a specific problem with older preemptible Compute Engine instances: starting a named machine again after Google interrupted it. A shutdown script sent a message through Pub/Sub, and Night King watched for those messages and attempted the restart. It was useful for that custom instance-management workflow. A managed node pool may already own replacement, so this historical service should not be added without checking who controls the machines.

Deployment and operating notes

The historical chart points to itamaro/gcp-go-night-king. Its README describes receiving Pub/Sub messages from shutdown scripts and restarting named GCE instances after preemption. This confirms the mechanism, but not a maintained current chart or compatibility with every modern Compute Engine and GKE provisioning model.

Before using it, determine whether the instances belong to a managed instance group or a GKE node pool that already owns replacement. A second service restarting instances can conflict with that owner and defeat intended scale-down. For GKE, evaluate the documented Spot VM and node-pool behavior instead of assuming the old restart service is required. Preserve shutdown-script configuration, Pub/Sub subscriptions and IAM bindings while diagnosing a legacy deployment. Test interruption handling on disposable capacity, including lost notifications and unavailable replacement capacity. Applications still need checkpoints or retry-safe work: restarting a VM does not recover in-memory progress. No automatic migration from Night King to a managed node pool was established.

Historical upstream link check · 2026-10-09

The recorded upstream address responded successfully (HTTP 200) on 2026-10-09. GitHub confirms that helm/charts is archived: this is a historical chart distribution, not evidence that the application itself is retired. Link availability does not certify the historical installation instructions or current security support.

Source for this check ↗

Website availability is separate from project, chart and image support. Use the current guidance and primary sources on this page to assess the distribution.

The original record

Historical Kubedex content

Preserved for context. Commands, versions, prices and results below reflect the original research.

This directory contains a Kubernetes chart to deploy a GCP Night King service. The Night King service is a service that restarts preempted GCE instances.

It uses Google Cloud Pub/Sub for reporting instance preemption.

When a machine is about to be preempted, if it should be restarted, it should publish a Pub/Sub message to a known topic. The Night King service subscribes to the Pub/Subtopic and tries to restart instances accordingly, once they are terminated.

Chart Details

This chart will do the following:

  • Install a service (K8s Deployment) that listens on a Pub/Sub subscription for instance preemption messages and resurrects preempted instances once they are terminated.

Running The Night King service

The service is implemented in Go, and prebuilt Docker images are provided. In either case, you’ll need to have Google Cloud SDK authorization set up for the service to be able to receive messages from Google Pub/Sub and use the GCE Compute API.

The Docker bind-mount is useful to share your host Google Cloud credentials – feel free to use other methods to obtain appropriate Google Cloud credentials inside Docker.

There are multiple ways to have the service running “in production” (e.g., not in the foreground of your dev-machine terminal).

You can use whatever method fits your environment (deployment-setup contributions are welcome). See below details for already-supprted methods.

Sources & further reading

  1. GCP Night King design
  2. GKE Spot VM behavior
  3. Recovered historical source (Common Crawl index)

Spotted something that needs another look?

Help improve this page →