Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

Commit

Permalink
add kubernetes
Browse files Browse the repository at this point in the history
  • Loading branch information
mike0sv committed Sep 16, 2022
1 parent bab1679 commit 3d346d3
Show file tree
Hide file tree
Showing 2 changed files with 161 additions and 0 deletions.
156 changes: 156 additions & 0 deletions content/docs/extensions/deployment/kubernetes.md
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**
5 changes: 5 additions & 0 deletions content/docs/sidebar.json
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,11 @@
"slug": "docker",
"label": "Docker",
"source": "deployment/docker.md"
},
{
"slug": "kubernetes",
"label": "Kubernetes",
"source": "deployment/kubernetes.md"
}
]
},
Expand Down

0 comments on commit 3d346d3

Please sign in to comment.