-
Notifications
You must be signed in to change notification settings - Fork 286
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1638 from nwoodmsft/master
Add experimental support for Felix on Windows. This has a number of limitations: - it requires a testing release of Windows Server - it only supports positive match criteria, due to limits in the Windows dataplane - some match criteria are further limited (no port ranges, for example)
- Loading branch information
Showing
45 changed files
with
2,229 additions
and
238 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
// +build !windows | ||
|
||
// Copyright (c) 2017 Tigera, Inc. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package dataplane | ||
|
||
import ( | ||
"net" | ||
"os/exec" | ||
|
||
log "github.com/sirupsen/logrus" | ||
|
||
"github.com/projectcalico/felix/config" | ||
"github.com/projectcalico/felix/dataplane/external" | ||
"github.com/projectcalico/felix/dataplane/linux" | ||
"github.com/projectcalico/felix/ifacemonitor" | ||
"github.com/projectcalico/felix/ipsets" | ||
"github.com/projectcalico/felix/logutils" | ||
"github.com/projectcalico/felix/rules" | ||
"github.com/projectcalico/libcalico-go/lib/health" | ||
) | ||
|
||
func StartDataplaneDriver(configParams *config.Config, healthAggregator *health.HealthAggregator) (DataplaneDriver, *exec.Cmd) { | ||
if configParams.UseInternalDataplaneDriver { | ||
log.Info("Using internal (linux) dataplane driver.") | ||
// Dedicated mark bits for accept and pass actions. These are long lived bits | ||
// that we use for communicating between chains. | ||
markAccept := configParams.NextIptablesMark() | ||
markPass := configParams.NextIptablesMark() | ||
// Short-lived mark bits for local calculations within a chain. | ||
markScratch0 := configParams.NextIptablesMark() | ||
markScratch1 := configParams.NextIptablesMark() | ||
log.WithFields(log.Fields{ | ||
"acceptMark": markAccept, | ||
"passMark": markPass, | ||
"scratch0Mark": markScratch0, | ||
"scratch1Mark": markScratch1, | ||
}).Info("Calculated iptables mark bits") | ||
dpConfig := intdataplane.Config{ | ||
IfaceMonitorConfig: ifacemonitor.Config{ | ||
InterfaceExcludes: configParams.InterfaceExcludes(), | ||
}, | ||
RulesConfig: rules.Config{ | ||
WorkloadIfacePrefixes: configParams.InterfacePrefixes(), | ||
|
||
IPSetConfigV4: ipsets.NewIPVersionConfig( | ||
ipsets.IPFamilyV4, | ||
rules.IPSetNamePrefix, | ||
rules.AllHistoricIPSetNamePrefixes, | ||
rules.LegacyV4IPSetNames, | ||
), | ||
IPSetConfigV6: ipsets.NewIPVersionConfig( | ||
ipsets.IPFamilyV6, | ||
rules.IPSetNamePrefix, | ||
rules.AllHistoricIPSetNamePrefixes, | ||
nil, | ||
), | ||
|
||
OpenStackSpecialCasesEnabled: configParams.OpenstackActive(), | ||
OpenStackMetadataIP: net.ParseIP(configParams.MetadataAddr), | ||
OpenStackMetadataPort: uint16(configParams.MetadataPort), | ||
|
||
IptablesMarkAccept: markAccept, | ||
IptablesMarkPass: markPass, | ||
IptablesMarkScratch0: markScratch0, | ||
IptablesMarkScratch1: markScratch1, | ||
|
||
IPIPEnabled: configParams.IpInIpEnabled, | ||
IPIPTunnelAddress: configParams.IpInIpTunnelAddr, | ||
|
||
IptablesLogPrefix: configParams.LogPrefix, | ||
EndpointToHostAction: configParams.DefaultEndpointToHostAction, | ||
IptablesFilterAllowAction: configParams.IptablesFilterAllowAction, | ||
IptablesMangleAllowAction: configParams.IptablesMangleAllowAction, | ||
|
||
FailsafeInboundHostPorts: configParams.FailsafeInboundHostPorts, | ||
FailsafeOutboundHostPorts: configParams.FailsafeOutboundHostPorts, | ||
|
||
DisableConntrackInvalid: configParams.DisableConntrackInvalidCheck, | ||
}, | ||
IPIPMTU: configParams.IpInIpMtu, | ||
IptablesRefreshInterval: configParams.IptablesRefreshInterval, | ||
RouteRefreshInterval: configParams.RouteRefreshInterval, | ||
IPSetsRefreshInterval: configParams.IpsetsRefreshInterval, | ||
IptablesPostWriteCheckInterval: configParams.IptablesPostWriteCheckIntervalSecs, | ||
IptablesInsertMode: configParams.ChainInsertMode, | ||
IptablesLockFilePath: configParams.IptablesLockFilePath, | ||
IptablesLockTimeout: configParams.IptablesLockTimeoutSecs, | ||
IptablesLockProbeInterval: configParams.IptablesLockProbeIntervalMillis, | ||
MaxIPSetSize: configParams.MaxIpsetSize, | ||
IgnoreLooseRPF: configParams.IgnoreLooseRPF, | ||
IPv6Enabled: configParams.Ipv6Support, | ||
StatusReportingInterval: configParams.ReportingIntervalSecs, | ||
|
||
NetlinkTimeout: configParams.NetlinkTimeoutSecs, | ||
|
||
PostInSyncCallback: func() { logutils.DumpHeapMemoryProfile(configParams) }, | ||
HealthAggregator: healthAggregator, | ||
DebugSimulateDataplaneHangAfter: configParams.DebugSimulateDataplaneHangAfter, | ||
} | ||
intDP := intdataplane.NewIntDataplaneDriver(dpConfig) | ||
intDP.Start() | ||
|
||
return intDP, nil | ||
} else { | ||
log.WithField("driver", configParams.DataplaneDriver).Info( | ||
"Using external dataplane driver.") | ||
|
||
return extdataplane.StartExtDataplaneDriver(configParams.DataplaneDriver) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright (c) 2017 Tigera, Inc. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package dataplane | ||
|
||
type DataplaneDriver interface { | ||
SendMessage(msg interface{}) error | ||
RecvMessage() (msg interface{}, err error) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Copyright (c) 2017 Tigera, Inc. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package dataplane | ||
|
||
import ( | ||
"os/exec" | ||
|
||
log "github.com/sirupsen/logrus" | ||
|
||
"github.com/projectcalico/felix/config" | ||
"github.com/projectcalico/felix/dataplane/windows" | ||
"github.com/projectcalico/libcalico-go/lib/health" | ||
) | ||
|
||
func StartDataplaneDriver(configParams *config.Config, healthAggregator *health.HealthAggregator) (DataplaneDriver, *exec.Cmd) { | ||
log.Info("Using Windows dataplane driver.") | ||
|
||
dpConfig := windataplane.Config{ | ||
IPv6Enabled: configParams.Ipv6Support, | ||
HealthAggregator: healthAggregator, | ||
} | ||
|
||
winDP := windataplane.NewWinDataplaneDriver(dpConfig) | ||
winDP.Start() | ||
|
||
return winDP, nil | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.