Skip to content
Permalink
Browse files

Update host machine ip (#300)

* Limiting the size of our buffered payload to ~2MB

* Changing IPs for calls to host machines from 169.254.169.254 to 168.63.129.16.
  • Loading branch information...
jaer-tsun committed Feb 27, 2019
1 parent a0d2e2d commit e5f6b0d03c96b3eab4ce76178ddb6d3d57fb92c9
Showing with 28 additions and 28 deletions.
  1. +2 −2 cni/network/plugin/main.go
  2. +2 −2 cns/imdsclient/api.go
  3. +1 −1 ipam/azure.go
  4. +1 −1 npm/npm.go
  5. +22 −22 telemetry/telemetrybuffer.go
@@ -22,8 +22,8 @@ import (
)

const (
hostNetAgentURL = "http://169.254.169.254/machine/plugins?comp=netagent&type=cnireport"
ipamQueryURL = "http://169.254.169.254/machine/plugins?comp=nmagent&type=getinterfaceinfov1"
hostNetAgentURL = "http://168.63.129.16/machine/plugins?comp=netagent&type=cnireport"
ipamQueryURL = "http://168.63.129.16/machine/plugins?comp=nmagent&type=getinterfaceinfov1"
pluginName = "CNI"
)

@@ -8,8 +8,8 @@ import (
)

const (
hostQueryURL = "http://169.254.169.254/machine/plugins?comp=nmagent&type=getinterfaceinfov1"
hostQueryURLForProgrammedVersion = "http://169.254.169.254/machine/plugins/?comp=nmagent&type=NetworkManagement/interfaces/%s/networkContainers/%s/authenticationToken/%s/api-version/%s"
hostQueryURL = "http://168.63.129.16/machine/plugins?comp=nmagent&type=getinterfaceinfov1"
hostQueryURLForProgrammedVersion = "http://168.63.129.16/machine/plugins/?comp=nmagent&type=NetworkManagement/interfaces/%s/networkContainers/%s/authenticationToken/%s/api-version/%s"
)

// ImdsClient can be used to connect to VM Host agent in Azure.
@@ -16,7 +16,7 @@ import (

const (
// Host URL to query.
azureQueryUrl = "http://169.254.169.254/machine/plugins?comp=nmagent&type=getinterfaceinfov1"
azureQueryUrl = "http://168.63.129.16/machine/plugins?comp=nmagent&type=getinterfaceinfov1"

// Minimum time interval between consecutive queries.
azureQueryInterval = 10 * time.Second
@@ -22,7 +22,7 @@ import (
)

var (
hostNetAgentURLForNpm = "http://169.254.169.254/machine/plugins?comp=netagent&type=npmreport"
hostNetAgentURLForNpm = "http://168.63.129.16/machine/plugins?comp=netagent&type=npmreport"
contentType = "application/json"
)

@@ -30,10 +30,10 @@ import (
const (
FdName = "azure-vnet-telemetry"
Delimiter = '\n'
azureHostReportURL = "http://169.254.169.254/machine/plugins?comp=netagent&type=payload"
azureHostReportURL = "http://168.63.129.16/machine/plugins?comp=netagent&type=payload"
DefaultInterval = 60 * time.Second
logName = "azure-vnet-telemetry"
MaxPayloadSize = 2097
MaxPayloadSize = 2097
)

var telemetryLogger = log.NewLogger(logName, log.LevelInfo, log.TargetStderr)
@@ -254,26 +254,26 @@ func (pl *Payload) push(x interface{}) {
}
}

if pl.len() < MaxPayloadSize {
switch x.(type) {
case DNCReport:
dncReport := x.(DNCReport)
dncReport.Metadata = metadata
pl.DNCReports = append(pl.DNCReports, dncReport)
case CNIReport:
cniReport := x.(CNIReport)
cniReport.Metadata = metadata
pl.CNIReports = append(pl.CNIReports, cniReport)
case NPMReport:
npmReport := x.(NPMReport)
npmReport.Metadata = metadata
pl.NPMReports = append(pl.NPMReports, npmReport)
case CNSReport:
cnsReport := x.(CNSReport)
cnsReport.Metadata = metadata
pl.CNSReports = append(pl.CNSReports, cnsReport)
}
}
if pl.len() < MaxPayloadSize {
switch x.(type) {
case DNCReport:
dncReport := x.(DNCReport)
dncReport.Metadata = metadata
pl.DNCReports = append(pl.DNCReports, dncReport)
case CNIReport:
cniReport := x.(CNIReport)
cniReport.Metadata = metadata
pl.CNIReports = append(pl.CNIReports, cniReport)
case NPMReport:
npmReport := x.(NPMReport)
npmReport.Metadata = metadata
pl.NPMReports = append(pl.NPMReports, npmReport)
case CNSReport:
cnsReport := x.(CNSReport)
cnsReport.Metadata = metadata
pl.CNSReports = append(pl.CNSReports, cnsReport)
}
}
}

// reset - reset payload slices

0 comments on commit e5f6b0d

Please sign in to comment.
You can’t perform that action at this time.