mirror of https://github.com/kubernetes/kops.git
Merge pull request #8164 from hakman/update-rhel-8
Update support for RHEL 8
This commit is contained in:
commit
ac76e81ecd
|
@ -88,7 +88,7 @@ func (d Distribution) IsDebianFamily() bool {
|
||||||
return true
|
return true
|
||||||
case DistributionXenial, DistributionBionic:
|
case DistributionXenial, DistributionBionic:
|
||||||
return true
|
return true
|
||||||
case DistributionCentos7, DistributionRhel7:
|
case DistributionCentos7, DistributionRhel7, DistributionCentos8, DistributionRhel8:
|
||||||
return false
|
return false
|
||||||
case DistributionCoreOS, DistributionFlatcar, DistributionContainerOS:
|
case DistributionCoreOS, DistributionFlatcar, DistributionContainerOS:
|
||||||
return false
|
return false
|
||||||
|
|
|
@ -46,7 +46,7 @@ func (b *FirewallBuilder) buildSystemdService() *nodetasks.Service {
|
||||||
manifest.Set("Unit", "Before", "network.target")
|
manifest.Set("Unit", "Before", "network.target")
|
||||||
manifest.Set("Service", "Type", "oneshot")
|
manifest.Set("Service", "Type", "oneshot")
|
||||||
manifest.Set("Service", "RemainAfterExit", "yes")
|
manifest.Set("Service", "RemainAfterExit", "yes")
|
||||||
manifest.Set("Service", "ExecStart", "/home/kubernetes/bin/iptables-setup")
|
manifest.Set("Service", "ExecStart", "/opt/kops/helpers/iptables-setup")
|
||||||
manifest.Set("Install", "WantedBy", "basic.target")
|
manifest.Set("Install", "WantedBy", "basic.target")
|
||||||
|
|
||||||
manifestString := manifest.Render()
|
manifestString := manifest.Render()
|
||||||
|
@ -87,7 +87,7 @@ iptables -A FORWARD -w -p ICMP -j ACCEPT
|
||||||
fi
|
fi
|
||||||
`
|
`
|
||||||
return &nodetasks.File{
|
return &nodetasks.File{
|
||||||
Path: "/home/kubernetes/bin/iptables-setup",
|
Path: "/opt/kops/helpers/iptables-setup",
|
||||||
Contents: fi.NewStringResource(script),
|
Contents: fi.NewStringResource(script),
|
||||||
Type: nodetasks.FileType_File,
|
Type: nodetasks.FileType_File,
|
||||||
Mode: s("0755"),
|
Mode: s("0755"),
|
||||||
|
|
|
@ -57,7 +57,7 @@ func (b *MiscUtilsBuilder) Build(c *fi.ModelBuilderContext) error {
|
||||||
packages = append(packages, "apt-transport-https")
|
packages = append(packages, "apt-transport-https")
|
||||||
} else if b.Distribution.IsRHELFamily() {
|
} else if b.Distribution.IsRHELFamily() {
|
||||||
packages = append(packages, "curl")
|
packages = append(packages, "curl")
|
||||||
packages = append(packages, "python")
|
packages = append(packages, "python2")
|
||||||
packages = append(packages, "git")
|
packages = append(packages, "git")
|
||||||
} else {
|
} else {
|
||||||
klog.Warningf("unknown distribution, skipping misc utils install: %v", b.Distribution)
|
klog.Warningf("unknown distribution, skipping misc utils install: %v", b.Distribution)
|
||||||
|
|
|
@ -50,8 +50,14 @@ func (b *NTPBuilder) Build(c *fi.ModelBuilderContext) error {
|
||||||
c.AddTask(&nodetasks.Package{Name: "ntp"})
|
c.AddTask(&nodetasks.Package{Name: "ntp"})
|
||||||
c.AddTask((&nodetasks.Service{Name: "ntp"}).InitDefaults())
|
c.AddTask((&nodetasks.Service{Name: "ntp"}).InitDefaults())
|
||||||
} else if b.Distribution.IsRHELFamily() {
|
} else if b.Distribution.IsRHELFamily() {
|
||||||
c.AddTask(&nodetasks.Package{Name: "ntp"})
|
switch b.Distribution {
|
||||||
c.AddTask((&nodetasks.Service{Name: "ntpd"}).InitDefaults())
|
case distros.DistributionCentos8, distros.DistributionRhel8:
|
||||||
|
c.AddTask(&nodetasks.Package{Name: "chrony"})
|
||||||
|
c.AddTask((&nodetasks.Service{Name: "chronyd"}).InitDefaults())
|
||||||
|
default:
|
||||||
|
c.AddTask(&nodetasks.Package{Name: "ntp"})
|
||||||
|
c.AddTask((&nodetasks.Service{Name: "ntpd"}).InitDefaults())
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
klog.Warningf("unknown distribution, skipping ntp install: %v", b.Distribution)
|
klog.Warningf("unknown distribution, skipping ntp install: %v", b.Distribution)
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in New Issue