mirror of
https://github.com/openshift/installer.git
synced 2026-02-05 15:47:14 +01:00
CORS-4328: configure NodeIPFamilies for dual-stack support
Add NodeIPFamilies configuration to AWS cloud provider config when dual-stack networking is enabled. The cloud provider now sets the appropriate IP family ordering (ipv4/ipv6 or ipv6/ipv4) based on the install config's IPFamily setting. For dual-stack IPv4 primary clusters, NodeIPFamilies is set to: NodeIPFamilies=ipv4 NodeIPFamilies=ipv6 For dual-stack IPv6 primary clusters, NodeIPFamilies is set to: NodeIPFamilies=ipv6 NodeIPFamilies=ipv4 Single-stack IPv4 clusters continue to use the minimal config with an empty Global section.
This commit is contained in:
@@ -33,6 +33,7 @@ import (
|
||||
externaltypes "github.com/openshift/installer/pkg/types/external"
|
||||
gcptypes "github.com/openshift/installer/pkg/types/gcp"
|
||||
ibmcloudtypes "github.com/openshift/installer/pkg/types/ibmcloud"
|
||||
networktypes "github.com/openshift/installer/pkg/types/network"
|
||||
nonetypes "github.com/openshift/installer/pkg/types/none"
|
||||
nutanixtypes "github.com/openshift/installer/pkg/types/nutanix"
|
||||
openstacktypes "github.com/openshift/installer/pkg/types/openstack"
|
||||
@@ -113,12 +114,27 @@ func (cpc *CloudProviderConfig) Generate(ctx context.Context, dependencies asset
|
||||
cm.Data[cloudProviderConfigCABundleDataKey] = trustBundle
|
||||
}
|
||||
|
||||
// Include a non-empty kube config to appease components--such as the kube-apiserver--that
|
||||
// expect there to be a kube config if the cloud-provider-config ConfigMap exists. See
|
||||
// https://bugzilla.redhat.com/show_bug.cgi?id=1926975.
|
||||
// Note that the newline is required in order to be valid yaml.
|
||||
cm.Data[cloudProviderConfigDataKey] = `[Global]
|
||||
var cloudCfg string
|
||||
switch installConfig.Config.AWS.IPFamily {
|
||||
case networktypes.DualStackIPv4Primary:
|
||||
cloudCfg = `[Global]
|
||||
NodeIPFamilies=ipv4
|
||||
NodeIPFamilies=ipv6
|
||||
`
|
||||
case networktypes.DualStackIPv6Primary:
|
||||
cloudCfg = `[Global]
|
||||
NodeIPFamilies=ipv6
|
||||
NodeIPFamilies=ipv4
|
||||
`
|
||||
default:
|
||||
// Include a non-empty kube config to appease components--such as the kube-apiserver--that
|
||||
// expect there to be a kube config if the cloud-provider-config ConfigMap exists. See
|
||||
// https://bugzilla.redhat.com/show_bug.cgi?id=1926975.
|
||||
// Note that the newline is required in order to be valid yaml.
|
||||
cloudCfg = `[Global]
|
||||
`
|
||||
}
|
||||
cm.Data[cloudProviderConfigDataKey] = cloudCfg
|
||||
case openstacktypes.Name, powervctypes.Name:
|
||||
cloudProviderConfigData, cloudProviderConfigCABundleData, err := openstackmanifests.GenerateCloudProviderConfig(ctx, *installConfig.Config)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user