Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable ECS EC2 task networking for Windows tasks #2915

Merged
merged 33 commits into from
Jun 29, 2021

Conversation

rawahars
Copy link
Contributor

Summary

These changes are for enabling ECS EC2 task networking for Windows tasks.

Implementation details

These changes are part of feature/awsvpc-windows branch
The same were implemented and reviewed in their respective CRs

Testing

A custom binary was tested with the changes.

Description for the changelog

Enabling ECS EC2 task networking for Windows tasks

Licensing

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

angelcar
angelcar previously approved these changes Jun 23, 2021
fenxiong
fenxiong previously approved these changes Jun 23, 2021
@rawahars rawahars dismissed stale reviews from fenxiong and angelcar via 4c22a2b June 24, 2021 00:07
@rawahars rawahars force-pushed the feature/awsvpc-windows branch 2 times, most recently from 4c22a2b to d8c4d3f Compare June 24, 2021 00:13
rawahars and others added 19 commits June 29, 2021 10:08
…instance (aws#2498)

* Changes to check if the pause image has been loaded on agent startup. We will cache pause image on ECS-Optimized Windows AMI. On agent startup, we check if the pause image is already loaded.  The following changes are made as part of this commit:

1. Moved common functions from pause_linux.go to load.go
2. Moved the common code from IsLoaded function to a function in load.go
3. Unit tests for the same were moved from Linux specific files to common files
…ring. Changes include -

1. A wrapper for Golang net package
2. A wrapper over Windows API for interface monitoring
3. Network Utils added to retrieve interface information
4. A watcher for Windows which can handle newly added interfaces as well as periodic reconciliation of ENI states.
Note : Few Windows and Linux common functions have been moved from Linux specific files to common files.
The changes made are targeted for Windows platform only and do not impact the existing Linux functionality.
1. Build file changes to fix cross-platform travis builds and removing CGO import
2. Error handling for cases when Windows API calls fail explicitly
3. Changed UdevWatcher struct to ENIWatcher which is more generic
4. Changes to package names
5. Formatting changes
1. Refactored code to include aws#2527 in the new design

2. Addition of fields in ENIWatcher to ensure successful cross-pltform builds (darwin)

3. Removed the CGO import from iphelper_windows.go which was missed in the conflict resolution
Major changes made as part of this commit -
1. Integrated various individual components such as ENI Watcher and CNI
plugins
2. Moved common code from platform specific file and vice versa
3. Created new plugin configuration and invokation logic for Windows
4. Integrated additional flows required for awsvpc mode
…ting DNS server address in Windows CNI plugin config
The link name is a required parameter for the CNI plugin.
Earlier, we had planned on using vpc-shared-eni CNI plugin for task networking setup. However, based on the recent discussions, vpc-eni plugin would be used for the same.
Also, moved Linux specific constants out from common files.
On Windows, task ENI's link name is required for launching the tasks in awsvpc network mode. We update this dependency before the task is launched.
On Windows, if the CNI plugin is invoked too soon then HNS might not be able to find the network interface to bind with the vSwitch. In such a case, the plugin invocation might fail. Therefore, we will retry the namespace setup with a backoff.
Harsh Rawat and others added 14 commits June 29, 2021 10:09
We need to perform some additional tasks to ensure that the task can access credentials endpoint. Additionally, if the IMDS has to be blocked for the task, then we create the appropriate Windows firewall rules.
… routes and IMDS route in the task namespace. (aws#2876)

* Add IMDS route to the task namespace if task is allowed to have IMDS access.c

* Add support for adding additional local routes in awsvpc network mode on Windows.

* Removed the workflow for getting Primary ipv4 address of the vpc.

This is not required as we can use the dns settings of the primary instance ENI.

* Added gSMA support while using awsvpc network mode.

We use the instance ENIs DNS settings since both the ENIs would be in the same VPC and would be additionally beneficial during domain join.

* PR review changes: Reverted netwrapper to platform agnostic package

* Changes to json format for vpc-eni plugin

* Bug fix to rectify the scenario when pause container sends nil network stats.

Initially, without any network, pause container returns nil network stats. When container stats are collected with pause namespace in place, lastStats.NetworkStats is nil which causes agent to crash and restart.

* Minor changes: Comment changes, logfile path consolidation and variable name change
…aws#2893)

* Added CNI plugin version upgrade code to common file

* Build vpc-eni cni plugin for Windows

* Updated the git submodule for vpc-cni plugins

* Disabled verbose option for Windows unit tests

* Updated git submodule vpc-cni-plugins to latest release

* Updated values for max retry during network setup
Instead of creating Windows Firewall rules, create a loopback route for IMDS inside the task namespace.
@angelcar angelcar merged commit d952d4c into aws:dev Jun 29, 2021
@rawahars rawahars deleted the feature/awsvpc-windows branch September 3, 2021 01:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants