15 Commits

Author SHA1 Message Date
4f4a78abb4 networking.go tweak iptables functions
Took duplicated code and merged it into the helper function so only a single
exec was executed.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #446
Approved by: mheon
2018-03-03 19:45:24 +00:00
e4dca05a31 allow DNS resolution in containers
Until https://github.com/containernetworking/plugins/pull/75 is merged
upstream, we are using iptables to manually allow DNS resolution in
containers that run bridged mode networking.  We also remove the rule
in the networkwork tear down.

Resolves issue: #390

Signed-off-by: baude <bbaude@redhat.com>
2018-03-02 14:24:54 -06:00
02c6ba9949 Use more reliable function for parsing CNI result
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #440
Approved by: baude
2018-03-02 19:20:26 +00:00
edb1609c61 Update DB to hold CNI network information
Replace our old IP and Subnet fields in state with CNI types that
contain a lot more information. Retrieve these structs from the
CNI plugins themselves.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #440
Approved by: baude
2018-03-02 19:20:26 +00:00
946b4ced54 Enable port bindings
Set up nbetworking ports for the following use cases:

* bind the same port between host and container
* bind a specific host port to a different container port
* bind a random host port to a specific container port

Signed-off-by: baude <bbaude@redhat.com>

Closes: #214
Approved by: baude
2018-01-20 18:51:21 +00:00
240e5789d4 Update CNI plugin directories to search default location as well
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-01-11 10:10:46 -05:00
5bc4d1d315 Fix build error after updating CNI vendor
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-01-11 10:03:16 -05:00
da7556de4a Fix merge issues
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #189
Approved by: mheon
2018-01-08 20:48:31 +00:00
5c5c024e80 Remove Kubernetes hostport support
This can now be handled by CNI plugins, so let them manage ports
instead.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #189
Approved by: mheon
2018-01-08 20:48:31 +00:00
e2675ef921 Add function to get IP address of a running container
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #192
Approved by: rhatdan
2018-01-08 13:54:32 +00:00
08762dcd61 Add debugging statements
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #109
Approved by: mheon
2017-12-14 23:59:21 +00:00
840eb04e03 Add iptables integration to network code
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #109
Approved by: mheon
2017-12-14 23:59:21 +00:00
ff9c965335 Create new network namespaces when initializing containers
Also fix a few lingering lint issues

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #109
Approved by: mheon
2017-12-14 23:59:21 +00:00
0ff92f8e20 Add network namespaces to SQL state
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #109
Approved by: mheon
2017-12-14 23:59:21 +00:00
824a648fcb Add basic functions for dealing with network namespaces
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #109
Approved by: mheon
2017-12-14 23:59:21 +00:00