{"record":{"id":"7181a075828f5afc","repo":"kubernetes/kops","slug":"error-reading-kube-apiserver-healthcheck-manifest","errorCode":null,"errorMessage":"error reading kube-apiserver-healthcheck manifest %s: %w","messagePattern":"error reading kube-apiserver-healthcheck manifest (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nodeup/pkg/model/kube_apiserver_healthcheck.go","lineNumber":45,"sourceCode":"\t\"k8s.io/kops/upup/pkg/fi/nodeup/nodetasks\"\n\t\"sigs.k8s.io/yaml\"\n)\n\nfunc (b *KubeAPIServerBuilder) findHealthcheckManifest() *nodeup.StaticManifest {\n\treturn b.findStaticManifest(\"kube-apiserver-healthcheck\")\n}\n\nfunc (b *KubeAPIServerBuilder) addHealthcheckSidecar(ctx context.Context, pod *corev1.Pod) error {\n\tmanifest := b.findHealthcheckManifest()\n\tif manifest == nil {\n\t\treturn nil\n\t}\n\n\tp := b.ConfigBase.Join(manifest.Path)\n\n\tdata, err := p.ReadFile(ctx)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error reading kube-apiserver-healthcheck manifest %s: %w\", p, err)\n\t}\n\n\tsidecar := &corev1.Pod{}\n\tif err := yaml.Unmarshal(data, sidecar); err != nil {\n\t\treturn fmt.Errorf(\"error parsing kube-apiserver-healthcheck manifest %s: %w\", p, err)\n\t}\n\n\t// Quick-and-dirty merge of the fields we care about\n\tpod.Spec.Containers = append(pod.Spec.Containers, sidecar.Spec.Containers...)\n\tpod.Spec.Volumes = append(pod.Spec.Volumes, sidecar.Spec.Volumes...)\n\n\treturn nil\n}\n\nfunc (b *KubeAPIServerBuilder) addHealthcheckSidecarTasks(c *fi.NodeupModelBuilderContext) error {\n\tid := \"kube-apiserver-healthcheck\"\n\tsecretsDir := \"/etc/kubernetes/\" + id + \"/secrets\"\n\tuserID := wellknownusers.KubeApiserverHealthcheckID","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/nodeup/pkg/model/kube_apiserver_healthcheck.go#L27-L63","documentation":"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.","triggerScenarios":"Thrown at nodeup/pkg/model/kube_apiserver_healthcheck.go:45 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check state store access from the node","Verify the healthcheck manifest exists under the config base","Re-run nodeup"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}