Skip to content
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
3 changes: 3 additions & 0 deletions data/data/bootstrap/systemd/units/kubelet.service.template
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ ExecStart=/usr/bin/hyperkube \
--container-runtime=remote \
--container-runtime-endpoint=/var/run/crio/crio.sock \
--runtime-request-timeout=${KUBELET_RUNTIME_REQUEST_TIMEOUT} \
{{- if .UseIPv6ForNodeIP }}
--node-ip=:: \
{{- end}}
--pod-manifest-path=/etc/kubernetes/manifests \
--minimum-container-ttl-duration=6m0s \
--cluster-domain=cluster.local \
Expand Down
32 changes: 32 additions & 0 deletions pkg/asset/ignition/bootstrap/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"fmt"
"io"
"io/ioutil"
"net"
"os"
"path"
"path/filepath"
Expand Down Expand Up @@ -59,6 +60,7 @@ type bootstrapTemplateData struct {
Registries []sysregistriesv2.Registry
BootImage string
PlatformData platformTemplateData
UseIPv6ForNodeIP bool
}

// platformTemplateData is the data to use to replace values in bootstrap
Expand Down Expand Up @@ -260,6 +262,14 @@ func (a *Bootstrap) getTemplateData(installConfig *types.InstallConfig, releaseI
platformData.VSphere = vsphere.GetTemplateData(installConfig.Platform.VSphere)
}

var APIIntVIPonIPv6 bool
platformAPIVIP := apiVIP(&installConfig.Platform)
if platformAPIVIP == "" {
APIIntVIPonIPv6 = false
} else {
APIIntVIPonIPv6 = net.ParseIP(platformAPIVIP).To4() == nil
}

// Set cluster profile
clusterProfile := ""
if cp := os.Getenv("OPENSHIFT_INSTALL_EXPERIMENTAL_CLUSTER_PROFILE"); cp != "" {
Expand All @@ -278,6 +288,7 @@ func (a *Bootstrap) getTemplateData(installConfig *types.InstallConfig, releaseI
BootImage: string(*rhcosImage),
PlatformData: platformData,
ClusterProfile: clusterProfile,
UseIPv6ForNodeIP: APIIntVIPonIPv6,
}, nil
}

Expand Down Expand Up @@ -621,3 +632,24 @@ func warnIfCertificatesExpired(config *igntypes.Config) {
logrus.Warnf("Bootstrap Ignition-Config: %d certificates expired. Installation attempts with the created Ignition-Configs will possibly fail.", expiredCerts)
}
}

// APIVIP returns a string representation of the platform's API VIP
// It returns an empty string if the platform does not configure a VIP
func apiVIP(p *types.Platform) string {
switch {
case p == nil:
return ""
case p.BareMetal != nil:
return p.BareMetal.APIVIP
case p.OpenStack != nil:
return p.OpenStack.APIVIP
case p.VSphere != nil:
return p.VSphere.APIVIP
case p.Ovirt != nil:
return p.Ovirt.APIVIP
case p.Kubevirt != nil:
return p.Kubevirt.APIVIP
default:
return ""
}
}