-
Notifications
You must be signed in to change notification settings - Fork 18
Conversation
limitations under the License. | ||
*/ | ||
|
||
package wormholegravitationalio |
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.
Is this a common package naming pattern used for Kubernetes 3rd party APIs? Reads weird.
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.
Yes. I believe this is a required format / path structure to match the CRD group name as a path (wormhole.gravitational.io)
return trace.Wrap(c.updateNodeNameFromPod(podName, podNamespace)) | ||
} | ||
|
||
nodeName, err := os.Hostname() |
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.
If it's important for the node name to be an actual Kubernetes node name, I think it'll be more reliable to use Nodes API rather than relying on hostname.
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.
Sorry, I'm not sure I follow.
The normal flow is to read the Pod name/namespace from the environment, find the pod object for the controller, and read the node name from the spec.
when not running in a pod though, using the Nodes API, how do I find the Node object that matches the host the process is running on? I think we still need to come up with a name, which in some cases the os.Hostname() covers, and otherwise it needs to be passed as a flag to the process.
For me none of the build targets work:
is there a specific docker dependency? Also, I cannot comment on multiple issues since they're not part of the commit. |
} | ||
|
||
ctx, cancel := context.WithCancel(context.Background()) | ||
defer cancel() | ||
|
||
err = controller.Run(ctx, kubeletKubeconfig, wormholeKubeconfig) | ||
err = c.Run(ctx) |
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.
As far as I understand, Run is blocking - then watching for signals below is not working as expected - something needs to run in a goroutune.
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.
good catch, it originally worked differently and I missed the change. What i've done is move the signal handling to a separate routine, and cancels the context.
Since I cannot comment on multiple issues which are not part of the commit, I'm going to resort to linking to specific file locations. https://github.com/gravitational/wormhole/blob/kevin/master/productionalize/cmd/wormhole/controller.go#L149 https://github.com/gravitational/wormhole/blob/kevin/master/productionalize/pkg/iptables/iptables.go#L46 https://github.com/gravitational/wormhole/blob/kevin/master/productionalize/pkg/iptables/iptables.go#L173 |
@a-palchikov Re: the unable to build. It looks like the ability to have the dockerfile outside the build context was added in docker 18.03. I did it this way, just for a small optimization of keeping the build context smaller and not having to send built binaries, etc. |
BytesTX int64 | ||
// BytesRX is the number of bytes received from the peer | ||
BytesRX int64 | ||
//Keepalive is the number of second to keep the connection alive |
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.
seconds
I realize you haven't really seen the prototype code, so this PR is really the initial commit to a CNI plugin utilizing wireguard. It's built on the initial design doc I shared and updated. It's also been converted to markdown so it can live inside the repo (docs/rfcs/0001-spec.md).
To try and summarize:
Sorry it's kind of big, but I changed and refactored lots of the internals as I went.