DEV Community

Cover image for Deploying Kubeflow as an Azure ML Alternative
Sanskriti Harmukh for Vultr

Posted on with Aashish Chaurasiya Originally published at docs.vultr.com

Deploying Kubeflow as an Azure ML Alternative

Azure Machine Learning is Microsoft's cloud-native machine learning platform that provides experiment tracking, managed compute, pipelines, a model registry, and model serving as hosted services within the Azure ecosystem, but it ties teams to Azure-specific APIs, managed compute pricing, and Microsoft's tooling. Kubeflow is an open-source machine learning platform built on Kubernetes that provides self-hosted alternatives to Azure ML capabilities through modular, portable components, letting organizations retain complete control over infrastructure, data residency, scalability, and operational costs. This guide deploys Kubeflow on a Kubernetes cluster as a self-managed replacement for Azure Machine Learning, covering installation with Kustomize manifests, notebook setup, ML pipeline orchestration, distributed training with the Trainer v2 API, model serving through KServe, hyperparameter optimization using Katib, RBAC and access management, object storage integration, and migration considerations for existing Azure ML workflows. By the end, you'll have a self-hosted ML platform running notebooks, pipelines, distributed training, model serving, and automated hyperparameter tuning.


Understanding Azure Machine Learning vs Kubeflow

Azure ML and Kubeflow provide comparable ML platform capabilities, but they differ in deployment and operational models. Azure ML delivers these as fully managed services within the Azure ecosystem, while Kubeflow provides equivalent open-source components that run on any Kubernetes cluster. The following table maps each Azure ML feature to its Kubeflow counterpart.

Azure Machine Learning Kubeflow Equivalent Description
Azure ML Notebooks Kubeflow Notebooks Interactive development environments with JupyterLab, VS Code, and RStudio
Azure ML Jobs Kubeflow Trainer Distributed training for PyTorch, DeepSpeed, MLX, JAX, and XGBoost workloads
Azure ML Pipelines Kubeflow Pipelines (KFP) Directed Acyclic Graph (DAG) based ML workflow orchestration
Azure ML Model Registry Kubeflow Model Registry Versioned model artifact management with metadata tracking
Azure ML Endpoints KServe Serverless model serving with autoscaling and canary deployments
Azure ML Experiments Katib Automated hyperparameter tuning with multiple search algorithms

Self-hosting with Kubeflow eliminates per-minute compute charges, keeps all data within your own cluster, runs on any cloud provider or on-premises hardware, and allows complete customization of every component.

Prerequisites

Before you begin, you need to:

  • Have access to a multi-node Kubernetes cluster that runs Kubernetes 1.31 or later with at least 4 CPU cores and 16 GB of RAM per node (minimum 3 nodes recommended).
  • Install kubectl and configure it to connect to your cluster.
  • Install Kustomize version 5.4.3 or later.
  • Have a default StorageClass that is configured in your cluster for provisioning persistent volumes.

Install Kubeflow

Kubeflow uses Kustomize to deploy its components as Kubernetes resources. The official kubeflow/manifests repository contains all component manifests that are organized under common/ for shared infrastructure services such as Istio, cert-manager, and Dex, and under applications/ for Kubeflow-specific applications such as Pipelines, Notebooks, and KServe.

Deploy Kubeflow via Manifests

The following steps clone the Kubeflow manifests repository and deploy all components to the cluster.

1. Verify the Kubernetes cluster connection:

$ kubectl cluster-info
Enter fullscreen mode Exit fullscreen mode

2. Check the Kubernetes server version:

$ kubectl version
Enter fullscreen mode Exit fullscreen mode

Verify that the Server Version field shows version 1.31 or later.

3. Clone the official Kubeflow manifests repository:

$ git clone https://github.com/kubeflow/manifests.git
Enter fullscreen mode Exit fullscreen mode

4. Switch to the manifests directory:

$ cd manifests
Enter fullscreen mode Exit fullscreen mode

5. Check out the latest stable release tag:

$ git checkout 26.03
Enter fullscreen mode Exit fullscreen mode

6. Deploy all Kubeflow components:

The command uses a bounded retry loop that attempts the installation up to 5 times, which accommodates the time that Kubernetes CRDs and webhooks need to register before dependent resources apply. The loop exits automatically after a successful apply or after reaching the retry limit.

$ for i in 1 2 3 4 5; do kustomize build example | kubectl apply --server-side --force-conflicts -f - && break || { echo "Attempt $i failed, retrying in 30s..."; sleep 30; }; done
Enter fullscreen mode Exit fullscreen mode

The first one or two attempts may output errors about CRDs or webhooks not being established. These errors are expected and resolve on subsequent attempts after the CRDs register. The loop exits automatically when the apply succeeds, which typically happens on the second or third attempt. The full installation takes approximately 10 to 15 minutes after the final successful apply for all pods to reach a Running state. The --server-side --force-conflicts flags are required because some Kubeflow CRDs exceed the annotation size limit that standard kubectl apply supports.

The default installation uses the email user@example.com and password 12341234. Change these credentials before exposing Kubeflow to any network. See the Set Up Access Control section later in this article for instructions.

Verify Installation

After the deployment completes, verify that all Kubeflow components are running and the CRDs are registered.

1. Check that all pods in the kubeflow namespace reach a Running state:

$ kubectl get pods -n kubeflow --field-selector=status.phase!=Succeeded
Enter fullscreen mode Exit fullscreen mode

Verify that all listed pods display a Running status with all containers ready. If any pods show CrashLoopBackOff or Pending, check their logs with kubectl logs -n kubeflow POD-NAME and verify that the cluster meets the minimum resource requirements.

2. Check that the Istio ingress gateway service is running:

$ kubectl get svc istio-ingressgateway -n istio-system
Enter fullscreen mode Exit fullscreen mode

Verify that the service appears in the output.

3. Check that Kubeflow and its component CRDs are registered:

$ kubectl get crd | grep -E "kubeflow|kserve|katib|istio|knative|trainer" | wc -l
Enter fullscreen mode Exit fullscreen mode

The output displays the count of registered CRDs across Kubeflow and its components. A count of 40 or more indicates a complete installation.

Create Default User Profile

Kubeflow uses profiles to provide namespace-level isolation for each user. The default installation does not automatically provision a user namespace, so you need to create one manually.

1. Create a new file called user-profile.yaml:

$ nano user-profile.yaml
Enter fullscreen mode Exit fullscreen mode

2. Add the following configuration:

apiVersion: kubeflow.org/v1
kind: Profile
metadata:
  name: kubeflow-user-example-com
spec:
  owner:
    kind: User
    name: user@example.com
Enter fullscreen mode Exit fullscreen mode

Save and close the file.

3. Apply the profile manifest:

$ kubectl apply -f user-profile.yaml
Enter fullscreen mode Exit fullscreen mode

This command creates an isolated namespace called kubeflow-user-example-com with default Role-Based Access Control (RBAC) policies and a service account for the default user.

4. Verify that the namespace exists:

$ kubectl get namespace kubeflow-user-example-com
Enter fullscreen mode Exit fullscreen mode

5. Verify that the default service account exists:

The service account takes a few seconds to provision after the profile is created. Wait 10 seconds before running this command.

$ kubectl get serviceaccount default-editor -n kubeflow-user-example-com
Enter fullscreen mode Exit fullscreen mode

Configure Storage

Kubeflow components such as Notebooks, Pipelines, and the Model Registry require persistent storage. The cluster needs a default StorageClass to dynamically provision Persistent Volume Claims (PVCs).

1. Verify that a default StorageClass exists:

$ kubectl get storageclass
Enter fullscreen mode Exit fullscreen mode

The default StorageClass shows (default) next to its name. If no default exists, set one by annotating an existing StorageClass. Replace STORAGE-CLASS-NAME with the name of an existing StorageClass from the output above.

$ kubectl patch storageclass STORAGE-CLASS-NAME -p '{"metadata": {"annotations": {"storageclass.kubernetes.io/is-default-class": "true"}}}'
Enter fullscreen mode Exit fullscreen mode

Configure Kubeflow Notebooks

Kubeflow Notebooks provides managed JupyterLab, VS Code, and RStudio environments that run as Kubernetes pods with direct access to cluster resources, GPUs, and persistent storage. This component serves as a self-hosted alternative to Azure Machine Learning notebooks and compute instances.

Access Dashboard

Set up port forwarding and log in to the Kubeflow Central Dashboard.

1. Set up port forwarding to access the Kubeflow Central Dashboard:

$ kubectl port-forward svc/istio-ingressgateway -n istio-system 8080:80
Enter fullscreen mode Exit fullscreen mode
  1. Open http://localhost:8080 in a web browser. The Kubeflow login screen appears. Click Sign in with Dex.

Kubeflow Sign in with Dex

  1. Enter the default credentials on the Dex login form and click Login.
  • Email: user@example.com
  • Password: 12341234

Dex Login Form

  1. The Kubeflow Central Dashboard loads with links to Notebooks, Pipelines, Katib Experiments, KServe Endpoints, and other components. Select kubeflow-user-example-com from the namespace dropdown at the top.

Kubeflow Central Dashboard

Create Notebook Server

Launch a new notebook server from the Kubeflow dashboard.

  1. Navigate to Notebooks in the left sidebar and click New Notebook.
  2. Enter ml-workspace in the Name field.
  3. Select the notebook environment from the image cards. Choose JupyterLab for a general-purpose data science environment. Select VisualStudio Code for a code editor interface, or RStudio for R-based statistical computing. To use a specific image version, select Custom Notebook from the dropdown below the cards.
  4. Set Minimum CPU to 0.5 and Minimum Memory Gi to 1.
  5. Leave the Workspace Volume at the default 5Gi. This volume persists data across notebook restarts.
  6. Click Launch and wait for the notebook pod to reach a Running state. The status indicator turns green when the notebook is ready.

Connect to Notebook

Open the JupyterLab interface and verify that ML libraries are accessible.

  1. Click Connect next to the notebook server name. A new tab opens with the JupyterLab interface.

  2. Click Python 3 (ipykernel) under the Notebook section in the launcher to create a new notebook. Paste the following code into a cell and press Shift+Enter to run it.

   import numpy as np
   from sklearn.ensemble import RandomForestClassifier
   from sklearn.model_selection import train_test_split

   X = np.random.randn(1000, 10)
   y = (X[:, 0] + X[:, 1] > 0).astype(int)
   X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)

   model = RandomForestClassifier(n_estimators=100)
   model.fit(X_train, y_train)
   print(f"Accuracy: {model.score(X_test, y_test):.4f}")
Enter fullscreen mode Exit fullscreen mode

The cell outputs an accuracy score such as Accuracy: 0.9750.

Set Up Kubeflow Pipelines

Kubeflow Pipelines is a workflow orchestration platform for building, automating, and managing machine learning pipelines as Directed Acyclic Graphs (DAGs). Each step in a pipeline executes within its own containerized environment, improving reproducibility, portability, and experiment versioning across ML workflows. It acts as an open-source, self-hosted alternative to Azure Machine Learning pipelines and workflow orchestration features.

Deploy Sample Pipeline

Install the KFP SDK, define a three-step pipeline, compile it, and submit a run through the internal API. The following steps use both the notebook terminal and the cluster management terminal where specified.

  1. Inside JupyterLab, click File > New > Terminal to open a terminal tab.

2. Create the pipeline definition file:

$ nano sample_pipeline.py
Enter fullscreen mode Exit fullscreen mode

3. Add the following configuration:

from kfp import dsl, compiler

@dsl.component(base_image="python:3.11-slim")
def preprocess() -> str:
    import json
    data = {"samples": 1000, "features": 10, "status": "preprocessed"}
    return json.dumps(data)

@dsl.component(base_image="python:3.11-slim")
def train(input_data: str) -> str:
    import json
    data = json.loads(input_data)
    result = {"model": "random_forest", "accuracy": 0.95, "input": data}
    return json.dumps(result)

@dsl.component(base_image="python:3.11-slim")
def evaluate(input_data: str):
    import json
    result = json.loads(input_data)
    print(f"Model: {result['model']}, Accuracy: {result['accuracy']}")

@dsl.pipeline(name="sample-ml-pipeline")
def ml_pipeline():
    preprocess_task = preprocess()
    train_task = train(input_data=preprocess_task.output)
    evaluate(input_data=train_task.output)

compiler.Compiler().compile(ml_pipeline, "pipeline.yaml")
print("Pipeline compiled successfully")
Enter fullscreen mode Exit fullscreen mode

Save and close the file.

4. Compile the pipeline to generate the YAML definition:

$ python3 sample_pipeline.py
Enter fullscreen mode Exit fullscreen mode

5. Switch to the cluster management terminal and create the authorization policy manifest:

This policy allows the notebook namespace to call the Kubeflow Pipelines API through the Istio service mesh.

$ nano allow-pipeline-access.yaml
Enter fullscreen mode Exit fullscreen mode

6. Add the following configuration:

apiVersion: security.istio.io/v1beta1
kind: AuthorizationPolicy
metadata:
  name: allow-notebook-to-pipeline
  namespace: kubeflow
spec:
  selector:
    matchLabels:
      app: ml-pipeline
  rules:
  - from:
    - source:
        namespaces: ["kubeflow-user-example-com"]
Enter fullscreen mode Exit fullscreen mode

Save and close the file.

7. Apply the authorization policy:

$ kubectl apply -f allow-pipeline-access.yaml
Enter fullscreen mode Exit fullscreen mode

8. Switch to the notebook terminal and upload the compiled pipeline to Kubeflow Pipelines through the internal API:

$ curl -s -F "uploadfile=@pipeline.yaml" -H "kubeflow-userid: user@example.com" http://ml-pipeline.kubeflow.svc.cluster.local:8888/apis/v2beta1/pipelines/upload
Enter fullscreen mode Exit fullscreen mode

The command returns a JSON response that contains the pipeline_id. Note this value for the next step.

9. Create an experiment to organize pipeline runs:

$ curl -s -X POST -H "Content-Type: application/json" -H "kubeflow-userid: user@example.com" http://ml-pipeline.kubeflow.svc.cluster.local:8888/apis/v2beta1/experiments -d '{"display_name":"default","namespace":"kubeflow-user-example-com"}'
Enter fullscreen mode Exit fullscreen mode

The command returns a JSON response that contains the experiment_id. Note this value for the next step.

10. Start a pipeline run:

Replace PIPELINE-ID and EXPERIMENT-ID with the values from the previous steps.

$ curl -s -X POST -H "Content-Type: application/json" -H "kubeflow-userid: user@example.com" http://ml-pipeline.kubeflow.svc.cluster.local:8888/apis/v2beta1/runs -d '{"display_name":"test-run","experiment_id":"EXPERIMENT-ID","pipeline_version_reference":{"pipeline_id":"PIPELINE-ID"},"runtime_config":{}}'
Enter fullscreen mode Exit fullscreen mode

Monitor Execution

The pipeline run status is visible from the command line and from the Kubeflow dashboard. The dashboard provides a graph view that shows each step's completion state.

1. Verify that the workflow completed:

$ kubectl get workflows -n kubeflow-user-example-com
Enter fullscreen mode Exit fullscreen mode

Verify that the STATUS column shows Succeeded.

  1. Navigate to Pipelines in the left sidebar of the Kubeflow dashboard, then click Experiments. Click default, then click the test-run entry. The graph view shows the preprocess, train, and evaluate steps each marked with a green checkmark when the run completes successfully.

Pipeline Successful Run

Configure Distributed Training

Kubeflow Trainer v2 provides a unified TrainJob API for running distributed training jobs across frameworks including PyTorch, DeepSpeed, MLX, JAX, and XGBoost. The Trainer uses ClusterTrainingRuntime resources that define pre-configured runtime environments, which separates infrastructure configuration from training logic. Kubeflow Trainer replaces Azure ML Jobs with native Kubernetes-based distributed training.

Create Training Job

Create and deploy a distributed PyTorch training job that uses the torch-distributed runtime. Run the following commands from the cluster management terminal.

1. Create the TrainJob manifest:

$ nano trainjob.yaml
Enter fullscreen mode Exit fullscreen mode

2. Add the following configuration:

apiVersion: trainer.kubeflow.org/v1alpha1
kind: TrainJob
metadata:
  name: pytorch-training
  namespace: kubeflow-user-example-com
spec:
  runtimeRef:
    name: torch-distributed
  trainer:
    image: ghcr.io/kubeflow/katib/pytorch-mnist-cpu:v0.19.0
    numNodes: 2
    resourcesPerNode:
      requests:
        cpu: "500m"
        memory: "1Gi"
      limits:
        cpu: "1"
        memory: "2Gi"
Enter fullscreen mode Exit fullscreen mode

Save and close the file. The runtimeRef field references the torch-distributed ClusterTrainingRuntime, which configures the PyTorch distributed training environment. The numNodes field specifies the number of training nodes that Kubeflow provisions for the job.

3. Apply the training manifest:

$ kubectl apply -f trainjob.yaml
Enter fullscreen mode Exit fullscreen mode

Monitor Training

Check the training job status from the cluster management terminal.

1. Verify the TrainJob status:

$ kubectl get trainjob -n kubeflow-user-example-com
Enter fullscreen mode Exit fullscreen mode

The STATE column shows Complete when training finishes successfully.

Deploy Model Serving with KServe

KServe provides a Kubernetes CRD called InferenceService for deploying, scaling, and managing ML model endpoints. It supports serverless inference with autoscaling from zero, canary rollouts, and multi-model serving across frameworks including TensorFlow, PyTorch, scikit-learn, XGBoost, and ONNX. KServe also supports deploying models directly from Hugging Face Hub using the hf:// URI schema and from the Kubeflow Model Registry using the model-registry:// protocol. KServe is included in the Kubeflow installation and replaces Azure ML Endpoints.

Create InferenceService

Deploy a pre-trained scikit-learn model and expose it as a serving endpoint. Run the following commands from the cluster management terminal.

1. Create the model serving manifest:

$ nano sklearn-iris.yaml
Enter fullscreen mode Exit fullscreen mode

2. Add the following configuration:

apiVersion: serving.kserve.io/v1beta1
kind: InferenceService
metadata:
  name: sklearn-iris
  namespace: kubeflow-user-example-com
  annotations:
    sidecar.istio.io/inject: "false"
spec:
  predictor:
    model:
      modelFormat:
        name: sklearn
      storageUri: "gs://kfserving-examples/models/sklearn/1.0/model"
      resources:
        requests:
          cpu: 100m
          memory: 256Mi
        limits:
          cpu: "1"
          memory: 1Gi
Enter fullscreen mode Exit fullscreen mode

Save and close the file.

3. Apply the InferenceService manifest:

$ kubectl apply -f sklearn-iris.yaml
Enter fullscreen mode Exit fullscreen mode

4. Wait for the InferenceService to become ready:

$ kubectl get inferenceservice sklearn-iris -n kubeflow-user-example-com -w
Enter fullscreen mode Exit fullscreen mode

The READY column changes to True when the model is loaded and serving. Press Ctrl+C to stop watching. Navigate to KServe Endpoints in the Kubeflow dashboard sidebar to view the deployed model.

Test Model Endpoint

Send a test inference request to verify that the model is serving predictions.

1. Run the following command from the Kubeflow notebook terminal, which has direct access to the cluster-internal service endpoint:

$ curl -s --max-time 30 -H "Content-Type: application/json" http://sklearn-iris-predictor-00001-private.kubeflow-user-example-com.svc.cluster.local/v1/models/sklearn-iris:predict -d '{"instances": [[6.8, 2.8, 4.8, 1.4], [6.0, 3.4, 4.5, 1.6]]}'
Enter fullscreen mode Exit fullscreen mode

The response returns predicted class labels.

{"predictions": [1, 1]}
Enter fullscreen mode Exit fullscreen mode

Configure Hyperparameter Tuning

Katib is the Kubeflow component that provides automated hyperparameter tuning and neural architecture search. It supports multiple search algorithms including random search, grid search, Bayesian optimization, Tree-structured Parzen Estimator (TPE), and CMA Evolution Strategy. Katib replaces Azure ML Experiments and Automatic Model Tuning with a Kubernetes-native solution.

Create Tuning Experiment

Katib experiments are defined and submitted through the Katib Python SDK from a JupyterLab notebook cell. The SDK creates the experiment resource on the cluster and manages trial pod configuration and metrics collection automatically.

1. Open a terminal in JupyterLab by clicking File > New > Terminal and install the Katib Python SDK:

$ pip install kubeflow-katib
Enter fullscreen mode Exit fullscreen mode
  1. Close the terminal tab and create a new Python notebook by clicking File > New > Notebook, then selecting Python 3 (ipykernel) as the kernel. Run the following code in a cell to define an objective function and launch a tuning experiment.
   import kubeflow.katib as katib

   def objective(parameters):
       import time
       time.sleep(5)
       result = 4 * int(parameters["a"]) - float(parameters["b"]) ** 2
       print(f"result={result}")

   parameters = {
       "a": katib.search.int(min=10, max=20),
       "b": katib.search.double(min=0.1, max=0.2)
   }

   katib_client = katib.KatibClient(namespace="kubeflow-user-example-com")
   name = "tune-experiment"
   katib_client.tune(
       name=name,
       objective=objective,
       parameters=parameters,
       objective_metric_name="result",
       objective_type="maximize",
       algorithm_name="random",
       max_trial_count=4,
       parallel_trial_count=2,
       resources_per_trial={"cpu": "1", "memory": "1Gi"},
   )
Enter fullscreen mode Exit fullscreen mode

The tune() method creates a Katib experiment that runs 4 trials (2 in parallel) using random search. The cell output includes a Katib Experiment tune-experiment link here line. Click here to open the experiment directly in the Katib Experiments tab and monitor trial progress. The experiment status turns green when all trials complete.

  1. Retrieve the optimal hyperparameters by running the following code in the next cell.
   katib_client.wait_for_experiment_condition(name=name)
   print(katib_client.get_optimal_hyperparameters(name))
Enter fullscreen mode Exit fullscreen mode

Katib Experiment

Set Up Access Control

Kubeflow uses Dex as its OpenID Connect (OIDC) identity provider and Istio for network-level authorization. Each user gets an isolated namespace, which is called a profile, with its own resources, secrets, and RBAC policies.

Configure Authentication

The Dex ConfigMap uses hashFromEnv: DEX_USER_PASSWORD to read the password hash from an environment variable rather than storing it directly in the ConfigMap. To change the default password, update the Secret that provides this environment variable to the Dex pod.

1. Install the bcrypt Python package to generate a password hash:

$ pip install bcrypt
Enter fullscreen mode Exit fullscreen mode

2. Generate a bcrypt hash for the new password. Replace YOUR-SECURE-PASSWORD with the password you want to set:

$ python3 -c "import bcrypt; print(bcrypt.hashpw(b'YOUR-SECURE-PASSWORD', bcrypt.gensalt()).decode())"
Enter fullscreen mode Exit fullscreen mode

Copy the output hash for use in the next step.

3. Update the dex-passwords Secret with the new hash. Replace GENERATED-BCRYPT-HASH with the hash output from the previous step:

$ kubectl create secret generic dex-passwords -n auth \
    --from-literal=DEX_USER_PASSWORD='GENERATED-BCRYPT-HASH' \
    --dry-run=client -o yaml | kubectl apply -f -
Enter fullscreen mode Exit fullscreen mode

The command outputs a warning about a missing annotation. This is expected because dex-passwords was created by Kubeflow without --save-config. Verify that the output ends with secret/dex-passwords configured.

4. Restart the Dex deployment to apply the changes:

$ kubectl rollout restart deployment dex -n auth
Enter fullscreen mode Exit fullscreen mode
  1. To add additional static users or configure external identity providers such as Lightweight Directory Access Protocol (LDAP), GitHub, or Google, add entries to the staticPasswords list or connector entries in the Dex ConfigMap. See the Dex documentation for details.

Implement RBAC

Each additional user needs a profile that follows the same manifest structure as the default user profile. Replace the metadata.name and owner.name fields with the new user's details, then apply the manifest with kubectl apply -f.

To give an existing user access to another user's namespace without creating a separate profile, navigate to the target namespace in the Kubeflow dashboard namespace dropdown. Click Manage Contributors in the left sidebar and enter the user's email address.

Integrate Object Storage

ML workflows generate large artifacts including trained models, pipeline outputs, datasets, and logs. Kubeflow uses SeaweedFS as its default S3-compatible object storage backend for artifact persistence. KServe also supports S3-compatible storage for loading model artifacts.

Configure Storage Backend

The default Kubeflow installation deploys SeaweedFS in the kubeflow namespace with pre-configured credentials. Verify that the storage deployment is running.

1. Check the SeaweedFS pod status:

$ kubectl get pods -n kubeflow -l app=seaweedfs
Enter fullscreen mode Exit fullscreen mode

2. For production deployments, replace SeaweedFS with an external S3-compatible object storage service:

Replace YOUR-ACCESS-KEY and YOUR-SECRET-KEY with the access key and secret key for your storage service, then update the mlpipeline-minio-artifact secret with the new credentials.

$ kubectl create secret generic mlpipeline-minio-artifact -n kubeflow --from-literal=accesskey=YOUR-ACCESS-KEY --from-literal=secretkey=YOUR-SECRET-KEY --dry-run=client -o yaml | kubectl apply -f -
Enter fullscreen mode Exit fullscreen mode

Test Storage Integration

Configure KServe to access SeaweedFS for loading model artifacts stored in the cluster.

1. Create a storage secret for KServe model storage:

$ nano s3-storage-secret.yaml
Enter fullscreen mode Exit fullscreen mode

2. Add the following configuration. Replace ACCESS-KEY and SECRET-ACCESS-KEY with any strong keyword:

apiVersion: v1
kind: Secret
metadata:
  name: s3-storage-secret
  namespace: kubeflow-user-example-com
  annotations:
    serving.kserve.io/s3-endpoint: "seaweedfs.kubeflow:8333"
    serving.kserve.io/s3-usehttps: "0"
type: Opaque
stringData:
  AWS_ACCESS_KEY_ID: "ACCESS-KEY"
  AWS_SECRET_ACCESS_KEY: "SECRET-ACCESS-KEY"
Enter fullscreen mode Exit fullscreen mode

Save and close the file.

3. Apply the storage secret:

$ kubectl apply -f s3-storage-secret.yaml
Enter fullscreen mode Exit fullscreen mode

Migration from Azure Machine Learning

Migrating from Azure ML to Kubeflow involves exporting existing assets and mapping each Azure ML component to its Kubeflow equivalent. Notebooks transfer without format changes since both platforms use the standard Jupyter notebook format. Training scripts, pipelines, and experiments require rewriting to replace Azure ML SDK calls with Kubeflow and KFP SDK equivalents.

  1. Export Notebooks: Download Azure ML Studio notebooks as .ipynb files from the console or by using the Azure CLI. Upload them directly to Kubeflow Notebook servers, since both platforms use standard Jupyter notebook format. Update any azure.ai.ml SDK calls that rely on Azure ML-specific APIs.

  2. Convert Training Scripts: Azure ML training scripts that use azure.ai.ml SDK job and command patterns such as command(...), MLClient(...), ScriptRunConfig(...), or framework-specific job configurations need to be converted into standard framework training scripts for Kubernetes-based execution. Replace Azure ML-specific environment variables, datastore mounts, and output paths such as AZUREML_MODEL_DIR, ./outputs, and Azure ML input/output bindings with Kubernetes volume mount paths. Package the training code into container images and reference them in TrainJob manifests.

  3. Migrate Pipelines: Azure ML Pipelines are defined using the azure.ai.ml SDK and need rewriting with the KFP SDK. Azure ML Pipelines use Python-based DAG definitions via the azure.ai.ml SDK; replace it with KFP's @dsl.pipeline decorated functions.

  4. Export Models: Download trained model artifacts from Azure Machine Learning model registries, datastores, or blob storage using the Azure CLI or azure.ai.ml SDK. Upload them to the object storage backend connected to Kubeflow and update the storageUri field in KServe InferenceService manifests to reference the new storage location. KServe supports the same model formats commonly used in Azure ML deployments, including TensorFlow SavedModel, TorchScript, ONNX, and scikit-learn pickle models, without requiring additional conversion.

  5. Migrate Experiments: Export Azure ML experiment tracking data using the MLflow SDK's mlflow.artifacts.download_artifacts() API call. For hyperparameter tuning, recreate tuning jobs as Katib experiments with equivalent search spaces and objective metrics using the Katib Python SDK.

Next Steps

  • Configure GPU scheduling for notebooks and training jobs that need accelerated compute
  • Set up multi-tenancy with additional user profiles and namespace-level resource quotas
  • Harden the deployment for production, including TLS termination, network policies, and backup of the object storage backend
  • Explore additional Katib search algorithms and KServe canary rollout strategies for safer model updates

For the full guide with additional tips, visit the original article on Vultr Docs.

Top comments (0)