mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-04-20 23:36:29 -04:00
bootstrapper: only run disk prioritizer on control plane join
This commit is contained in:
parent
9acb4e08b9
commit
5d7800f7fd
@ -31,6 +31,7 @@ go_test(
|
||||
srcs = ["kubernetes_test.go"],
|
||||
embed = [":kubernetes"],
|
||||
deps = [
|
||||
"//bootstrapper/internal/etcdio",
|
||||
"//bootstrapper/internal/kubernetes/k8sapi",
|
||||
"//bootstrapper/internal/kubernetes/kubewaiter",
|
||||
"//internal/cloud/metadata",
|
||||
|
@ -263,13 +263,15 @@ func (k *KubeWrapper) JoinCluster(ctx context.Context, args *kubeadm.BootstrapTo
|
||||
return fmt.Errorf("joining cluster: %v; %w ", string(joinConfigYAML), err)
|
||||
}
|
||||
|
||||
k.log.Info("Prioritizing etcd I/O")
|
||||
err = k.etcdIOPrioritizer.PrioritizeIO()
|
||||
if errors.Is(err, etcdio.ErrNoEtcdProcess) {
|
||||
k.log.Warn("Skipping etcd I/O prioritization as etcd process is not running. " +
|
||||
"This is expected if this node is a non-control-plane node.")
|
||||
} else if err != nil {
|
||||
return fmt.Errorf("prioritizing etcd I/O: %w", err)
|
||||
// If on control plane (and thus with etcd), try to prioritize etcd I/O.
|
||||
if peerRole == role.ControlPlane {
|
||||
k.log.Info("Prioritizing etcd I/O")
|
||||
err = k.etcdIOPrioritizer.PrioritizeIO()
|
||||
if errors.Is(err, etcdio.ErrNoEtcdProcess) {
|
||||
k.log.Warn("No etcd process found, skipping I/O prioritization. Is this a single-node cluster?")
|
||||
} else if err != nil {
|
||||
return fmt.Errorf("prioritizing etcd I/O: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
|
Loading…
x
Reference in New Issue
Block a user