added comments to new code
@@ -48,19 +48,23 @@ func init() {
func main() {
+ // create context
checkTimeLimit := time.Minute * 1
ctx, _ := context.WithTimeout(context.Background(), checkTimeLimit)
+ // create kubernetes client
kubernetesClient, err := kubeClient.Create("")
if err != nil {
log.Errorln("Error creating kubeClient with error" + err.Error())
}
+ // hits kuberhealthy endpoint to see if node is ready
err = nodeCheck.WaitForKuberhealthy(ctx)
if err != nil {
log.Errorln("Error waiting for kuberhealthy endpoint to be contactable by checker pod with error:" + err.Error())
}
+ // fetches kube proxy to see if it is ready
err = nodeCheck.WaitForKubeProxy(ctx, kubernetesClient, "kuberhealthy", "kube-system")
if err != nil {
log.Errorln("Error waiting for kube proxy to be ready and running on the node with error:" + err.Error())
