Skip to content

Commit

Permalink
Merge pull request opencontainers#801 from darrenstahlmsft/WindowsNet…
Browse files Browse the repository at this point in the history
…work

Update to Windows network options
  • Loading branch information
tianon authored May 23, 2017
2 parents 2e588b3 + 6b2fcaf commit 49b0a1f
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 23 deletions.
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

0 comments on commit 49b0a1f

Please sign in to comment.