-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set ETCD_UNSUPPORTED_ARCH on ARM controller nodes (#184)
* set ETCD_UNSUPPORTED_ARCH on arm nodes Signed-off-by: erdii <[email protected]> * use h.Configurer.WriteFile to upload arm override file Signed-off-by: erdii <[email protected]> * Finetuning * Use rig 0.3.24 for service env management * Whoops, left out the arm * Missing return * Update go.mod * Try trickery * Ok the file cant be called _arm * ineffassign * Clean up service environment during reset even if k0s not running * More cleaning up * Ok, after hooks were interntionally even if it errored Co-authored-by: Kimmo Lehto <[email protected]>
- Loading branch information
Showing
10 changed files
with
178 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package phase | ||
|
||
import ( | ||
"strings" | ||
|
||
log "github.com/sirupsen/logrus" | ||
|
||
"github.com/k0sproject/k0sctl/config" | ||
"github.com/k0sproject/k0sctl/config/cluster" | ||
) | ||
|
||
// PrepareArm implements a phase which fixes arm quirks | ||
type PrepareArm struct { | ||
GenericPhase | ||
|
||
hosts cluster.Hosts | ||
} | ||
|
||
// Title for the phase | ||
func (p *PrepareArm) Title() string { | ||
return "Prepare ARM nodes" | ||
} | ||
|
||
// Prepare the phase | ||
func (p *PrepareArm) Prepare(config *config.Cluster) error { | ||
p.Config = config | ||
|
||
p.hosts = p.Config.Spec.Hosts.Filter(func(h *cluster.Host) bool { | ||
arch := h.Metadata.Arch | ||
return h.Role != "worker" && (strings.HasPrefix(arch, "arm") || strings.HasPrefix(arch, "aarch")) | ||
}) | ||
|
||
return nil | ||
} | ||
|
||
// ShouldRun is true when there are arm controllers | ||
func (p *PrepareArm) ShouldRun() bool { | ||
return len(p.hosts) > 0 | ||
} | ||
|
||
// Run the phase | ||
func (p *PrepareArm) Run() error { | ||
return p.hosts.ParallelEach(p.etcdUnsupportedArch) | ||
} | ||
|
||
func (p *PrepareArm) etcdUnsupportedArch(h *cluster.Host) error { | ||
var arch string | ||
switch h.Metadata.Arch { | ||
case "aarch32", "arm32", "armv7l", "armhfp", "arm-32": | ||
arch = "arm32" | ||
default: | ||
arch = "arm64" | ||
} | ||
|
||
log.Warnf("%s: enabling ETCD_UNSUPPORTED_ARCH=%s override - you may encounter problems with etcd", h, arch) | ||
h.Environment["ETCD_UNSUPPORTED_ARCH"] = arch | ||
|
||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters