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

Update to Windows network options #801

Merged
merged 1 commit into from
May 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions config-windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,22 +75,31 @@ The following parameters can be specified:
}
```

### <a name="configWindowsNetwork" />Network
## <a name="configWindowsNetwork" />Network

`network` is an OPTIONAL configuration for the container's network usage.
You can configure a container's networking options via the OPTIONAL `network` field of the Windows configuration.

The following parameters can be specified:

* **`egressBandwidth`** *(uint64, OPTIONAL)* - specified the maximum egress bandwidth in bytes per second for the container.
* **`endpointList`** *(array of strings, OPTIONAL)* - list of HNS (Host Network Service) endpoints that the container should connect to.
* **`allowUnqualifiedDNSQuery`** *(bool, OPTIONAL)* - specifies if unqualified DNS name resolution is allowed.
* **`DNSSearchList`** *(array of strings, OPTIONAL)* - comma seperated list of DNS suffixes to use for name resolution.
* **`networkSharedContainerName`** *(string, OPTIONAL)* - name (ID) of the container that we will share with the network stack.

#### Example

```json
"windows": {
"resources": {
"network": {
"egressBandwidth": 1048577
}
"network": {
"endpointList": [
"7a010682-17e0-4455-a838-02e5d9655fe6"
],
"allowUnqualifiedDNSQuery": true,
"DNSSearchList": [
"a.com",
"b.com"
],
"networkSharedContainerName": "containerName"
}
}
```
Expand Down
32 changes: 22 additions & 10 deletions schema/config-windows.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,28 @@
"$ref": "defs.json#/definitions/uint64"
}
}
}
}
},
"network": {
"id": "https://opencontainers.org/schema/bundle/windows/network",
"type": "object",
"properties": {
"endpointList": {
"id": "https://opencontainers.org/schema/bundle/windows/network/endpointList",
"$ref": "defs.json#/definitions/ArrayOfStrings"
},
"network": {
"id": "https://opencontainers.org/schema/bundle/windows/resources/network",
"type": "object",
"properties": {
"egressBandwidth": {
"id": "https://opencontainers.org/schema/bundle/windows/resources/network/egressBandwidth",
"$ref": "defs.json#/definitions/uint64"
}
}
"allowUnqualifiedDNSQuery": {
"id": "https://opencontainers.org/schema/bundle/windows/network/allowUnqualifiedDNSQuery",
"type": "boolean"
},
"DNSSearchList": {
"id": "https://opencontainers.org/schema/bundle/windows/network/DNSSearchList",
"$ref": "defs.json#/definitions/ArrayOfStrings"
},
"networkSharedContainerName": {
"id": "https://opencontainers.org/schema/bundle/windows/network/networkSharedContainerName",
"type": "string"
}
}
},
Expand Down Expand Up @@ -94,4 +106,4 @@
}
}
}
}
}
18 changes: 12 additions & 6 deletions specs-go/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,8 @@ type Windows struct {
IgnoreFlushesDuringBoot bool `json:"ignoreflushesduringboot,omitempty"`
// HyperV contains information for running a container with Hyper-V isolation.
HyperV *WindowsHyperV `json:"hyperv,omitempty"`
// Network restriction configuration.
Network *WindowsNetwork `json:"network,omitempty"`
}

// WindowsResources has container runtime resource constraints for containers running on Windows.
Expand All @@ -450,8 +452,6 @@ type WindowsResources struct {
CPU *WindowsCPUResources `json:"cpu,omitempty"`
// Storage restriction configuration.
Storage *WindowsStorageResources `json:"storage,omitempty"`
// Network restriction configuration.
Network *WindowsNetworkResources `json:"network,omitempty"`
}

// WindowsMemoryResources contains memory resource management settings.
Expand Down Expand Up @@ -480,10 +480,16 @@ type WindowsStorageResources struct {
SandboxSize *uint64 `json:"sandboxSize,omitempty"`
}

// WindowsNetworkResources contains network resource management settings.
type WindowsNetworkResources struct {
// EgressBandwidth is the maximum egress bandwidth in bytes per second.
EgressBandwidth *uint64 `json:"egressBandwidth,omitempty"`
// WindowsNetwork contains network settings for Windows containers.
type WindowsNetwork struct {
// List of HNS endpoints that the container should connect to.
EndpointList []string `json:"endpointList,omitempty"`
// Specifies if unqualified DNS name resolution is allowed.
AllowUnqualifiedDNSQuery bool `json:"allowUnqualifiedDNSQuery,omitempty"`
// Comma seperated list of DNS suffixes to use for name resolution.
DNSSearchList []string `json:"DNSSearchList,omitempty"`
// Name (ID) of the container that we will share with the network stack.
NetworkSharedContainerName string `json:"networkSharedContainerName,omitempty"`
}

// WindowsHyperV contains information for configuring a container to run with Hyper-V isolation.
Expand Down