diff --git a/k8s/readme.md b/k8s/readme.md new file mode 100644 index 000000000..16489cec7 --- /dev/null +++ b/k8s/readme.md @@ -0,0 +1,100 @@ +# K8s Deployment Instructions + +This guide provides step-by-step instructions for deploying the application on a Kubernetes cluster. The deployment files should be applied in the following order: `ollama`, `postgres`, `redis`, `web`, `celery`, and `celery-beat`. + +## Prerequisites + +- A running Kubernetes cluster +- `kubectl` installed and configured to interact with your cluster + +## Step 1: Install the Ingress Controller + +1. **Add the NGINX Ingress Controller Helm repository:** + ```sh + helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx + helm repo update + ``` + +2. **Install the NGINX Ingress Controller:** + ```sh + helm install ingress-nginx ingress-nginx/ingress-nginx + ``` + +## Step 2: Install Cert Manager + +1. **Add the Jetstack Helm repository:** + ```sh + helm repo add jetstack https://charts.jetstack.io + helm repo update + ``` + +2. **Install Cert Manager:** + ```sh + kubectl apply --validate=false -f https://github.com/jetstack/cert-manager/releases/download/v1.5.3/cert-manager.crds.yaml + helm install cert-manager jetstack/cert-manager --namespace cert-manager --create-namespace + ``` + +3. **Verify the installation:** + ```sh + kubectl get pods --namespace cert-manager + ``` + +## Step 3: Install OpenEBS NFS Provisioner + +1. **Add the OpenEBS Helm repository:** + ```sh + helm repo add openebs https://openebs.github.io/charts + helm repo update + ``` + +2. **Install OpenEBS NFS Provisioner:** + ```sh + helm install openebs-nfs openebs/openebs --namespace openebs --create-namespace + ``` + +3. **Verify the installation:** + ```sh + kubectl get pods --namespace openebs + ``` + +## Step 4: Deploy the Application Manifests + +1. **Navigate to the `k8s` directory:** + ```sh + cd k8s + ``` + +2. **Apply the manifests in the following order:** + ```sh + kubectl apply -f ollama/ + kubectl apply -f postgres/ + kubectl apply -f redis/ + kubectl apply -f web/ + kubectl apply -f celery/ + kubectl apply -f celery-beat/ + ``` + +## Step 5: Verify the Deployment + +1. **Check the status of the pods:** + ```sh + kubectl get pods + ``` + +2. **Check the status of the services:** + ```sh + kubectl get svc + ``` + +3. **Check the status of the Ingress:** + ```sh + kubectl get ingress + ``` + +## Additional Configuration + +- **Ingress Configuration:** Ensure that your Ingress resources are correctly configured to route traffic to your services. +- **Certificates:** Use Cert Manager to issue and manage TLS certificates for your Ingress resources. +- **Persistent Volumes:** Ensure that your Persistent Volume Claims (PVCs) are correctly bound to the Persistent Volumes (PVs) provided by OpenEBS NFS Provisioner. + +By following these steps, you should be able to deploy your application on Kubernetes with the necessary Ingress controller, Cert Manager, and OpenEBS NFS Provisioner. \ No newline at end of file