Closed hemantha-kumara closed 4 years ago
Basically, you pipeline is running under the namespace where KFP is deployed.
How to specify the namespace to which KFP is deployed depends on the deployment option you are using. Take standalone deployment as an example, you can refer to the guidelin in https://github.com/kubeflow/pipelines/tree/master/manifests/kustomize#change-deploy-namespace
/assign @numerology
In a multi-user and multi-tenant cluster, for resource isolation, when there are multiple namespaces, can the pipeline be not run in different namespaces similar to what is supported by other kubeflow controllers like notebook, tfjob etc.
In a multi-user and multi-tenant cluster, for resource isolation, when there are multiple namespaces, can the pipeline be not run in different namespaces similar to what is supported by other kubeflow controllers like notebook, tfjob etc.
Just to confirm, does it mean install multiple KFP into the same namespace?
No. Kfp is installed in kubeflow namespace, then the workflow creation shoul happen in other namespaces as requested by users. Notebook controller runs in kubeflow namespace, but the jupyter notebook is spawned in user name spaces.
then the workflow creation shoul happen in other namespaces as requested by users.
I see. The most similar functionality we currently have is the multi-user support, where different users can submit workflows to different namespaces. One nit difference is that, namespaces are protected by authentication, so users cannot submit run to naked namespace without specifying credentials.
@Bobgy @IronPan can better comment on this.
/assign @Bobgy /assign @IronPan
/cc @chensun
https://github.com/kubeflow/pipelines/issues/2397 Does this work for your use case? We are in progress.
Did u try kfp.Client(namespace=xyz)
? This allows u to connect to the specific kfp API server in the namespace u want. And the run will inherit from the API server.
Note that I am running multiple customized kubeflow on diff namespaces on my cluster.
And I am a few version behind. But I was able to run jobs in diff namespaces by pointing to the diff API server in corresponding namespace.
I guess that would work if we have KFP installed in namespaces. As part of Kubeflow installation, KFP is installed in 'kubeflow' namespace. Currently the kubeflow installation is considered an "uber" installation (one kubeflow per one kubernetes cluster). Hence we have not installed multiple KFPs. If we download the generated workflow and include "namespace" in the metadata, the KFP installed in kubeflow namespace is able to launch workflows in user specified namespaces. This workaround is not a good one from User Experience pov.
2397
Does this work for your use case? We are in progress.
Does this provide resource isolation? What I mean is that different teams have been allocated quotas in their namespaces and it should not happen that one valid user exhausts all resources.
That wasn't in the scope of this design. I'm not familiar with this, but I think kubernetes should be the system to handle resource.
That wasn't in the scope of this design. I'm not familiar with this, but I think kubernetes should be the system to handle resource.
Also, as part of Kubeflow installation, only one kfp is installed in kubeflow namespace. User namespaces do not have any kubeflow related controllers deployed.
Did u try
kfp.Client(namespace=xyz)
? This allows u to connect to the specific kfp API server in the namespace u want. And the run will inherit from the API server.
@eterna2 As we are running pipelines on kubeflow cluster where pipeline controller is running only in kubeflow namespace. as no svc & controller running on another namespaces, client is not getting created.
my initial query was, how to specify namespace if only one controller is running in cluster?
@nrchakradhar Sorry, I wanted to paste a different link: https://github.com/kubeflow/pipelines/issues/1223.
This issue's solution is running pipelines in user namespaces using a single controller in cluster.
@Bobgy That issue looks to address multi namespace scenario. The discussion seems to have digressed a little from the original description. If both multi user and multi namespace scenarios are addressed it would definitely be very useful for all enterprise users of kubeflow
Good to know. I will keep updating that issue for latest sharings.
Shall we close this issue then?
@Bobgy Thanks for pointing out issue which addresses multi-user and multi-namespace scenarios. Yes, we can close this issue.
What happened: by default, we use kfp.client or dsl.compile, generated workflow yaml is without metadata.namespace. due to this pipeline always runs in default kubeflow namespace.
What did you expect to happen: generated workflow yaml should contain namespace specified by user. compiler.compile can take new argument if required.
What steps did you take:
with above snippet, generated pipeline.yaml as below
Anything else you would like to add: even if we send namespace info to
kfp.Client().create_run_from_pipeline_func(pipeline_func=calc_pipeline, arguments=arguments, namespace="hkumara")
run is failing with below error