Merge pull request #6563 from dokku/wait-for-init
Wait until initial k3s node is ready before installing manifests
This commit is contained in:
@@ -216,6 +216,19 @@ func CommandInitialize(serverIP string, taintScheduling bool) error {
|
|||||||
return fmt.Errorf("Unable to create kubernetes client: %w", err)
|
return fmt.Errorf("Unable to create kubernetes client: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
common.LogInfo2Quiet("Waiting for node to exist")
|
||||||
|
nodes, err := waitForNodeToExist(ctx, WaitForNodeToExistInput{
|
||||||
|
Clientset: clientset,
|
||||||
|
NodeName: nodeName,
|
||||||
|
RetryCount: 20,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("Error waiting for pod to exist: %w", err)
|
||||||
|
}
|
||||||
|
if len(nodes) == 0 {
|
||||||
|
return fmt.Errorf("Unable to find node after initializing cluster, node will not be annotated/labeled appropriately access registry secrets")
|
||||||
|
}
|
||||||
|
|
||||||
for _, manifest := range KubernetesManifests {
|
for _, manifest := range KubernetesManifests {
|
||||||
common.LogInfo2Quiet(fmt.Sprintf("Installing %s@%s", manifest.Name, manifest.Version))
|
common.LogInfo2Quiet(fmt.Sprintf("Installing %s@%s", manifest.Name, manifest.Version))
|
||||||
err = clientset.ApplyKubernetesManifest(ctx, ApplyKubernetesManifestInput{
|
err = clientset.ApplyKubernetesManifest(ctx, ApplyKubernetesManifestInput{
|
||||||
|
|||||||
Reference in New Issue
Block a user