Skip to content

Commit 49b0a1f

Browse files
authored
Merge pull request #801 from darrenstahlmsft/WindowsNetwork
Update to Windows network options
2 parents 2e588b3 + 6b2fcaf commit 49b0a1f

File tree

3 files changed

+50
-23
lines changed

3 files changed

+50
-23
lines changed

config-windows.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,22 +75,31 @@ The following parameters can be specified:
7575
}
7676
```
7777

78-
### <a name="configWindowsNetwork" />Network
78+
## <a name="configWindowsNetwork" />Network
7979

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

8282
The following parameters can be specified:
8383

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

8689
#### Example
8790

8891
```json
8992
"windows": {
90-
"resources": {
91-
"network": {
92-
"egressBandwidth": 1048577
93-
}
93+
"network": {
94+
"endpointList": [
95+
"7a010682-17e0-4455-a838-02e5d9655fe6"
96+
],
97+
"allowUnqualifiedDNSQuery": true,
98+
"DNSSearchList": [
99+
"a.com",
100+
"b.com"
101+
],
102+
"networkSharedContainerName": "containerName"
94103
}
95104
}
96105
```

schema/config-windows.json

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,28 @@
5353
"$ref": "defs.json#/definitions/uint64"
5454
}
5555
}
56+
}
57+
}
58+
},
59+
"network": {
60+
"id": "https://opencontainers.org/schema/bundle/windows/network",
61+
"type": "object",
62+
"properties": {
63+
"endpointList": {
64+
"id": "https://opencontainers.org/schema/bundle/windows/network/endpointList",
65+
"$ref": "defs.json#/definitions/ArrayOfStrings"
5666
},
57-
"network": {
58-
"id": "https://opencontainers.org/schema/bundle/windows/resources/network",
59-
"type": "object",
60-
"properties": {
61-
"egressBandwidth": {
62-
"id": "https://opencontainers.org/schema/bundle/windows/resources/network/egressBandwidth",
63-
"$ref": "defs.json#/definitions/uint64"
64-
}
65-
}
67+
"allowUnqualifiedDNSQuery": {
68+
"id": "https://opencontainers.org/schema/bundle/windows/network/allowUnqualifiedDNSQuery",
69+
"type": "boolean"
70+
},
71+
"DNSSearchList": {
72+
"id": "https://opencontainers.org/schema/bundle/windows/network/DNSSearchList",
73+
"$ref": "defs.json#/definitions/ArrayOfStrings"
74+
},
75+
"networkSharedContainerName": {
76+
"id": "https://opencontainers.org/schema/bundle/windows/network/networkSharedContainerName",
77+
"type": "string"
6678
}
6779
}
6880
},
@@ -94,4 +106,4 @@
94106
}
95107
}
96108
}
97-
}
109+
}

specs-go/config.go

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,8 @@ type Windows struct {
440440
IgnoreFlushesDuringBoot bool `json:"ignoreflushesduringboot,omitempty"`
441441
// HyperV contains information for running a container with Hyper-V isolation.
442442
HyperV *WindowsHyperV `json:"hyperv,omitempty"`
443+
// Network restriction configuration.
444+
Network *WindowsNetwork `json:"network,omitempty"`
443445
}
444446

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

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

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

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

0 commit comments

Comments
 (0)