k8supdates: label nodes with k8s component hash

This commit is contained in:
Leonard Cohnen 2022-12-06 18:48:01 +01:00 committed by 3u13r
parent 1466c12972
commit a1161ae05d
30 changed files with 869 additions and 18 deletions

View file

@ -163,6 +163,13 @@ func (k *KubeWrapper) InitCluster(
return nil, fmt.Errorf("waiting for Kubernetes API to be available: %w", err)
}
// Annotate Node with the hash of the installed components
if err := k.client.AnnotateNode(ctx, nodeName,
constants.NodeKubernetesComponentsHashAnnotationKey, kubernetesComponents.GetHash(),
); err != nil {
return nil, fmt.Errorf("annotating node with Kubernetes components hash: %w", err)
}
// Step 3: configure & start kubernetes controllers
log.Infof("Starting Kubernetes controllers and deployments")
setupPodNetworkInput := k8sapi.SetupPodNetworkInput{