[
https://issues.apache.org/jira/browse/KAFKA-7392?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16608437#comment-16608437
]
ASF GitHub Bot commented on KAFKA-7392:
---------------------------------------
asasvari opened a new pull request #5628: KAFKA-7392: Allow to specify subnet
for Docker containers using stand…
URL: https://github.com/apache/kafka/pull/5628
…ard CIDR notation
*More detailed description of your change,
if necessary. The PR title and PR message become
the squashed commit message, so use a separate
comment to ping reviewers.*
*Summary of testing strategy (including rationale)
for the feature or bug fix. Unit and/or integration
tests are expected for any behaviour change and
system tests should be considered for larger changes.*
I have manually verified the changes:
- I tested new help message is displayed
```
/ducker-ak up --help
ducker-ak: a tool for running Apache Kafka tests inside Docker images.
Usage: ./ducker-ak [command] [options]
help|-h|--help
Display this help message
up [-n|--num-nodes NUM_NODES] [-f|--force] [docker-image]
[-C|--custom-ducktape DIR] [-s|--subnet CIDR]
Bring up a cluster with the specified amount of nodes (defaults to 14).
The docker image name defaults to ducker-ak. If --force is specified,
we will
attempt to bring up an image even some parameters are not valid.
If --custom-ducktape is specified, we will install the provided custom
ducktape source code directory before bringing up the nodes. The
provided
directory should be the ducktape git repo, not the ducktape installed
module directory.
If --subnet is specified, default Docker subnet is overriden by given IP
address and netmask,
using standard CIDR notation. For example: 192.168.1.5/24.
```
- Spinned up Docker containers with the new subnet argument and verified it
is used by ducknet:
```
$ ./ducker-ak up -n 5 --subnet 192.168.1.5/24
...
$ docker network inspect ducknet
[
{
"Name": "ducknet",
"Id":
"f4325c524feee777817b9cc57b91634e20de96127409c1906c2c156bfeb4beeb",
"Created": "2018-09-09T11:53:40.4332613Z",
"Scope": "local",
"Driver": "bridge",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": {},
"Config": [
{
"Subnet": "172.23.0.0/16",
"Gateway": "172.23.0.1"
}
]
},
...
```
- Spinned up Docker containers without the new subnet argument and verified
it is used default IP range allocated by docker is used:
```
$ ./ducker-ak up -n 2
...
$ docker network inspect ducknet
[
{
"Name": "ducknet",
"Id":
"7ebb38cd99e8a3fb84a65fd4eaad52dbe37e28dd83b6f0b57d512f66222397bd",
"Created": "2018-09-09T12:22:25.6561649Z",
"Scope": "local",
"Driver": "bridge",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": {},
"Config": [
{
"Subnet": "172.24.0.0/16",
"Gateway": "172.24.0.1"
}
]
},
...
```
### Committer Checklist (excluded from commit message)
- [ ] Verify design and implementation
- [ ] Verify test coverage and CI build status
- [ ] Verify documentation (including upgrade notes)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Allow to specify subnet for Docker containers using standard CIDR notation
> --------------------------------------------------------------------------
>
> Key: KAFKA-7392
> URL: https://issues.apache.org/jira/browse/KAFKA-7392
> Project: Kafka
> Issue Type: Improvement
> Components: system tests
> Reporter: Attila Sasvari
> Assignee: Attila Sasvari
> Priority: Major
>
> During Kafka system test execution, the IP range of the Docker subnet,
> 'ducknet' is allocated by Docker.
> {code}
> docker network inspect ducknet
> [
> {
> "Name": "ducknet",
> "Id":
> "f4325c524feee777817b9cc57b91634e20de96127409c1906c2c156bfeb4beeb",
> "Created": "2018-09-09T11:53:40.4332613Z",
> "Scope": "local",
> "Driver": "bridge",
> "EnableIPv6": false,
> "IPAM": {
> "Driver": "default",
> "Options": {},
> "Config": [
> {
> "Subnet": "172.23.0.0/16",
> "Gateway": "172.23.0.1"
> }
> ]
> },
> {code}
> The default bridge (docker0) can be controlled
> [externally|https://success.docker.com/article/how-do-i-configure-the-default-bridge-docker0-network-for-docker-engine-to-a-different-subnet]
> through etc/docker/daemon.json, however, subnet created by ducknet is not.
> It might be a problem as many businesses make extensive use of the
> [RFC1918|https://tools.ietf.org/html/rfc1918] private address space (such as
> 172.16.0.0/12 : 172.16.0.0 - 172.31.255.255) for internal networks (e.g. VPN).
> h4. Proposed changes:
> - Introduce a new subnet argument that can be used by {{ducker-ak up}} to
> specify IP range using standard CIDR, extend help message with the following:
> {code}
> If --subnet is specified, default Docker subnet is overriden by given IP
> address and netmask,
> using standard CIDR notation. For example: 192.168.1.5/24.
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)