1
0
mirror of https://github.com/rancher/rke.git synced 2025-09-13 05:34:11 +00:00

Make etcd provisioning a public API

This commit is contained in:
Darren Shepherd
2018-03-31 03:53:43 -07:00
parent 149f866c47
commit d2c58fb8e6
4 changed files with 70 additions and 26 deletions

View File

@@ -48,6 +48,35 @@ func UpCommand() cli.Command {
}
}
func EtcdUp(ctx context.Context, currentCluster, kubeCluster *cluster.Cluster, disablePortCheck bool) error {
log.Infof(ctx, "Checking ETCD")
if err := kubeCluster.TunnelHosts(ctx, false); err != nil {
return err
}
if !disablePortCheck {
if err := kubeCluster.CheckClusterPorts(ctx, currentCluster); err != nil {
return err
}
}
if currentCluster != nil {
if err := cluster.ReconcileEtcd(ctx, currentCluster, kubeCluster, nil, false); err != nil {
return err
}
}
if err := kubeCluster.DeployETCD(ctx); err != nil {
return err
}
if len(kubeCluster.InactiveHosts) > 0 {
return fmt.Errorf("failed to contact to %s", kubeCluster.InactiveHosts[0].Address)
}
return nil
}
func ClusterUp(
ctx context.Context,
rkeConfig *v3.RancherKubernetesEngineConfig,