Skip to content

Commit

Permalink
chore(docs): clean up kfp-kubernetes documentation index page
Browse files Browse the repository at this point in the history
The entry page for kfp-kubernetes was a little lacking. Clean it up
a bit.

Signed-off-by: Greg Sheremeta <[email protected]>
  • Loading branch information
gregsheremeta committed Sep 13, 2024
1 parent 123ed1e commit c343865
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 27 deletions.
43 changes: 17 additions & 26 deletions kubernetes_platform/python/README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,33 @@
# Kubernetes Platform-specific Features
# Kubeflow Pipelines SDK kfp-kubernetes API Reference

The `kfp-kubernetes` Python library enables authoring [Kubeflow pipelines](https://www.kubeflow.org/docs/components/pipelines/v2/) with Kubernetes-specific features. These features are supported by the [default KFP open source BE](https://github.com/kubeflow/pipelines/tree/master/backend). Specifically, the `kfp-kubernetes` library supports authoring pipelines that use:
The Kubeflow Pipelines SDK kfp-kubernetes python library (part of the [Kubeflow Pipelines](https://www.kubeflow.org/docs/components/pipelines/) project) is an addon to the [Kubeflow Pipelines SDK](https://kubeflow-pipelines.readthedocs.io/) that enables authoring Kubeflow pipelines with Kubernetes-specific features and concepts, such as:

* [Secrets](https://kubernetes.io/docs/concepts/configuration/secret/)
* [PersistentVolumeClaims](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#persistentvolumeclaims)
* [ImagePullPolicy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy)
* [ImagePullPolicies](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy)
* [Ephemeral volumes](https://kubernetes.io/docs/concepts/storage/ephemeral-volumes/)
* [Node selectors](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector)
* [Tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/)
* [Labels and annotations](https://kubernetes.io/docs/reference/kubernetes-api/common-definitions/object-meta/#ObjectMeta)
* and more

See the [`kfp-kubernetes` reference documentation](https://kfp-kubernetes.readthedocs.io/).
Be sure to check out the full [API Reference](https://kfp-kubernetes.readthedocs.io/) for more details.

## Installation
The `kfp-kubernetes` package can be installed as a `kfp` SDK extra dependency with `kfp==2.x.x`:
<!-- TODO: remove --pre when kfp v2 goes to GA -->
The `kfp-kubernetes` package can be installed as a KFP SDK extra dependency.
```sh
pip install kfp[kubernetes] --pre
pip install kfp[kubernetes]
```

Or installed independently:
```sh
pip install kfp-kubernetes
```

## Example usage
<!-- TODO: test these examples once the BE implementation exists -->
### Secret: As environment variable
```python
from kfp import dsl
from kfp import kubernetes
## Getting started

@dsl.component
def print_secret():
import os
print(os.environ['SECRET_VAR'])
The following is an example of a simple pipeline that uses the kfp-kubernetes library to mount a pre-existing secret as a volume to a task's container.

@dsl.pipeline
def pipeline():
task = print_secret()
kubernetes.use_secret_as_env(task,
secret_name='my-secret',
secret_key_to_env={'password': 'SECRET_VAR'})
```

### Secret: As mounted volume
```python
from kfp import dsl
from kfp import kubernetes
Expand All @@ -58,6 +45,10 @@ def pipeline():
mount_path='/mnt/my_vol')
```

## Other examples

Here is a non-exhaustive list of some other examples of how to use the kfp-kubernetes library. Be sure to check out the full [API Reference](source/kubernetes.html) for more details.

### Secret: As optional source for a mounted volume
```python
from kfp import dsl
Expand Down
2 changes: 1 addition & 1 deletion kubernetes_platform/python/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def decorator(func):
}

html_theme = 'sphinx_immaterial'
html_title = 'kfp-kubernetes Reference Documentation'
html_title = 'KFP SDK kfp-kubernetes API Reference'
html_static_path = ['_static']
html_css_files = ['custom.css']
html_logo = '_static/kubeflow.png'
Expand Down

0 comments on commit c343865

Please sign in to comment.