-
Notifications
You must be signed in to change notification settings - Fork 716
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 multi namespaces #39
Conversation
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.
This looks great thanks for contributing.
Sorry for the slow reply. One simple question please see comment.
@@ -75,8 +75,8 @@ func (c *TfJobRestClient) Client() *http.Client { | |||
} | |||
|
|||
func (c *TfJobRestClient) Watch(host, ns string, httpClient *http.Client, resourceVersion string) (*http.Response, error) { | |||
return c.restcli.Client.Get(fmt.Sprintf("%s/apis/%s/%s/namespaces/%s/%s?watch=true&resourceVersion=%s", | |||
host, spec.CRDGroup, spec.CRDVersion, ns, spec.CRDKindPlural, resourceVersion)) | |||
return c.restcli.Client.Get(fmt.Sprintf("%s/apis/%s/%s/%s?watch=true&resourceVersion=%s", |
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.
Why don't we need namespace anymore?
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.
In k8s read api(such as watch,list), http request URL with no namespace implies that the request will look up the target object in all namespaces.
See kubernetes/client-go#159.
You can also try a test using commander below:
kubectl --alsologtostderr -v=8 get job -w --all-namespace
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.
Thanks for the explanation.
LGTM. |
@loadwiki Thanks again for the fix. |
You are welcome. |
@loadwiki Thank you that's greatly appreciated. When you have a chance please create an issue for this problem. |
…vate Update renovate.json for 2.16
If tfjob controller runs as a deployment in k8s default namespace, we can't not create tfjob crd in another namespace.This PR fix the issue.There are three major modification:
1)tf job controller should watch crd event in all namespaces.
2)tfjob controller creates/deletes training job/tensorboard in specific namespace instead of its own ns.
3)tfjob controller maintain a map from crd name to crd object.The map key should add crd namespace as prefix.