<p>If I understand the documentation here correctly...</p>
<p><a href="https://skaffold.dev/docs/workflows/debug/#java-and-other-jvm-languages" rel="nofollow noreferrer">Skaffold Debug</a></p>
<p>If I try to run K8s Project with 'skaffold debug' or with IntelliJ 'Develop on Kubernetes' and Debug, skaffold must insert in my k8s deployment/service files extra port for jdwp and Environment Variable with JAVA_TOOL_OPTIONS. Which is not happening for me.</p>
<p>I am using a Helm Chart to deploy my k8s artifacts and I don't see anywhere that these things are configured (as it also mentioned here <a href="https://github.com/GoogleCloudPlatform/cloud-code-intellij/issues/2912" rel="nofollow noreferrer">GitHub Issue</a>).</p>
<p>If I configure my deployment\service yamls manually, to insert port 5005 for jdwp and environment variable JAVA_TOOL_OPTIONS for jdwp and port forward 5005 then I can remotely attach to process and debug, but skaffold is not able to manage it by itself (It is not even trying, I see no JAVA_TOOL_OPTIONS in my logs).</p>
<p>May be, it does not understand that I am running a JVM project or may be, while I created with my Helm Project with 'helm create' and there are several yaml files (configmap.yaml, deployment.yaml, hpa.yaml, ingress.yaml, service.yaml, serviceaccount.yaml) it is not able to find correct file to manipulate.</p>
<p>If I also understand correctly, the deployment/pod that would be debugged must have following annotations:</p>
<p><a href="https://skaffold.dev/docs/workflows/debug/#workload-annotations" rel="nofollow noreferrer">Annotations</a></p>
<blockquote>
<p>debug.cloud.google.com/config</p>
</blockquote>
<p>which are missing completely, only thing I see on deployment is the following -</p>
<pre><code>ide: idea
ideVersion: 2021.1.1.0.0
ijPluginVersion: unknown
skaffold.dev/run-id: d2420cca-f212-4349-b078-41f36ed51bd5
</code></pre>
<p>Any idea what is going wrong here?</p>
<p>Actually, deployment functioning correctly and my Pod reports Ok for Readyness check but no debugging starting from skaffold/intellij.</p>

posthumecaver
<p>There were some mismatches between the @posthumecaver's Helm chart and the <code>skaffold.yaml</code> that prevented Skaffold from configuring the image.  I'll summarize the findings here for the benefit of those who stumble across this post.</p>
<p>@posthumecaver is using Skaffold's Helm support.  This requires that the <code>skaffold.yaml</code> and the Helm chart use a common key for referencing the image.  There are three approaches used in Helm for referencing images:</p>
<h3>Fully-Qualified Name (default)</h3>
<p>Skaffold will configure Helm setting a key to the fully-tagged image reference.</p>
<p>The <code>skaffold.yaml</code> setup:</p>
<pre><code>build:
  artifacts:
    - image: gcr.io/my-project/my-image
deploy:
  helm:
    releases:
      - name: my-chart
        chartPath: helm
        artifactOverrides:
          img: gcr.io/my-project/my-image
</code></pre>
<p>The chart template:</p>
<pre><code>image: &quot;{{.Values.img}}&quot;
</code></pre>
<p>The <code>values.yaml</code> (note that Skaffold overrides this value):</p>
<pre><code>img: gcr.io/other-project/other-image:latest
</code></pre>
<p>Skaffold will invoke</p>
<pre><code>helm install &lt;chart&gt; &lt;chart-path&gt; --set-string img=gcr.io/my-project/my-image:generatedTag@sha256:digest
</code></pre>
<h3>Split Repository and Tag</h3>
<p>Skaffold can be configured to provide Helm with a separate repository and tag.  The key used in the <code>artifactOverrides</code> is used as base portion producing two keys <code>{key}.repository</code> and <code>{key}.tag</code>.</p>
<p>The <code>skaffold.yaml</code> setup:</p>
<pre><code>build:
  artifacts:
    - image: gcr.io/my-project/my-image
deploy:
  helm:
    releases:
      - name: my-chart
        chartPath: helm
        artifactOverrides:
          img: gcr.io/my-project/my-image
        imageStrategy:
          helm: {}
</code></pre>
<p>The chart template:</p>
<pre><code>image: &quot;{{.Values.img.repository}}:{{.Values.img.tag}}&quot;
</code></pre>
<p>The <code>values.yaml</code> (note that Skaffold overrides these value):</p>
<pre><code>img:
  repository: gcr.io/other-project/other-image
  tag: latest
</code></pre>
<p>Skaffold will invoke</p>
<pre><code>helm install &lt;chart&gt; &lt;chart-path&gt; --set-string img.repository=gcr.io/my-project/my-image,img.tag=generatedTag@sha256:digest
</code></pre>
<h3>Split Registry, Repository, and Tag</h3>
<p>Skaffold can also be configured to provide Helm with a separate repository and tag.  The key used in the <code>artifactOverrides</code> is used as base portion producing three keys: <code>{key}.registry</code>, <code>{key}.repository</code>, and <code>{key}.tag</code>.</p>
<p>The <code>skaffold.yaml</code> setup:</p>
<pre><code>build:
  artifacts:
    - image: gcr.io/my-project/my-image
deploy:
  helm:
    releases:
      - name: my-chart
        chartPath: helm
        artifactOverrides:
          img: gcr.io/my-project/my-image
        imageStrategy:
          helm:
            explicitRegistry: true
</code></pre>
<p>The chart template:</p>
<pre><code>image: &quot;{{.Values.img.registry}}/{{.Values.img.repository}}:{{.Values.img.tag}}&quot;
</code></pre>
<p>The <code>values.yaml</code> (note that Skaffold overrides these value):</p>
<pre><code>img:
  registry: gcr.io
  repository: other-project/other-image
  tag: latest
</code></pre>
<p>Skaffold will invoke</p>
<pre><code>helm install &lt;chart&gt; &lt;chart-path&gt; --set-string img.registry=gcr.io,img.repository=my-project/my-image,img.tag=generatedTag@sha256:digest
</code></pre>
