<p>There is this example project on <a href="https://github.com/asynkron/protoactor-grains-tutorial" rel="nofollow noreferrer">GitHub</a> that I'm trying to deploy on local Kubernetes cluster (k3d). The developers of Proto.Actor described the k8s deployment pretty much here in the <a href="https://proto.actor/docs/cluster/getting-started-kubernetes/" rel="nofollow noreferrer">official docs</a>. The problem is that the documentation is deploying on Azure Kubernetes Service whereas I want to deploy on local k8s cluster (k3d).</p>
<p>As much as I understand the steps, it's as following:</p>
<ol>
<li>Build docker images for both projects in the solution [I was able to do that step]</li>
</ol>
<pre><code>docker build -f ./ProtoClusterTutorial/Dockerfile . -t proto-cluster-tutorial:1.0.0`
docker build -f ./SmartBulbSimulatorApp/Dockerfile . -t smart-bulb-simulator-app:1.0.0`
</code></pre>
<ol start="2">
<li>Push the docker images into a repository</li>
</ol>
<p>Push the docker images where? Local k3d repository? Docker Hub? GitHub Container Registry?</p>
<p>Next question, the file <code>values.yaml</code> in the Helm chart directory consists of a <code>repository</code> field (<a href="https://github.com/asynkron/protoactor-grains-tutorial/blob/main/chart-tutorial/values.yaml#L5" rel="nofollow noreferrer">here</a>). If I push the docker image to ghcr or Docker hub, I'll just put the image link there, but what if I have to use the k3d local repository? What link should I use in that case?</p>
<p>The next question is how does <code>kubectl get pods</code> know that it has to display the k3d cluster pods and not the Docker Desktop Kubernetes which I have enabled?</p>
<p>I would be grateful if you briefly list the steps that I have to accomplish using k3d, Helm chart and kubectl.</p>

<p>It doesn't matter where you push your images to, as long as it's a valid implementation of the <a href="https://github.com/opencontainers/distribution-spec" rel="nofollow noreferrer">OCI Distribution Spec</a> (a valid container registry). All the registry options you've listed would work, just pick the one that fits your needs.</p>
<p>Regarding the <code>values.yaml</code> file, the <code>repository</code> field is the url to the repository, depending on which container registry you decide to use (<code>docker.io</code> for Docker Hub, <code>ghcr.io</code> for Github Container Registry, etc.) Please check the docs of the container registry you choose for specific instructions of setting up repositories, building, pushing and pulling.</p>
<p><code>kubectl</code> gets it's configuration from a config file, which can contain multiple clusters. The k3d install script is most likely adding the new cluster as an entry to the config file and setting it as the new context for kubectl.</p>
<p>Back to your problem. A simpler solution might be to import the images in k3d manually as noted <a href="https://stackoverflow.com/a/72120733/13415624">in this answer</a>. I haven't used k3d myself so I can't guarantee this method will work, but it seems like a much simpler approach that can save you a lot of headache.</p>
<p>In case, however, you want to get your hands dirty and learn more about container repositories, helm and k8s, here's an example scenario with a repository hosted on <code>localhost:5000</code> and I strongly encourage you to check the relevant <code>docker/helm/kubernetes</code> docs for each step</p>
<ol>
<li>Login to your registry</li>
</ol>
<pre><code>docker login localhost:5000
</code></pre>
<ol start="2">
<li>Build the images</li>
</ol>
<pre><code>//Note how the image tag includes the repository url where they'll be pushed to
docker build -f ./ProtoClusterTutorial/Dockerfile . -t localhost:5000/proto-cluster-tutorial:1.0.0
docker build -f ./SmartBulbSimulatorApp/Dockerfile . -t localhost:5000/smart-bulb-simulator-app:1.0.0
</code></pre>
<ol start="3">
<li>Push the images</li>
</ol>
<pre><code>docker push localhost:5000/proto-cluster-tutorial:1.0.0
docker push localhost:5000/smart-bulb-simulator-app:1.0.0
</code></pre>
<ol start="4">
<li>Edit the <code>values.yaml</code></li>
</ol>
<pre><code>  image:
    repository: localhost:5000/proto-cluster-tutorial
    pullPolicy: IfNotPresent
    tag: &quot;1.0.0&quot;
</code></pre>
<ol start="5">
<li>Run <code>helm install</code> with the modified <code>values.yaml</code> file</li>
</ol>
<p>One thing I've noticed is that guide's helm chart does not include a field for <code>imagePullSecrets</code> since they are using Azure Container Registry and hosting the cluster on Azure which handles the authentication automatically. This means that private repositories will not work with the chart in your scenario and you'll have to edit the helm chart and subsequently the <code>values.yaml</code> to make it work. You can read more about <code>imagePullSecrets</code> <a href="https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/" rel="nofollow noreferrer">here</a></p>
