-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set ETCD_UNSUPPORTED_ARCH on ARM controller nodes #184
Changes from 13 commits
1bab18f
824a291
e5409ea
1230745
bcf9e64
063fd2e
b1b765c
ea62bda
652a925
2d477d3
194671e
6fc18d2
7870739
bc4fa62
40a9ecc
f76f476
7a95c7d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What did h.Environment previously do? Will this also set There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It goes both ways, this way also all the |
||
|
||
return nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is that list from? Maybe it makes sense to link the source here in a comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Several sources, I googled around, there seems to be a huge load of different ones, it's possible this is still incomplete. I think the most important ones here are
aarch32
andarmv7l
which I think are commonly seen in raspberries.