<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Zeeshan Dar on Medium]]></title>
        <description><![CDATA[Stories by Zeeshan Dar on Medium]]></description>
        <link>https://medium.com/@zeeshan.dar?source=rss-763c86f3788e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*olTFldHJUzTg5DsCBz9-eQ.png</url>
            <title>Stories by Zeeshan Dar on Medium</title>
            <link>https://medium.com/@zeeshan.dar?source=rss-763c86f3788e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 05:36:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@zeeshan.dar/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Kubeflow deployment on Azure (AKS), the Proper Way]]></title>
            <link>https://blog.devgenius.io/kubeflow-deployment-on-azure-aks-the-proper-way-9a35d0f36f75?source=rss-763c86f3788e------2</link>
            <guid isPermaLink="false">https://medium.com/p/9a35d0f36f75</guid>
            <category><![CDATA[azure-kubernetes-service]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[kubeflow]]></category>
            <dc:creator><![CDATA[Zeeshan Dar]]></dc:creator>
            <pubDate>Wed, 29 Dec 2021 12:29:55 GMT</pubDate>
            <atom:updated>2021-12-29T15:20:24.350Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/317/1*mgyMtNujkAD0f6NQlY6Hnw.png" /></figure><p>Kubeflow is becoming the standard for building and deploying Machine Learning pipelines. Many companies are shifting their focus towards this because it makes it easier for teams to deploy ML workflows on Kubernetes. However, as of now, in 2022(well almost!) when I followed the official instructions I was left with a non-functioning pipeline feature in kubeflow. It took a lot of research and experimentation to have a fully working workflow that I wanted to share.</p><p>This tutorial does not provide an introduction to Kubeflow/kubernetes, rather the focus is on how you can properly deploy Kubeflow on AKS and get the pipeline in a working condition.</p><h3>Pre-requisites:</h3><p>This tutorial assumes the following:</p><ol><li>Basic knowledge of <strong>kubeflow</strong>, <strong>kubernetes</strong> etc.</li><li>Have already installed the following packages: <a href="https://kubernetes.io/docs/tasks/tools/#install-kubectl-on-linux"><strong>kubectl</strong></a><strong>, </strong><a href="https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest"><strong>Azure command line(Az)</strong></a>.</li></ol><h3>Steps for the deployment:</h3><h3>1. Azure Login</h3><p>Open up the terminal in the linux/mac and enter the following commands to login to Azure. Make sure you are in the right subscription.</p><pre>az login<br>az account set --subscription id_of_my_subscription</pre><h3>2. Create a resource group</h3><pre>az group create -n kubeflowdep -l westeurope</pre><h3>3. Create a specifically defined cluster</h3><pre>az aks create -g kubeflowdep -n KubeCluster -s Standard_D4s_v3 -c 2 -l westeurope --generate-ssh-keys</pre><h3>4. Kubeflow installation</h3><p>Run the following commands to set up and deploy Kubeflow.</p><ol><li>Create user credentials. You only need to run this command once.</li></ol><p>az aks get-credentials -n KubeCluster -g kubeflowdep</p><p>2. Download the kfctl v1.2.0 release from the <a href="https://github.com/kubeflow/kfctl/releases/tag/v1.2.0">Kubeflow releases page</a>.</p><p>3. Unpack the tar ball:</p><p>tar -xvf kfctl_v1.2.0_&lt;platform&gt;.tar.gz</p><h3>5. Kubeflow Deployment</h3><p>Run the following commands to set up and deploy Kubeflow. The code below includes an optional command to add the binary kfctl to your path. If you don’t add the binary to your path, you must use the full path to the kfctl binary each time you run it.</p><pre># The following command is optional. It adds the kfctl binary to your path.<br># If you don&#39;t add kfctl to your path, you must use the full path<br># each time you run kfctl.<br># Use only alphanumeric characters or - in the directory name.<br>export PATH=$PATH:&quot;&lt;path-to-kfctl&gt;&quot;<br><br># Set KF_NAME to the name of your Kubeflow deployment. You also use this<br># value as directory name when creating your configuration directory.<br># For example, your deployment name can be &#39;my-kubeflow&#39; or &#39;kf-test&#39;.<br>export KF_NAME=&lt;your choice of name for the Kubeflow deployment&gt;<br><br># Set the path to the base directory where you want to store one or more <br># Kubeflow deployments. For example, /opt/.<br># Then set the Kubeflow application directory for this deployment.<br>export BASE_DIR=&lt;path to a base directory&gt;<br>export KF_DIR=${BASE_DIR}/${KF_NAME}<br><br># Set the configuration file to use when deploying Kubeflow.<br># The following configuration installs Istio by default. Comment out <br># the Istio components in the config file to skip Istio installation. <br># See https://github.com/kubeflow/kubeflow/pull/3663<br>export CONFIG_URI=&quot;https://raw.githubusercontent.com/kubeflow/manifests/v1.2-branch/kfdef/kfctl_k8s_istio.v1.2.0.yaml&quot;<br><br>mkdir -p ${KF_DIR}<br>cd ${KF_DIR}<br>kfctl apply -V -f ${CONFIG_URI}</pre><ol><li>Run this command to check that the resources have been deployed correctly in namespace kubeflow:</li></ol><p>kubectl get all -n kubeflow</p><p>2. Open the Kubeflow Dashboard. The default installation does not create an external endpoint but you can use port-forwarding to visit your cluster. Run the following command:</p><p>kubectl port-forward svc/istio-ingressgateway -n istio-system 8080:80</p><p>3. Next, open http://localhost:8080 in your browser.</p><p>All the above steps are taken directly from the official documentation with minor modifications. Now, when you see the Kubeflow dashboard in the browser and go to pipelines you will come across an error as mentioned in the image below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*honMO78fTm1BqEA-BC8jvg.png" /></figure><p>This means that the pipelines for kubeflow weren’t properly deployed. The reason for that is istio-pods are not being injected to the pods in kubeflow.</p><h3>6. Workaround:</h3><p>The most simple workaround is to disable the <strong>tls.mode</strong>, which can be done by modifying the destination rules for both <strong>ml-pipeline</strong> and <strong>ml-pipeline-ui</strong>. We can do that<strong> </strong>by editing <strong>ml-pipeline</strong> and <strong>ml-pipeline-ui </strong>and changing the <strong>tls.mode</strong> from <strong>ISTIO_MUTUAL</strong> to <strong>DISABLE</strong>. To edit the files, run the following commands.</p><p>kubectl edit destinationrule -n kubeflow ml-pipeline</p><p>kubectl edit destinationrule -n kubeflow ml-pipeline-ui</p><ul><li>If you run the port forwarding command again</li></ul><p>kubectl port-forward svc/istio-ingressgateway -n istio-system 8080:80</p><ul><li>Visit <a href="http://localhost:8080/">http://localhost:8080</a> and you can see the pipelines working in the kubeflow UI.</li></ul><p>The second workaround is by explicitly enabling the istio-injection. We can do this by modifying the yaml file in the deployment step before applying the deployment. Go to the link <a href="https://raw.githubusercontent.com/kubeflow/manifests/v1.2-branch/kfdef/kfctl_k8s_istio.v1.2.0.yaml">https://raw.githubusercontent.com/kubeflow/manifests/v1.2-branch/kfdef/kfctl_k8s_istio.v1.2.0.yaml</a> and download this file. Modify this file by explicitly mentioning the labels defined below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/46ad5d39310ac3b9fa762c02fa0fbbfd/href">https://medium.com/media/46ad5d39310ac3b9fa762c02fa0fbbfd/href</a></iframe><p><strong>Note: You only need to add the labels and don’t need to remove any resources from the yaml file you are updating.</strong></p><p>After modifying you need to redeploy all the resources again:</p><pre>kfctl apply -V -f path/to/file/kfctl_k8s_istio.v1.2.0.yaml</pre><p>Any of the above two solutions resolves the kubeflow pipelining issue but when you try to run one of the example pipelines, it goes into a pending state. It doesn’t show any error logs in the dashboard but you can view the logs for a kubernetes namespace by:</p><pre>kubectl get events -n kubeflow --sort-by=&#39;.metadata.creationTimestamp&#39;</pre><p>If you go through the logs, you will come across the following error:</p><pre>Unable to mount volumes for pod &quot;pod-name&quot; timeout expired waiting for volumes to attach or mount for pod</pre><p>The error shows that the pod is unable to mount volumes. By default, the runtime container for kubernetes cluster is docker. As Kubeflow pipelines is built on top of Argo and the workflow-executor for the docker is <a href="https://argoproj.github.io/argo-workflows/workflow-executors/">deprecated</a> in Argo, that causes mounting issues in the newer versions of kubeflow.</p><p>To remedy this situations, we can switch the workflow-executors from docker to other executors. There are a lot of options to select from but I chose <strong>Process Namespace Sharing (pns)</strong> because it’s scalable, well-tested and secure. There are pros and cons to each option but based on the comparison, pns seems like a viable option. You can see the comparison here: <a href="https://argoproj.github.io/argo-workflows/workflow-executors/">https://argoproj.github.io/argo-workflows/workflow-executors/</a>. To switch from docker to pns or any other workflow executor, you have to edit the workflow-controller-configmap by entering the following command:</p><pre>kubectl edit configmap workflow-controller-configmap -n kubeflow </pre><p>and changing the containerRuntimeExecutor: from <strong>docker</strong> to <strong>pns</strong>. After applying this change you can run the following command again:</p><pre>kubectl port-forward svc/istio-ingressgateway -n istio-system 8080:80 </pre><p>If you open http://localhost:8080 in your browser now, you can try running one of the example pipelines and it should work as expected. This is it for the deployment. I hope this post helps someone in deploying kubeflow to AKS.</p><h3>References:</h3><ul><li><a href="https://www.kubeflow.org/docs/distributions/azure/deploy/install-kubeflow/">Install Kubeflow</a></li><li><a href="https://github.com/kubeflow/pipelines/issues/3407">Pipelines pods FailedMount · Issue #3407 · kubeflow/pipelines</a></li><li><a href="https://github.com/kubeflow/kubeflow/issues/5277">Pipelines upstream connect error or disconnect/reset before headers. reset reason: connection failure · Issue #5277 · kubeflow/kubeflow</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9a35d0f36f75" width="1" height="1" alt=""><hr><p><a href="https://blog.devgenius.io/kubeflow-deployment-on-azure-aks-the-proper-way-9a35d0f36f75">Kubeflow deployment on Azure (AKS), the Proper Way</a> was originally published in <a href="https://blog.devgenius.io/">Dev Genius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>