Skip to content

Commit 2a5ef22

Browse files
Update user guide for namespace label in Katib Python SDK example (#3976)
* doc(katib): add guidance of namespace label configuration in Getting-Started Signed-off-by: Xinmin Du <[email protected]> * doc(katib): move guidance to Metrics Collector, add note in getting-start Signed-off-by: Xinmin Du <[email protected]> * Update content/en/docs/components/katib/user-guides/metrics-collector.md Co-authored-by: Shao Wang <[email protected]> Signed-off-by: Du Xinmin <[email protected]> --------- Signed-off-by: Xinmin Du <[email protected]> Signed-off-by: Du Xinmin <[email protected]> Co-authored-by: Shao Wang <[email protected]>
1 parent 59c9e6c commit 2a5ef22

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

Diff for: content/en/docs/components/katib/getting-started.md

+5
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ If you install Katib as part of Kubeflow Platform, you can open a new
3939
**Note**. If you use Katib within Kubeflow Platform to run this example, you need to use this
4040
namespace: `KatibClient(namespace="kubeflow-user-example-com")`.
4141

42+
**Note**. The `kubeflow` namespace is pre-configured with the required label
43+
`katib.kubeflow.org/metrics-collector-injection: enabled` for metrics collection. If you want to use pull-based metrics collector
44+
in other namespaces, you can attach this label following the instructions in the
45+
[Metrics Collector](/docs/components/katib/user-guides/metrics-collector/#prerequisites).
46+
4247
```python
4348
# [1] Create an objective function.
4449
def objective(parameters):

Diff for: content/en/docs/components/katib/user-guides/metrics-collector.md

+24
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,30 @@ weight = 40
66

77
This guide describes how Katib metrics collector works.
88

9+
## Prerequisites
10+
11+
Before running your hyperparameter tuning Katib Experiment with Python SDK,
12+
ensure the namespace label `katib.kubeflow.org/metrics-collector-injection: enabled`
13+
is present. This label enables the sidecar container injection for pull-based metrics collectors to collect metrics during the experiment.
14+
15+
You can configure the namespace by adding the following label `katib.kubeflow.org/metrics-collector-injection: enabled`
16+
as is shown in the sample code:
17+
18+
```yaml
19+
apiVersion: v1
20+
kind: Namespace
21+
metadata:
22+
name: <your-namespace>
23+
labels:
24+
katib.kubeflow.org/metrics-collector-injection: enabled
25+
```
26+
27+
Or you can add the label to an existing namespace using the following command:
28+
29+
```bash
30+
kubectl label namespace <your-namespace> katib.kubeflow.org/metrics-collector-injection=enabled
31+
```
32+
933
## Overview
1034

1135
There are two ways to collect metrics:

0 commit comments

Comments
 (0)