Moving v4overlay and dualstackoverlay to just 'overlay' in CNI (#2008)
This commit is contained in:
Родитель
1514d95cce
Коммит
0bc72e46c1
|
@ -8,7 +8,7 @@
|
|||
"ipsToRouteViaHost":["169.254.20.10"],
|
||||
"ipam":{
|
||||
"type":"azure-cns",
|
||||
"mode":"dualStackOverlay"
|
||||
"mode":"overlay"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
|
@ -5,11 +5,10 @@
|
|||
{
|
||||
"type":"azure-vnet",
|
||||
"mode":"transparent",
|
||||
"executionMode":"v4swift",
|
||||
"ipsToRouteViaHost":["169.254.20.10"],
|
||||
"ipam":{
|
||||
"type":"azure-cns",
|
||||
"mode":"v4overlay"
|
||||
"mode":"overlay"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
},
|
||||
"ipam": {
|
||||
"type": "azure-cns",
|
||||
"mode": "dualStackOverlay"
|
||||
"mode": "overlay"
|
||||
},
|
||||
"dns": {
|
||||
"Nameservers": [
|
||||
|
|
|
@ -7,14 +7,13 @@
|
|||
"type": "azure-vnet",
|
||||
"mode": "bridge",
|
||||
"bridge": "azure0",
|
||||
"executionMode": "v4swift",
|
||||
"capabilities": {
|
||||
"portMappings": true,
|
||||
"dns": true
|
||||
},
|
||||
"ipam": {
|
||||
"type": "azure-cns",
|
||||
"mode": "v4overlay"
|
||||
"mode": "overlay"
|
||||
},
|
||||
"dns": {
|
||||
"Nameservers": [
|
||||
|
|
|
@ -135,7 +135,8 @@ func (invoker *CNSIPAMInvoker) Add(addConfig IPAMAddConfig) (IPAMAddResult, erro
|
|||
|
||||
ncgw := net.ParseIP(info.ncGatewayIPAddress)
|
||||
if ncgw == nil {
|
||||
if (invoker.ipamMode != util.V4Overlay) && (invoker.ipamMode != util.DualStackOverlay) {
|
||||
// TODO: Remove v4overlay and dualstackoverlay options, after 'overlay' rolls out in AKS-RP
|
||||
if (invoker.ipamMode != util.V4Overlay) && (invoker.ipamMode != util.DualStackOverlay) && (invoker.ipamMode != util.Overlay) {
|
||||
return IPAMAddResult{}, errors.Wrap(errInvalidArgs, "%w: Gateway address "+info.ncGatewayIPAddress+" from response is invalid")
|
||||
}
|
||||
|
||||
|
@ -199,7 +200,8 @@ func (invoker *CNSIPAMInvoker) Add(addConfig IPAMAddConfig) (IPAMAddResult, erro
|
|||
|
||||
// set subnet prefix for host vm
|
||||
// setHostOptions will execute if IPAM mode is not v4 overlay and not dualStackOverlay mode
|
||||
if (invoker.ipamMode != util.V4Overlay) && (invoker.ipamMode != util.DualStackOverlay) {
|
||||
// TODO: Remove v4overlay and dualstackoverlay options, after 'overlay' rolls out in AKS-RP
|
||||
if (invoker.ipamMode != util.V4Overlay) && (invoker.ipamMode != util.DualStackOverlay) && (invoker.ipamMode != util.Overlay) {
|
||||
if err := setHostOptions(ncIPNet, addConfig.options, &info); err != nil {
|
||||
return IPAMAddResult{}, err
|
||||
}
|
||||
|
|
|
@ -77,7 +77,7 @@ func TestCNSIPAMInvoker_Add_Overlay(t *testing.T) {
|
|||
fields: fields{
|
||||
podName: testPodInfo.PodName,
|
||||
podNamespace: testPodInfo.PodNamespace,
|
||||
ipamMode: util.V4Overlay,
|
||||
ipamMode: util.Overlay,
|
||||
cnsClient: &MockCNSClient{
|
||||
unsupportedAPIs: unsupportedAPIs,
|
||||
require: require,
|
||||
|
@ -148,6 +148,7 @@ func TestCNSIPAMInvoker_Add_Overlay(t *testing.T) {
|
|||
fields: fields{
|
||||
podName: testPodInfo.PodName,
|
||||
podNamespace: testPodInfo.PodNamespace,
|
||||
ipamMode: util.Overlay,
|
||||
cnsClient: &MockCNSClient{
|
||||
require: require,
|
||||
requestIPs: requestIPsHandler{
|
||||
|
|
|
@ -409,7 +409,8 @@ func determineWinVer() {
|
|||
}
|
||||
|
||||
func getNATInfo(nwCfg *cni.NetworkConfig, ncPrimaryIPIface interface{}, enableSnatForDNS bool) (natInfo []policy.NATInfo) {
|
||||
if nwCfg.ExecutionMode == string(util.V4Swift) && nwCfg.IPAM.Mode != string(util.V4Overlay) && nwCfg.IPAM.Mode != string(util.DualStackOverlay) {
|
||||
// TODO: Remove v4overlay and dualstackoverlay options, after 'overlay' rolls out in AKS-RP
|
||||
if nwCfg.ExecutionMode == string(util.V4Swift) && nwCfg.IPAM.Mode != string(util.V4Overlay) && nwCfg.IPAM.Mode != string(util.DualStackOverlay) && nwCfg.IPAM.Mode != string(util.Overlay) {
|
||||
ncPrimaryIP := ""
|
||||
if ncPrimaryIPIface != nil {
|
||||
ncPrimaryIP = ncPrimaryIPIface.(string)
|
||||
|
|
|
@ -15,4 +15,13 @@ type IpamMode string
|
|||
const (
|
||||
V4Overlay IpamMode = "v4overlay"
|
||||
DualStackOverlay IpamMode = "dualStackOverlay"
|
||||
Overlay IpamMode = "overlay" // Nothing changes between 'v4overlay' and 'dualStackOverlay' mode, so consolidating to one
|
||||
)
|
||||
|
||||
// Overlay consolidation plan
|
||||
// First, we have v4overlay and dualstackoverlay conflists both have just 'overlay' in them
|
||||
// Next, we release this CNI and conflist in AKS
|
||||
// Next we will add a third 'overlay' conflist generator in CNS
|
||||
// Release this CNS image
|
||||
// Change AKS RP to use 'overlay' option for CNS configmap, for both v4overlay and dualstackoverlay
|
||||
// Remove 'v4overlay' and 'dualstackoverlay' from ACN completely
|
||||
|
|
Загрузка…
Ссылка в новой задаче