> ## Documentation Index
> Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Installing Kubeflow

> Guide for installing Kubeflow on Kubernetes covering prerequisites, kustomize deploy with retry loop, readiness checks, accessing the web UI, and installing the Pipelines Python SDK

In this lesson you'll learn a reliable, repeatable workflow to install Kubeflow onto a Kubernetes cluster. We'll cover prerequisites, the kustomize-based deploy flow (with a retry loop), how to check readiness, and how to access the Kubeflow UI and SDK from your workstation.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/MGkgrGfKHDtoCnUb/images/Kubeflow/Fundamentals-of-Kubeflow/Installing-Kubeflow/installing-kubeflow-blue-green-slide.jpg?fit=max&auto=format&n=MGkgrGfKHDtoCnUb&q=85&s=79a2dd24e881e76b31253aba4d9d91ac" alt="A blue-green gradient slide with the centered title &#x22;Installing Kubeflow.&#x22; A small &#x22;© Copyright KodeKloud&#x22; appears in the bottom-left." width="1920" height="1080" data-path="images/Kubeflow/Fundamentals-of-Kubeflow/Installing-Kubeflow/installing-kubeflow-blue-green-slide.jpg" />
</Frame>

## Prerequisites

| Requirement | Purpose / Notes | Example / Command |
| - | - | - |
| Kubernetes cluster | A working cluster with enough CPU/memory for Kubeflow components | — |
| kubectl | Interact with the cluster | `kubectl version --client` |
| kustomize | Build and patch Kubeflow manifests | `kustomize version` |
| Network access | Ability to port-forward or access an ingress gateway | — |
| Python (optional) | For developing/submitting Kubeflow Pipelines locally | `python --version` |

## High-level installation flow

1. Clone or download the Kubeflow manifests repository to your local machine.
2. Choose the kustomize overlay or directory you want to deploy (for example `manifests` or a specific overlay from the repo).
3. Run `kustomize build` and pipe the output to `kubectl apply`. Use a retry loop to address ordering/timing issues during the initial deployment.
4. Wait for pods and services to become ready.
5. Port-forward the ingress gateway (or use your cluster ingress) to access the Kubeflow web UI.
6. (Optional) Install the Kubeflow Pipelines Python SDK (`kfp`) locally to build and submit pipelines.

## Clone the manifests repository

Clone the official manifests repository or your fork:

```bash theme={null}
git clone https://github.com/kubeflow/manifests.git
cd manifests
```

Replace the repo URL with your preferred source if you maintain a custom overlay.

## Build and apply manifests (recommended retry loop)

Applying the full manifest set can fail initially because some resources depend on others. Use a retry loop that runs `kustomize build` and applies the generated manifests until `kubectl` succeeds:

```bash theme={null}
while ! kustomize build <overlay-path> | kubectl apply --server-side --force-conflicts -f -; do
  echo "Retrying to apply resources..."
  sleep 20
done
```

* Replace `<overlay-path>` with the overlay or directory you intend to deploy (for example `manifests` or a specific overlay subdirectory).
* `--server-side` performs a server-side apply, and `--force-conflicts` helps when resources already exist or are in conflict.

<Callout icon="lightbulb" color="#1CB2FE">
  Kubeflow manifests are composed with kustomize. If you want a lighter install, remove or comment out components in the selected overlay before building. Expect a few retries during the first apply due to resource ordering and readiness dependencies.
</Callout>

## Verify resources and wait for readiness

Check pods and other resources across namespaces to track progress:

```bash theme={null}
# Watch all pods across namespaces
kubectl get pods -A --watch

# Or check the kubeflow namespace (if used)
kubectl get pods -n kubeflow

# Wait for all deployments in the kubeflow namespace to become available (example with timeout)
kubectl wait --for=condition=available deployment --all -n kubeflow --timeout=600s
```

If your installation uses another namespace or overlay, replace `kubeflow` accordingly. You can also inspect logs for pods that are not reaching Ready state:

```bash theme={null}
kubectl logs -n <namespace> <pod-name> -c <container-name>
```

## Accessing the Kubeflow web UI

The Kubeflow UI is typically exposed inside the cluster via an ingress gateway. A common and simple way to access it from your workstation is to port-forward the Istio ingress gateway to a local port:

```bash theme={null}
kubectl port-forward svc/istio-ingressgateway -n istio-system 8080:80
```

Then open the UI in your browser at:
[http://localhost:8080](http://localhost:8080)

If your cluster uses a different ingress (e.g., Ambassador, Contour, or a cloud load balancer), follow that ingress’s instructions to expose the Kubeflow UI.

## Install the Kubeflow Pipelines SDK

To develop and submit Kubeflow Pipelines from your workstation, install the Python SDK:

```bash theme={null}
pip install kfp
```

After installation, you can author and submit pipeline runs using the `kfp` package and the Kubeflow Pipelines API.

## Troubleshooting tips

* If pods remain in CrashLoopBackOff or Pending, inspect pod events and container logs.
* Ensure cluster nodes have enough CPU, memory and ephemeral storage for all components.
* Network policies, restricted PodSecurityPolicies (or PSP replacements), or RBAC rules can block some controllers—check cluster admission controls.
* If the Istio ingress Service is not present, verify the istio installation or the overlay you chose includes an ingress component.

<Callout icon="warning" color="#FF6B6B">
  Large Kubeflow installations can consume significant cluster resources. Verify your cluster has sufficient CPU, memory, and storage before deploying, and consider a trimmed overlay if resources are limited.
</Callout>

## Useful commands quick reference

| Task | Command |
| - | - |
| Apply with kustomize (retry loop) | See loop above |
| Watch pods across namespaces | `kubectl get pods -A --watch` |
| Wait for all deployments | `kubectl wait --for=condition=available deployment --all -n kubeflow --timeout=600s` |
| Port-forward Istio ingress | `kubectl port-forward svc/istio-ingressgateway -n istio-system 8080:80` |
| Install kfp SDK | `pip install kfp` |

## Links and references

* Kubeflow manifests repository: [https://github.com/kubeflow/manifests](https://github.com/kubeflow/manifests)
* Kubeflow Pipelines SDK (kfp) on PyPI: [https://pypi.org/project/kfp/](https://pypi.org/project/kfp/)
* Kubernetes documentation: [https://kubernetes.io/docs/](https://kubernetes.io/docs/)
* kustomize: [https://kubectl.docs.kubernetes.io/installation/kustomize/](https://kubectl.docs.kubernetes.io/installation/kustomize/)

<CardGroup>
  <Card title="Watch Video" icon="video" cta="Learn more" href="https://learn.kodekloud.com/user/courses/kubeflow/module/24395bd8-eef8-4e7a-aa70-510287e3a88d/lesson/2a30ad89-56d9-4a17-9162-3dd396129dfd" />
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.