coordinator-core: add multi coordinator Kubernetes integration (#39)

Signed-off-by: Benedict Schlueter <bs@edgeless.systems>
This commit is contained in:
Benedict Schlueter 2022-04-25 17:26:17 +02:00 committed by Benedict Schlüter
parent 0ac9617dac
commit 86178df205
19 changed files with 359 additions and 154 deletions

View file

@ -178,11 +178,11 @@ func (a *API) JoinCluster(ctx context.Context, in *pubproto.JoinClusterRequest)
return nil, status.Errorf(codes.Internal, "request K8s join string: %v", err)
}
err = a.core.JoinCluster(kubeadm.BootstrapTokenDiscovery{
err = a.core.JoinCluster(&kubeadm.BootstrapTokenDiscovery{
APIServerEndpoint: resp.ApiServerEndpoint,
Token: resp.Token,
CACertHashes: []string{resp.DiscoveryTokenCaCertHash},
})
}, "", role.Node)
if err != nil {
_ = a.core.AdvanceState(state.Failed, nil, nil)
return nil, status.Errorf(codes.Internal, "joining kubernetes cluster: %v", err)