<p>I have my own Python module (an '.so' file that I'm able to import locally) that I want to make available to my application running in Kubernetes. I am wholly unfamiliar with Kubernetes and Helm, and the documentation and attempts I've made so far haven't gotten me anywhere. </p>

<p>I looked into <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/" rel="nofollow noreferrer">ConfigMaps</a>, trying <code>kubectl.exe create configmap mymodule --from-file=MyModule.so</code>, but kubectl says "Request entity too large: limit is 3145728". (My binary file is ~6mb.) I don't know if this is even the appropriate way to get my file there. I've also looked at <a href="https://helm.sh/docs/topics/charts/" rel="nofollow noreferrer">Helm Charts</a>, but I see nothing about how to package up a file to upload. Helm Charts look more like a way to configure deployment of existing services.</p>

<p>What's the appropriate way to package up my file, upload it, and use it within my application (ensuring that Python will be able to <code>import MyModule</code> successfully when running in my AKS cluster)?</p>

user655321
<p>The python module should be added to the <a href="https://kubernetes.io/docs/concepts/containers/" rel="nofollow noreferrer">container image</a> that runs in Kubernetes, not to Kubernetes itself.  </p>

<p>The current container image running in Kubernetes has a build process, usually  controlled by a <code>Dockerfile</code>. That container image is then published to an image repository where the container runtime in Kubernetes can pull the image in from and run the container.</p>

<p>If you don't currently build this container, you may need to create your own build process to add the python module to the existing container. In a <code>Dockerfile</code> you use the <code>FROM old/image:1.7.1</code> and then add your content.</p>

<pre><code>FROM old/image:1.7.1
COPY MyModule.so /app/
</code></pre>

<p>Publish the new container image to an ECR (<a href="https://docs.aws.amazon.com/AmazonECR/latest/userguide/what-is-ecr.html" rel="nofollow noreferrer">Elastic Container Registry</a>) so it is available for use in your AKS cluster. </p>

<p>The only change you might need to make in Kubernetes then is to set the <code>image</code> for the deployment to the newly published image. </p>

<p>Here is a <a href="https://opensource.com/article/18/1/running-python-application-kubernetes" rel="nofollow noreferrer">simple end to end guide</a> for a python application. </p>
