Skip to content

Commit 5edabab

Browse files
committed
Add Kubernetes installation
1 parent c1843ec commit 5edabab

File tree

7 files changed

+177
-118
lines changed

7 files changed

+177
-118
lines changed

Writerside/c.list

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@
33
SYSTEM "https://resources.jetbrains.com/writerside/1.0/categories.dtd">
44
<categories>
55
<category id="wrs" name="Writerside documentation" order="1"/>
6+
<category id="related" name="Related" order="2"/>
7+
<category id="repos" name="Repositories" order="3"/>
68
</categories>

Writerside/redirection-rules.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,8 @@
1414
<description>Created after removal of "Install on Open Data Hub" from TrustyAI</description>
1515
<accepts>Install-on-Open-Data-Hub.html</accepts>
1616
</rule>
17+
<rule id="43c37bd3">
18+
<description><![CDATA[Created after removal of "<Install-on-Kubernetes.md>" from TrustyAI]]></description>
19+
<accepts>Install-on-Kubernetes.html</accepts>
20+
</rule>
1721
</rules>

Writerside/t.tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
<toc-element topic="TrustyAI-Python.md"/>
2020
<toc-element topic="TrustyAI-core.md"/>
2121
<toc-element topic="TrustyAI-operator.md">
22-
<toc-element topic="Install-on-Kubernetes.md"/>
2322
</toc-element>
2423
<toc-element topic="TrustyAI-service.md">
2524
<toc-element topic="Starter.md"/>
@@ -29,6 +28,7 @@
2928
</toc-element>
3029
<toc-element topic="How-to.md">
3130
<toc-element topic="Install-on-Open-Data-Hub.md"/>
31+
<toc-element topic="Installing-on-Kubernetes.md"/>
3232
</toc-element>
3333
<toc-element topic="Tutorial.md">
3434
<toc-element topic="Bias-Monitoring-via-TrustyAI-in-ODH.md"/>

Writerside/topics/How-to.md

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,3 @@
11
# How to
22

3-
A How-to article is an action-oriented type of document.
4-
It explains how to perform a specific task or solve a problem, and usually contains a sequence of steps.
5-
Start with a short introductory paragraph that explains what users will accomplish by following this procedure,
6-
what they need to perform it for, or define the target audience of the doc.
7-
8-
> **Highlight important information**
9-
>
10-
> You can change the element to *tip* or *warning* by renaming the style attribute below.
11-
>
12-
{style="note"}
13-
14-
## Before you start
15-
16-
It is good practice to list the prerequisites that are required or recommended.
17-
18-
Make sure that:
19-
- First prerequisite
20-
- Second prerequisite
21-
22-
## How to perform a task
23-
24-
Some introductory information.
25-
26-
1. Step with a code block
27-
28-
```bash
29-
run this --that
30-
```
31-
32-
2. Step with an image
33-
![](image.png)
34-
35-
<!-- The 'src' attribute should contain the name of an image from the '/images' folder in your project -->
36-
37-
3. Step with a list.
38-
- List item
39-
- List item
40-
- List item
3+
A list of how-to articles.

Writerside/topics/Install-on-Kubernetes.md

Lines changed: 0 additions & 78 deletions
This file was deleted.
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
# Installing on Kubernetes
2+
3+
## Using pre-built operator image
4+
5+
This operator is available as an [image on Quay.io](https://quay.io/repository/trustyai/trustyai-service-operator?tab=history).
6+
To deploy it on your cluster:
7+
8+
1. **Install the Custom Resource Definition (CRD):**
9+
10+
Apply the CRD to your cluster (replace the URL with the relevant one, if using another repository):
11+
12+
```bash
13+
kubectl apply -f https://raw.githubusercontent.com/trustyai-explainability/trustyai-service-operator/main/config/crd/bases/trustyai.opendatahub.io.trustyai.opendatahub.io_trustyaiservices.yaml
14+
```
15+
16+
2. **Deploy the Operator:**
17+
18+
Apply the following Kubernetes manifest to deploy the operator:
19+
20+
```yaml
21+
apiVersion: apps/v1
22+
kind: Deployment
23+
metadata:
24+
name: trustyai-operator
25+
namespace: trustyai-operator-system
26+
spec:
27+
replicas: 1
28+
selector:
29+
matchLabels:
30+
control-plane: trustyai-operator
31+
template:
32+
metadata:
33+
labels:
34+
control-plane: trustyai-operator
35+
spec:
36+
containers:
37+
- name: trustyai-operator
38+
image: quay.io/trustyai/trustyai-service-operator:latest
39+
command:
40+
- /manager
41+
resources:
42+
limits:
43+
cpu: 100m
44+
memory: 30Mi
45+
requests:
46+
cpu: 100m
47+
memory: 20Mi
48+
```
49+
50+
or run
51+
52+
```shell
53+
kubectl apply -f https://raw.githubusercontent.com/trustyai-explainability/trustyai-service-operator/main/artifacts/examples/deploy-operator.yaml
54+
```
55+
56+
## Usage
57+
58+
Once the operator is installed, you can create `TrustyAIService` resources, and the operator will create corresponding TrustyAI deployments, services, and (on OpenShift) routes.
59+
60+
Here's an example `TrustyAIService` manifest:
61+
62+
```yaml
63+
apiVersion: trustyai.opendatahub.io.trusty.opendatahub.io/v1
64+
kind: TrustyAIService
65+
metadata:
66+
name: trustyai-service-example
67+
spec:
68+
storage:
69+
format: "PVC"
70+
folder: "/inputs"
71+
size: "1Gi"
72+
data:
73+
filename: "data.csv"
74+
format: "CSV"
75+
metrics:
76+
schedule: "5s"
77+
batchSize: 5000 # Optional, defaults to 5000
78+
```
79+
80+
You can apply this manifest with
81+
82+
```shell
83+
kubectl apply -f <file-name.yaml> -n $NAMESPACE
84+
```
85+
to create a service, where `$NAMESPACE` is the namespace where you want to deploy it.
86+
87+
88+
Additionally, in that namespace:
89+
90+
* a `ServiceMonitor` will be created to allow Prometheus to scrape metrics from the service.
91+
* (if on OpenShift) a `Route` will be created to allow external access to the service.
92+
93+
### Custom Image Configuration using ConfigMap
94+
You can specify a custom TrustyAI-service image via adding parameters to the TrustyAI-Operator KFDef, for example:
95+
96+
```yaml
97+
apiVersion: kfdef.apps.kubeflow.org/v1
98+
kind: KfDef
99+
metadata:
100+
name: trustyai-service-operator
101+
namespace: opendatahub
102+
spec:
103+
applications:
104+
- kustomizeConfig:
105+
repoRef:
106+
name: manifests
107+
path: config
108+
parameters:
109+
- name: trustyaiServiceImage
110+
value: NEW_IMAGE_NAME
111+
name: trustyai-service-operator
112+
repos:
113+
- name: manifests
114+
uri: https://github.com/trustyai-explainability/trustyai-service-operator/tarball/main
115+
version: v1.0.0
116+
```
117+
If these parameters are unspecified, the [default image and tag](config/base/params.env) will be used.
118+
119+
120+
If you'd like to change the service image/tag after deploying the operator, simply change the parameters in the KFDef. Any
121+
TrustyAI service deployed subsequently will use the new image and tag.
122+
123+
### `TrustyAIService` Status Updates
124+
125+
The `TrustyAIService` custom resource tracks the availability of `InferenceServices` and `PersistentVolumeClaims (PVCs)`
126+
through its `status` field. Below are the status types and reasons that are available:
127+
128+
#### `InferenceService` Status
129+
130+
| Status Type | Status Reason | Description |
131+
|-------------------------------|-----------------------------------|-----------------------------------|
132+
| `InferenceServicesPresent` | `InferenceServicesNotFound` | InferenceServices were not found. |
133+
| `InferenceServicesPresent` | `InferenceServicesFound` | InferenceServices were found. |
134+
135+
#### `PersistentVolumeClaim` (PVCs) Status
136+
137+
| Status Type | Status Reason | Description |
138+
|------------------|-----------------|------------------------------------|
139+
| `PVCAvailable` | `PVCNotFound` | `PersistentVolumeClaim` not found. |
140+
| `PVCAvailable` | `PVCFound` | `PersistentVolumeClaim` found. |
141+
142+
143+
#### Status Behavior
144+
145+
- If a PVC is not available, the `Ready` status of `TrustyAIService` will be set to `False`.
146+
- However, if `InferenceServices` are not found, the `Ready` status of `TrustyAIService` will not be affected, _i.e._, it is `Ready` by all other conditions, it will remain so.
Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
11
# TrustyAI operator
22

3-
Start typing here...
3+
The TrustyAI Kubernetes Operator aims at simplifying the deployment and management of the
4+
[TrustyAI service](TrustyAI-service.md) on Kubernetes and OpenShift clusters by watching for custom resources of kind
5+
`TrustyAIService` in the `trustyai.opendatahub.io` API group and manages deployments, services, and optionally, routes
6+
and `ServiceMonitors` corresponding to these resources.
7+
8+
The operator ensures the service is properly configured, is discoverable by Prometheus for metrics scraping
9+
(on both Kubernetes and OpenShift), and is accessible via a Route on OpenShift.
10+
11+
## Prerequisites
12+
13+
- Kubernetes cluster v1.19+ or OpenShift cluster v4.6+
14+
- `kubectl` v1.19+ or `oc` client v4.6+
15+
16+
<seealso style="links">
17+
<category ref="related">
18+
<a href="Install-on-Open-Data-Hub.md">Installing on Open Data Hub</a>
19+
<a href="Installing-on-Kubernetes.md">Installing on Kubernetes</a>
20+
</category>
21+
<category ref="repos">
22+
<a href="https://github.com/trustyai-explainability/trustyai-service-operator">TrustyAI operator</a>
23+
</category>
24+
25+
</seealso>

0 commit comments

Comments
 (0)