This repository has been archived by the owner on Oct 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
161 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,156 @@ | ||
# Kubernetes Deployments Support | ||
|
||
## Description | ||
|
||
**TODO** | ||
|
||
## Requirements | ||
|
||
```bash | ||
pip install mlem[kubernetes] | ||
# or | ||
pip install kubernetes docker | ||
``` | ||
|
||
## Examples | ||
|
||
```python | ||
|
||
``` | ||
|
||
## Implementation reference | ||
|
||
### `class K8sYamlBuilder` | ||
|
||
**MlemABC parent type**: `builder` | ||
|
||
**MlemABC type**: `kubernetes` | ||
|
||
MlemBuilder implementation for building Kubernetes manifests/yamls | ||
|
||
**Fields**: | ||
|
||
- `target: str` _(required)_ - Target path for the manifest/yaml | ||
|
||
- `namespace: str = "mlem"` - Namespace to create kubernetes resources such as | ||
pods, service in | ||
|
||
- `image_name: str = "ml"` - Name of the docker image to be deployed | ||
|
||
- `image_uri: str = "ml:latest"` - URI of the docker image to be deployed | ||
|
||
- `image_pull_policy: ImagePullPolicy = "Always"` - Image pull policy for the | ||
docker image to be deployed | ||
|
||
- `port: int = 8080` - Port where the service should be available | ||
|
||
- `service_type: ServiceType = NodePortService()` - Type of service by which | ||
endpoints of the model are exposed | ||
|
||
--- | ||
|
||
### `class K8sDeploymentState` | ||
|
||
**MlemABC parent type**: `deploy_state` | ||
|
||
**MlemABC type**: `kubernetes` | ||
|
||
DeployState implementation for Kubernetes deployments | ||
|
||
**Fields**: | ||
|
||
- `model_hash: str` - hash of deployed model meta | ||
|
||
- `image: DockerImage` - Docker Image being used for Deployment | ||
|
||
- `deployment_name: str` - Name of Deployment | ||
|
||
--- | ||
|
||
### `class K8sDeployment` | ||
|
||
**MlemABC parent type**: `deployment` | ||
|
||
**MlemABC type**: `kubernetes` | ||
|
||
MlemDeployment implementation for Kubernetes deployments | ||
|
||
**Fields**: | ||
|
||
- `namespace: str = "mlem"` - Namespace to create kubernetes resources such as | ||
pods, service in | ||
|
||
- `image_name: str = "ml"` - Name of the docker image to be deployed | ||
|
||
- `image_uri: str = "ml:latest"` - URI of the docker image to be deployed | ||
|
||
- `image_pull_policy: ImagePullPolicy = "Always"` - Image pull policy for the | ||
docker image to be deployed | ||
|
||
- `port: int = 8080` - Port where the service should be available | ||
|
||
- `service_type: ServiceType = NodePortService()` - Type of service by which | ||
endpoints of the model are exposed | ||
|
||
- `state_manager: StateManager` - State manager used | ||
|
||
- `server: Server` - Type of Server to use, with options such as FastAPI, | ||
RabbitMQ etc. | ||
|
||
- `registry: DockerRegistry = DockerRegistry()` - Docker registry | ||
|
||
- `daemon: DockerDaemon = host=''` - Docker daemon | ||
|
||
- `kube_config_file_path: str` - Path for kube config file of the cluster | ||
|
||
--- | ||
|
||
### `class K8sEnv` | ||
|
||
**MlemABC parent type**: `env` | ||
|
||
**MlemABC type**: `kubernetes` | ||
|
||
MlemEnv implementation for Kubernetes Environments | ||
|
||
**Fields**: | ||
|
||
- `registry: DockerRegistry` - Docker registry | ||
|
||
--- | ||
|
||
### `class ClusterIPService` | ||
|
||
**MlemABC parent type**: `k8s_service_type` | ||
|
||
**MlemABC type**: `clusterip` | ||
|
||
ClusterIP Service implementation for service inside a Kubernetes | ||
Cluster | ||
|
||
**No fields** | ||
|
||
--- | ||
|
||
### `class LoadBalancerService` | ||
|
||
**MlemABC parent type**: `k8s_service_type` | ||
|
||
**MlemABC type**: `loadbalancer` | ||
|
||
LoadBalancer Service implementation for service inside a Kubernetes | ||
Cluster | ||
|
||
**No fields** | ||
|
||
--- | ||
|
||
### `class NodePortService` | ||
|
||
**MlemABC parent type**: `k8s_service_type` | ||
|
||
**MlemABC type**: `nodeport` | ||
|
||
NodePort Service implementation for service inside a Kubernetes Cluster | ||
|
||
**No fields** |
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