-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Flatcar support #7084
Flatcar support #7084
Changes from all commits
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 |
---|---|---|
|
@@ -159,6 +159,9 @@ func (b *KubeletBuilder) kubeletPath() string { | |
if b.Distribution == distros.DistributionCoreOS { | ||
kubeletCommand = "/opt/kubernetes/bin/kubelet" | ||
} | ||
if b.Distribution == distros.DistributionFlatcar { | ||
kubeletCommand = "/opt/kubernetes/bin/kubelet" | ||
} | ||
if b.Distribution == distros.DistributionContainerOS { | ||
kubeletCommand = "/home/kubernetes/bin/kubelet" | ||
} | ||
|
@@ -261,6 +264,10 @@ func (b *KubeletBuilder) buildSystemdService() *nodetasks.Service { | |
// We add /opt/kubernetes/bin for our utilities (socat, conntrack) | ||
manifest.Set("Service", "Environment", "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/kubernetes/bin") | ||
} | ||
if b.Distribution == distros.DistributionFlatcar { | ||
// We add /opt/kubernetes/bin for our utilities (conntrack) | ||
manifest.Set("Service", "Environment", "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/kubernetes/bin") | ||
} | ||
manifest.Set("Service", "EnvironmentFile", "/etc/sysconfig/kubelet") | ||
|
||
// @check if we are using bootstrap tokens and file checker | ||
|
@@ -336,6 +343,30 @@ func (b *KubeletBuilder) addStaticUtils(c *fi.ModelBuilderContext) error { | |
} | ||
} | ||
|
||
if b.Distribution == distros.DistributionFlatcar { | ||
// Flatcar does not ship with conntrack. Install our own (statically linked) version | ||
// TODO: Extract to common function? | ||
for _, binary := range []string{"conntrack"} { | ||
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. I've checked and I've found out that Flatcar is shipped with 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. That is really good news - the omission of socat was so surprising! |
||
assetName := binary | ||
assetPath := "" | ||
asset, err := b.Assets.Find(assetName, assetPath) | ||
if err != nil { | ||
return fmt.Errorf("error trying to locate asset %q: %v", assetName, err) | ||
} | ||
if asset == nil { | ||
return fmt.Errorf("unable to locate asset %q", assetName) | ||
} | ||
|
||
t := &nodetasks.File{ | ||
Path: "/opt/kubernetes/bin/" + binary, | ||
Contents: asset, | ||
Type: nodetasks.FileType_File, | ||
Mode: s("0755"), | ||
} | ||
c.AddTask(t) | ||
} | ||
} | ||
|
||
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.
Just FYI we hopefully aren't using these tags any more. But no problem with leaving this in for now and removing once we confirm we're not using tags :-)