-
Notifications
You must be signed in to change notification settings - Fork 8
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
Support the multiple network when creating Pod #111
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #111 +/- ##
===========================================
+ Coverage 72.77% 74.36% +1.59%
===========================================
Files 35 37 +2
Lines 1620 1740 +120
===========================================
+ Hits 1179 1294 +115
- Misses 379 381 +2
- Partials 62 65 +3
Continue to review full report at Codecov.
|
打開Linuc capability. NET ADMIN 可能要考慮進去 |
哦哦 應該是要在create pod那邊,這裡不應該是做Linux capability |
capability 開一個額外task來做,包含 vlan* 這個都額外開 |
src/entity/pod.go
Outdated
@@ -16,6 +16,15 @@ type Container struct { | |||
Command []string `bson:"command" json:"command" validate:"required,dive,required"` | |||
} | |||
|
|||
type PodNetwork struct { | |||
Name string `bson:"name" json:"name"` | |||
IFName string `bson:"ifName" json:"ifName"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IfName
src/entity/pod.go
Outdated
type PodNetwork struct { | ||
Name string `bson:"name" json:"name"` | ||
IFName string `bson:"ifName" json:"ifName"` | ||
VLAN int `bson:"vlan" json:"vlan"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vlanTag int32 `bson:"vlanTag" json:"vlanTag"`
src/pod/pod.go
Outdated
for i, v := range networks { | ||
containers = append(containers, corev1.Container{ | ||
Name: fmt.Sprintf("init-network-client-%d", i), | ||
Image: "sdnvortex/network-controller:latest", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
先固定在 v0.2.1?
src/pod/pod.go
Outdated
return containers, nil | ||
} | ||
|
||
//For the network, we will generate two thins |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
things
src/pod/pod.go
Outdated
//For the network, we will generate two thins | ||
//[]string => a list of nodes and it will apply on nodeaffinity | ||
//[]corev1.Container => a list of init container we will apply on pod | ||
func generateNetwork(pod *entity.Pod, session *mongo.Session) ([]string, []corev1.Container, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
session *mongo.Session 可以放第一個嗎
src/pod/pod.go
Outdated
return []string{ | ||
"-s=unix:///tmp/vortex.sock", | ||
"-b=" + network.BridgeName, | ||
"-n=" + network.IFName, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ifName
@@ -16,6 +16,15 @@ type Container struct { | |||
Command []string `bson:"command" json:"command" validate:"required,dive,required"` | |||
} | |||
|
|||
type PodNetwork struct { | |||
Name string `bson:"name" json:"name"` | |||
IfName string `bson:"ifName" json:"ifName"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
要不要改叫IfaceName?IfName有點看不懂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我覺得 IfName 因為linux有慣例也是取名IfName
src/pod/pod.go
Outdated
if err != nil { | ||
return fmt.Errorf("check the network name error:%v", err) | ||
} else if count == 0 { | ||
return fmt.Errorf("the network name %s doesn't exist", v.Name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the network named %s doesn't exist
src/pod/pod.go
Outdated
@@ -79,6 +91,123 @@ func generateVolume(pod *entity.Pod, session *mongo.Session) ([]corev1.Volume, [ | |||
return volumes, volumeMounts, nil | |||
} | |||
|
|||
//Get the intersecion of nodes' name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Intersection
Support the multiple network when creating Pod Former-commit-id: d53e9023c5cabd4d27185cf9b2533826955ba221 [formerly aa080c1] Former-commit-id: 52cfd8f83d35e0521715b4fc534a8e0d866e51f7
Support the multiple network when creating Pod
https://github.com/linkernetworks/network-controller/blob/master/deploy/client/clientpodtest.yaml