Submit Kubernetes Resources

Submitting Kubernetes resources from a Jupyter notebook

Kubeflow assigns the default-editor service account to the Jupyter notebookPods. This service account is bound to the kubeflow-edit ClusterRole, which has namespace-scoped permissions to the many Kubernetes resources including:

  • Pods
  • Deployments
  • Services
  • Jobs
  • TFJobs
  • PyTorchJobs

You can get a full list of these permissions using:

  1. kubectl describe clusterrole kubeflow-edit

You can therefore create the above Kubernetes resources directly from yourJupyter notebook in Kubeflow. The Kuberneteskubectlcommand-line tool is pre-installed in the notebook.

Run the following command in a Jupyter notebook cell to create Kubernetesresources:

  1. !kubectl create -f myspec.yaml

The myspec.yaml file should describe one of the above Kubernetes resources.For information about the format of the YAML file, see theKubernetes object guide.

Next steps

Feedback

Was this page helpful?

Glad to hear it! Please tell us how we can improve.

Sorry to hear that. Please tell us how we can improve.

Last modified 12.02.2020: update description of notebooks permissions (#1680) (587bb586)