kubernetes/kops · error

error reading kube-apiserver-healthcheck manifest

Error message

error reading kube-apiserver-healthcheck manifest %s: %w

What it means

addHealthcheckSidecar wraps ReadFile failure for the kube-apiserver-healthcheck static manifest stored in the cluster's config base. It fires when the manifest file at manifest.Path cannot be fetched from state storage (missing object, permissions, connectivity); the healthcheck sidecar cannot be injected into the apiserver pod without it.

Solutions

  1. Check state store access from the node
  2. Verify the healthcheck manifest exists under the config base
  3. Re-run nodeup
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at nodeup/pkg/model/kube_apiserver_healthcheck.go:45 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05). Data as JSON: /api/errors/7181a075828f5afc. Report an issue: GitHub.

Appendix: source

Thrown at nodeup/pkg/model/kube_apiserver_healthcheck.go:45

	"k8s.io/kops/upup/pkg/fi/nodeup/nodetasks"
	"sigs.k8s.io/yaml"
)

func (b *KubeAPIServerBuilder) findHealthcheckManifest() *nodeup.StaticManifest {
	return b.findStaticManifest("kube-apiserver-healthcheck")
}

func (b *KubeAPIServerBuilder) addHealthcheckSidecar(ctx context.Context, pod *corev1.Pod) error {
	manifest := b.findHealthcheckManifest()
	if manifest == nil {
		return nil
	}

	p := b.ConfigBase.Join(manifest.Path)

	data, err := p.ReadFile(ctx)
	if err != nil {
		return fmt.Errorf("error reading kube-apiserver-healthcheck manifest %s: %w", p, err)
	}

	sidecar := &corev1.Pod{}
	if err := yaml.Unmarshal(data, sidecar); err != nil {
		return fmt.Errorf("error parsing kube-apiserver-healthcheck manifest %s: %w", p, err)
	}

	// Quick-and-dirty merge of the fields we care about
	pod.Spec.Containers = append(pod.Spec.Containers, sidecar.Spec.Containers...)
	pod.Spec.Volumes = append(pod.Spec.Volumes, sidecar.Spec.Volumes...)

	return nil
}

func (b *KubeAPIServerBuilder) addHealthcheckSidecarTasks(c *fi.NodeupModelBuilderContext) error {
	id := "kube-apiserver-healthcheck"
	secretsDir := "/etc/kubernetes/" + id + "/secrets"
	userID := wellknownusers.KubeApiserverHealthcheckID

View on GitHub (pinned to 4c8573c808)