Skip to content

Commit b48e957

Browse files
Rajakavitha1Rakavitha Kodhandapani
andauthored
docs(kubernetes examples): updated the curl commands (#6905)
* added the curl commands for seldon-cli * added the curl for artifacts page * check the formatting * added the cli readme * added the correct link to CLI * updated the CLI commands * fixed the formatting * fixed formatting 2 * fixed formatting 3 * fixed formatting 4 * cli changes --------- Co-authored-by: Rakavitha Kodhandapani <[email protected]>
1 parent 930da31 commit b48e957

File tree

12 files changed

+1506
-636
lines changed

12 files changed

+1506
-636
lines changed

docs-gb/cli/README.md

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
# CLI
2+
3+
Seldon provides a CLI to allow easy management and testing of Model, Experiment, and Pipeline resources.
4+
5+
At present this needs to be built by hand from the operator folder.
6+
7+
```
8+
make build-seldon # for linux/macOS amd64
9+
make build-seldon-arm # for macOS ARM
10+
```
11+
12+
Then place the `bin/seldon` executable in your path.
13+
14+
* [cli docs](./docs/seldon.md)
15+
16+
17+
## Environment Variables and Services
18+
19+
The CLI talks to 3 backend services on default endpoints:
20+
21+
1. The Seldon Core 2 Scheduler: default 0.0.0.0:9004
22+
2. The Seldon Core inference endpoint: default 0.0.0.0:9000
23+
3. The Seldon Kafka broker: default: 0.0.0.0:9092
24+
25+
These defaults will be correct when Seldon Core 2 is installed locally as per the docs. For Kubernetes, you will need to change these by defining environment variables.
26+
27+
```{literalinclude} ../../../../operator/cmd/seldon/cli/flags.go
28+
:language: golang
29+
:start-after: // Defaults
30+
:end-before: // Help statements
31+
```
32+
33+
## Kubernetes Usage
34+
35+
### Inference Service
36+
37+
For a default install into the `seldon-mesh` namespace if you have exposed the inference `svc` as a loadbalancer you will find it at:
38+
39+
```
40+
kubectl get svc seldon-mesh -n seldon-mesh -o jsonpath='{.status.loadBalancer.ingress[0].ip}'
41+
```
42+
43+
Use above IP at port 80:
44+
45+
```
46+
export SELDON_INFER_HOST=<ip>:80
47+
```
48+
49+
### Scheduler Service
50+
51+
For a default install into the `seldon-mesh` namespace if you have exposed the scheduler svc as a loadbalancer you will find it at:
52+
53+
```
54+
kubectl get svc seldon-scheduler -n seldon-mesh -o jsonpath='{.status.loadBalancer.ingress[0].ip}'
55+
```
56+
57+
Use above IP at port 9004:
58+
59+
```
60+
export SELDON_SCHEDULE_HOST=<ip>:9004
61+
```
62+
63+
### Kafka Broker
64+
65+
The Kafka broker will depend on how you have installed Kafka into your Kubernetes cluster. Find the broker IP and use:
66+
67+
```
68+
export SELDON_KAFKA_BROKER=<ip>:<port>
69+
```
70+
71+
## Config file
72+
73+
You can create a config file to manage connections to running Seldon Core 2 installs. The settings will override any environment variable settings.
74+
75+
The definition is shown below:
76+
77+
```{literalinclude} ../../../../operator/pkg/cli/config.go
78+
:language: golang
79+
:start-after: // start config struct
80+
:end-before: // end config struct
81+
```
82+
83+
An example below shows an example where we connect via TLS to the Seldon scheduler using our scheduler client certificate:
84+
85+
```
86+
{
87+
"controlplane":{
88+
"schedulerHost": "seldon-scheduler.svc:9044",
89+
"tls"; true,
90+
"keyPath": "/home/certs/seldon-scheduler-client/tls.key",
91+
"crtPath": "/home/certs/seldon-scheduler-client/tls.crt",
92+
"caPath": "/home/certs/seldon-scheduler-client/ca.crt"
93+
}
94+
}
95+
96+
```
97+
98+
To manage config files and activate them you can use the CLI command `seldon config` which has subcommands to list, add, remove, activate and decative configs.
99+
100+
For example:
101+
102+
```
103+
$ seldon config list
104+
config path active
105+
------ ---- ------
106+
kind-sasl /home/work/seldon/cli/config-sasl.json *
107+
108+
$ seldon config deactivate kind-sasl
109+
110+
$ seldon config list
111+
config path active
112+
------ ---- ------
113+
kind-sasl /home/work/seldon/cli/config-sasl.json
114+
115+
$ seldon config add gcp-scv2 ~/seldon/cli/gcp.json
116+
117+
$ seldon config list
118+
config path active
119+
------ ---- ------
120+
gcp-scv2 /home/work/seldon/cli/gcp.json
121+
kind-sasl /home/work/seldon/cli/config-sasl.json
122+
123+
$ seldon config activate gcp-scv2
124+
125+
$ seldon config list
126+
config path active
127+
------ ---- ------
128+
gcp-scv2 /home/work/seldon/cli/gcp.json *
129+
kind-sasl /home/work/seldon/cli/config-sasl.json
130+
131+
$ seldon config list kind-sasl
132+
{
133+
"controlplane": {
134+
"schedulerHost": "172.19.255.2:9004"
135+
},
136+
"kafka": {
137+
"bootstrap": "172.19.255.3:9093",
138+
"caPath": "/home/work/gcp/scv2/certs/seldon-cluster-ca-cert/ca.crt"
139+
}
140+
}
141+
```
142+
143+
## TLS Certificates for Local Use
144+
145+
For running with Kubernetes TLS connections on the control and/or data plane, certificates will need to be downloaded locally. We provide an example script which will download certificates from a Kubernetes secret and store them in a folder. It can be found in `hack/download-k8s-certs.sh` and takes 2 or 3 arguments:
146+
147+
```
148+
./download-k8s-certs.sh <namespace> <secret> [<folder>]
149+
```
150+
151+
e.g.:
152+
153+
```
154+
./download-k8s-certs.sh seldon-mesh seldon-scheduler-client
155+
```

docs-gb/examples/batch-examples-k8s.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pip install mlserver
1414
```
1515

1616
{% hint style="info" %}
17-
**Note**: The Seldon CLI allows you to view information about underlying Seldon resources and make changes to them through the scheduler in non-Kubernetes environments. However, it cannot modify underlying manifests within a Kubernetes cluster. Therefore, using the Seldon CLI for control plane operations in a Kubernetes environment is not recommended. For more details, see [Seldon CLI](../cli/).
17+
**Note**: The Seldon CLI allows you to view information about underlying Seldon resources and make changes to them through the scheduler in non-Kubernetes environments. However, it cannot modify underlying manifests within a Kubernetes cluster. Therefore, using the Seldon CLI for control plane operations in a Kubernetes environment is not recommended. For more details, see [Seldon CLI](../getting-started/cli.md).
1818
{% endhint %}
1919

2020
### Seldon V2 Batch Examples

docs-gb/examples/custom-servers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Custom Servers
55

66
{% hint style="info" %}
7-
**Note**: The Seldon CLI allows you to view information about underlying Seldon resources and make changes to them through the scheduler in non-Kubernetes environments. However, it cannot modify underlying manifests within a Kubernetes cluster. Therefore, using the Seldon CLI for control plane operations in a Kubernetes environment is not recommended. For more details, see [Seldon CLI](../cli/).
7+
**Note**: The Seldon CLI allows you to view information about underlying Seldon resources and make changes to them through the scheduler in non-Kubernetes environments. However, it cannot modify underlying manifests within a Kubernetes cluster. Therefore, using the Seldon CLI for control plane operations in a Kubernetes environment is not recommended. For more details, see [Seldon CLI](../getting-started/cli.md).
88
{% endhint %}
99

1010
```python

docs-gb/examples/k8s-clusterwide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ MESH_IP_NS2
154154
### Run Models in Different Namespaces
155155

156156
{% hint style="info" %}
157-
**Note**: The Seldon CLI allows you to view information about underlying Seldon resources and make changes to them through the scheduler in non-Kubernetes environments. However, it cannot modify underlying manifests within a Kubernetes cluster. Therefore, using the Seldon CLI for control plane operations in a Kubernetes environment is not recommended. For more details, see [Seldon CLI](../cli/).
157+
**Note**: The Seldon CLI allows you to view information about underlying Seldon resources and make changes to them through the scheduler in non-Kubernetes environments. However, it cannot modify underlying manifests within a Kubernetes cluster. Therefore, using the Seldon CLI for control plane operations in a Kubernetes environment is not recommended. For more details, see [Seldon CLI](../getting-started/cli.md).
158158
{% endhint %}
159159

160160
```bash

0 commit comments

Comments
 (0)