Skip to content
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

Add support for Ubuntu 20.04 (Focal) #8727

Merged
merged 1 commit into from
Mar 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions nodeup/pkg/distros/distribution.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ var (
DistributionDebian10 Distribution = "buster"
DistributionXenial Distribution = "xenial"
DistributionBionic Distribution = "bionic"
DistributionFocal Distribution = "focal"
DistributionAmazonLinux2 Distribution = "amazonlinux2"
DistributionRhel7 Distribution = "rhel7"
DistributionCentos7 Distribution = "centos7"
Expand All @@ -51,6 +52,8 @@ func (d Distribution) BuildTags() []string {
t = []string{"_xenial"}
case DistributionBionic:
t = []string{"_bionic"}
case DistributionFocal:
t = []string{"_focal"}
case DistributionAmazonLinux2:
t = []string{"_amazonlinux2"}
case DistributionCentos7:
Expand Down Expand Up @@ -89,7 +92,7 @@ func (d Distribution) IsDebianFamily() bool {
switch d {
case DistributionJessie, DistributionDebian9, DistributionDebian10:
return true
case DistributionXenial, DistributionBionic:
case DistributionXenial, DistributionBionic, DistributionFocal:
return true
case DistributionCentos7, DistributionRhel7, DistributionCentos8, DistributionRhel8, DistributionAmazonLinux2:
return false
Expand All @@ -105,7 +108,7 @@ func (d Distribution) IsUbuntu() bool {
switch d {
case DistributionJessie, DistributionDebian9, DistributionDebian10:
return false
case DistributionXenial, DistributionBionic:
case DistributionXenial, DistributionBionic, DistributionFocal:
return true
case DistributionCentos7, DistributionRhel7, DistributionCentos8, DistributionRhel8, DistributionAmazonLinux2:
return false
Expand All @@ -121,7 +124,7 @@ func (d Distribution) IsRHELFamily() bool {
switch d {
case DistributionCentos7, DistributionRhel7, DistributionCentos8, DistributionRhel8, DistributionAmazonLinux2:
return true
case DistributionJessie, DistributionXenial, DistributionBionic, DistributionDebian9, DistributionDebian10:
case DistributionJessie, DistributionXenial, DistributionBionic, DistributionFocal, DistributionDebian9, DistributionDebian10:
return false
case DistributionCoreOS, DistributionFlatcar, DistributionContainerOS:
return false
Expand All @@ -133,7 +136,7 @@ func (d Distribution) IsRHELFamily() bool {

func (d Distribution) IsSystemd() bool {
switch d {
case DistributionJessie, DistributionXenial, DistributionBionic, DistributionDebian9, DistributionDebian10:
case DistributionJessie, DistributionXenial, DistributionBionic, DistributionFocal, DistributionDebian9, DistributionDebian10:
return true
case DistributionCentos7, DistributionRhel7, DistributionCentos8, DistributionRhel8, DistributionAmazonLinux2:
return true
Expand Down
4 changes: 2 additions & 2 deletions nodeup/pkg/distros/identify.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ func FindDistribution(rootfs string) (Distribution, error) {
if line == "DISTRIB_CODENAME=xenial" {
return DistributionXenial, nil
} else if line == "DISTRIB_CODENAME=bionic" {
klog.Warningf("bionic is not fully supported nor tested for Kops and Kubernetes")
klog.Warningf("this should only be used for testing purposes.")
return DistributionBionic, nil
} else if line == "DISTRIB_CODENAME=focal" {
return DistributionFocal, nil
}
}
} else if !os.IsNotExist(err) {
Expand Down
6 changes: 4 additions & 2 deletions nodeup/pkg/model/kubelet.go
Original file line number Diff line number Diff line change
Expand Up @@ -597,8 +597,10 @@ func (b *KubeletBuilder) buildKubeletConfigSpec() (*kops.KubeletConfigSpec, erro

// In certain configurations systemd-resolved will put the loopback address 127.0.0.53 as a nameserver into /etc/resolv.conf
// https://github.com/coredns/coredns/blob/master/plugin/loop/README.md#troubleshooting-loops-in-kubernetes-clusters
if b.Distribution == distros.DistributionBionic && c.ResolverConfig == nil {
c.ResolverConfig = s("/run/systemd/resolve/resolv.conf")
if c.ResolverConfig == nil {
if b.Distribution == distros.DistributionBionic || b.Distribution == distros.DistributionFocal {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of interest, do you know that this was needed? I was hoping they might have fixed it!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a more general issue for distros that enable DNS cache via systemd-resolved, so not sure it can be fixed. Without this CoreDNS keeps complaining about a DNS loop:
https://github.com/coredns/coredns/blob/master/plugin/loop/README.md#troubleshooting-loops-in-kubernetes-clusters

c.ResolverConfig = s("/run/systemd/resolve/resolv.conf")
}
}

// As of 1.16 we can no longer set critical labels.
Expand Down