Skip to content

Setup Kubernetes

remsky edited this page Feb 13, 2025 · 2 revisions

Kubernetes Helm chart installation with GPU

Thanks to @zucher for the PR and Wiki guide Add Helm chart #157

Installation Guide

1. Prerequisites

Ensure you have the following tools installed:

  • Helm: Install Helm
  • kubectl: Configured to communicate with your Kubernetes cluster
  • Git: Installed on your system

Verify the Nvidia GPU operator is correctly installed on your Kubernetes cluster (see Installing the NVIDIA GPU Operator)

2. Clone the GitHub Repository

Clone the repository containing the Kokoro-FastAPI Helm chart.

git clone https://github.com/remsky/Kokoro-FastAPI.git
cd Kokoro-FastAPI/charts/kokoro-fastapi

3. Install the Chart

Navigate to the directory with the Helm chart and install it using Helm.

Installation in the target-namespace of you choice

helm install kokoro-fastapi . --namespace <target-namespace> --create-namespace

This command installs the chart in the target-namespace namespace, creating the namespace if it doesn't exist.

4. Verify Installation

Check that your application is running by listing the resources in the namespace.

kubectl get all -n <target-namespace>

Customizing the Helm Chart

If you need to customize the installation, you can use a custom values.yaml file or override specific values directly via command-line arguments.

Using a Custom values.yaml File

Create your own values.yaml file with custom configurations and install the chart using it:

helm install kokoro-fastapi . --namespace <target-namespace> --create-namespace -f my-custom-values.yaml

Example my-custom-values.yaml

Here is an example of a simple values.yaml file:

replicaCount: 2

image:
  repository: ghcr.io/remsky/kokoro-fastapi-gpu
  tag: v0.2.1
  pullPolicy: IfNotPresent

ingress:
    enabled: true
    host:
        name: my-kokoro-endpoint.dev

...

Overriding Values Directly

You can override specific values directly in the Helm install command:

helm install kokoro-fastapi . \
  --namespace <target-namespace> \
  --create-namespace \
  --set replicaCount=2 \
  --set image.tag=v0.2.1

Updating the Deployment

To update your existing deployment with new configurations, use the Helm upgrade command:

helm upgrade kokoro-fastapi . -n <target-namespace> -f my-custom-values.yaml

Or using directly overridden values:

helm upgrade kokoro-fastapi . \
  -n <target-namepsace> \
  --set replicaCount=1

Important Notes

  • Rollback: If something goes wrong, you can rollback to the previous version:
    helm rollback kokoro-fastapi -n <target-namepsace>