-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from ruivieira/install-k8s
Add Kubernetes installation
- Loading branch information
Showing
7 changed files
with
177 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,3 @@ | ||
# How to | ||
|
||
A How-to article is an action-oriented type of document. | ||
It explains how to perform a specific task or solve a problem, and usually contains a sequence of steps. | ||
Start with a short introductory paragraph that explains what users will accomplish by following this procedure, | ||
what they need to perform it for, or define the target audience of the doc. | ||
|
||
> **Highlight important information** | ||
> | ||
> You can change the element to *tip* or *warning* by renaming the style attribute below. | ||
> | ||
{style="note"} | ||
|
||
## Before you start | ||
|
||
It is good practice to list the prerequisites that are required or recommended. | ||
|
||
Make sure that: | ||
- First prerequisite | ||
- Second prerequisite | ||
|
||
## How to perform a task | ||
|
||
Some introductory information. | ||
|
||
1. Step with a code block | ||
|
||
```bash | ||
run this --that | ||
``` | ||
|
||
2. Step with an image | ||
![](image.png) | ||
|
||
<!-- The 'src' attribute should contain the name of an image from the '/images' folder in your project --> | ||
|
||
3. Step with a list. | ||
- List item | ||
- List item | ||
- List item | ||
A list of how-to articles. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
# Installing on Kubernetes | ||
|
||
## Using pre-built operator image | ||
|
||
This operator is available as an [image on Quay.io](https://quay.io/repository/trustyai/trustyai-service-operator?tab=history). | ||
To deploy it on your cluster: | ||
|
||
1. **Install the Custom Resource Definition (CRD):** | ||
|
||
Apply the CRD to your cluster (replace the URL with the relevant one, if using another repository): | ||
|
||
```bash | ||
kubectl apply -f https://raw.githubusercontent.com/trustyai-explainability/trustyai-service-operator/main/config/crd/bases/trustyai.opendatahub.io.trustyai.opendatahub.io_trustyaiservices.yaml | ||
``` | ||
|
||
2. **Deploy the Operator:** | ||
|
||
Apply the following Kubernetes manifest to deploy the operator: | ||
|
||
```yaml | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: trustyai-operator | ||
namespace: trustyai-operator-system | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
control-plane: trustyai-operator | ||
template: | ||
metadata: | ||
labels: | ||
control-plane: trustyai-operator | ||
spec: | ||
containers: | ||
- name: trustyai-operator | ||
image: quay.io/trustyai/trustyai-service-operator:latest | ||
command: | ||
- /manager | ||
resources: | ||
limits: | ||
cpu: 100m | ||
memory: 30Mi | ||
requests: | ||
cpu: 100m | ||
memory: 20Mi | ||
``` | ||
|
||
or run | ||
|
||
```shell | ||
kubectl apply -f https://raw.githubusercontent.com/trustyai-explainability/trustyai-service-operator/main/artifacts/examples/deploy-operator.yaml | ||
``` | ||
|
||
## Usage | ||
|
||
Once the operator is installed, you can create `TrustyAIService` resources, and the operator will create corresponding TrustyAI deployments, services, and (on OpenShift) routes. | ||
|
||
Here's an example `TrustyAIService` manifest: | ||
```yaml | ||
apiVersion: trustyai.opendatahub.io.trusty.opendatahub.io/v1 | ||
kind: TrustyAIService | ||
metadata: | ||
name: trustyai-service-example | ||
spec: | ||
storage: | ||
format: "PVC" | ||
folder: "/inputs" | ||
size: "1Gi" | ||
data: | ||
filename: "data.csv" | ||
format: "CSV" | ||
metrics: | ||
schedule: "5s" | ||
batchSize: 5000 # Optional, defaults to 5000 | ||
``` | ||
You can apply this manifest with | ||
```shell | ||
kubectl apply -f <file-name.yaml> -n $NAMESPACE | ||
``` | ||
to create a service, where `$NAMESPACE` is the namespace where you want to deploy it. | ||
Additionally, in that namespace: | ||
* a `ServiceMonitor` will be created to allow Prometheus to scrape metrics from the service. | ||
* (if on OpenShift) a `Route` will be created to allow external access to the service. | ||
### Custom Image Configuration using ConfigMap | ||
You can specify a custom TrustyAI-service image via adding parameters to the TrustyAI-Operator KFDef, for example: | ||
```yaml | ||
apiVersion: kfdef.apps.kubeflow.org/v1 | ||
kind: KfDef | ||
metadata: | ||
name: trustyai-service-operator | ||
namespace: opendatahub | ||
spec: | ||
applications: | ||
- kustomizeConfig: | ||
repoRef: | ||
name: manifests | ||
path: config | ||
parameters: | ||
- name: trustyaiServiceImage | ||
value: NEW_IMAGE_NAME | ||
name: trustyai-service-operator | ||
repos: | ||
- name: manifests | ||
uri: https://github.com/trustyai-explainability/trustyai-service-operator/tarball/main | ||
version: v1.0.0 | ||
``` | ||
If these parameters are unspecified, the [default image and tag](config/base/params.env) will be used. | ||
If you'd like to change the service image/tag after deploying the operator, simply change the parameters in the KFDef. Any | ||
TrustyAI service deployed subsequently will use the new image and tag. | ||
|
||
### `TrustyAIService` Status Updates | ||
|
||
The `TrustyAIService` custom resource tracks the availability of `InferenceServices` and `PersistentVolumeClaims (PVCs)` | ||
through its `status` field. Below are the status types and reasons that are available: | ||
|
||
#### `InferenceService` Status | ||
|
||
| Status Type | Status Reason | Description | | ||
|-------------------------------|-----------------------------------|-----------------------------------| | ||
| `InferenceServicesPresent` | `InferenceServicesNotFound` | InferenceServices were not found. | | ||
| `InferenceServicesPresent` | `InferenceServicesFound` | InferenceServices were found. | | ||
|
||
#### `PersistentVolumeClaim` (PVCs) Status | ||
|
||
| Status Type | Status Reason | Description | | ||
|------------------|-----------------|------------------------------------| | ||
| `PVCAvailable` | `PVCNotFound` | `PersistentVolumeClaim` not found. | | ||
| `PVCAvailable` | `PVCFound` | `PersistentVolumeClaim` found. | | ||
|
||
|
||
#### Status Behavior | ||
|
||
- If a PVC is not available, the `Ready` status of `TrustyAIService` will be set to `False`. | ||
- 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,25 @@ | ||
# TrustyAI operator | ||
|
||
Start typing here... | ||
The TrustyAI Kubernetes Operator aims at simplifying the deployment and management of the | ||
[TrustyAI service](TrustyAI-service.md) on Kubernetes and OpenShift clusters by watching for custom resources of kind | ||
`TrustyAIService` in the `trustyai.opendatahub.io` API group and manages deployments, services, and optionally, routes | ||
and `ServiceMonitors` corresponding to these resources. | ||
|
||
The operator ensures the service is properly configured, is discoverable by Prometheus for metrics scraping | ||
(on both Kubernetes and OpenShift), and is accessible via a Route on OpenShift. | ||
|
||
## Prerequisites | ||
|
||
- Kubernetes cluster v1.19+ or OpenShift cluster v4.6+ | ||
- `kubectl` v1.19+ or `oc` client v4.6+ | ||
|
||
<seealso style="links"> | ||
<category ref="related"> | ||
<a href="Install-on-Open-Data-Hub.md">Installing on Open Data Hub</a> | ||
<a href="Installing-on-Kubernetes.md">Installing on Kubernetes</a> | ||
</category> | ||
<category ref="repos"> | ||
<a href="https://github.com/trustyai-explainability/trustyai-service-operator">TrustyAI operator</a> | ||
</category> | ||
</seealso> |