<p>Kubernetes newbie here.</p>
<p>I have some strange Skaffold/Kubernetes behavior. I'm working in Google Cloud but I've changed to the local environment just for test and it's the same. So probably it's me how's doing something wrong. The problem is that though I see Skaffold syncing changes these changes aren't reflected. All the files inside the pods are the old ones.</p>
<p>Skaffold.yaml:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: skaffold/v2alpha3
kind: Config
deploy:
  kubectl:
    manifests:
      - ./infra/k8s/*
build:
  # local:
  #   push: false
  googleCloudBuild:
    projectId: ts-maps-286111
  artifacts:
    - image: us.gcr.io/ts-maps-286111/auth
      context: auth
      docker:
        dockerfile: Dockerfile
      sync:
        manual:
          - src: 'src/**/*.ts'
            dest: .
    - image: us.gcr.io/ts-maps-286111/client
      context: client
      docker:
        dockerfile: Dockerfile
      sync:
        manual:
          - src: '**/*.js'
            dest: .
    - image: us.gcr.io/ts-maps-286111/tickets
      context: tickets
      docker:
        dockerfile: Dockerfile
      sync:
        manual:
          - src: 'src/**/*.ts'
            dest: .
    - image: us.gcr.io/ts-maps-286111/orders
      context: orders
      docker:
        dockerfile: Dockerfile
      sync:
        manual:
          - src: 'src/**/*.ts'
            dest: .
    - image: us.gcr.io/ts-maps-286111/expiration
      context: expiration
      docker:
        dockerfile: Dockerfile
      sync:
        manual:
          - src: 'src/**/*.ts'
            dest: .
</code></pre>
<p>When a file inside one of the directories is changed I see following logs:</p>
<pre class="lang-sh prettyprint-override"><code>time=&quot;2020-09-05T01:24:06+03:00&quot; level=debug msg=&quot;Change detected notify.Write: \&quot;F:\\projects\\lrn_microservices\\complex\\expiration\\src\\index.ts\&quot;&quot;
time=&quot;2020-09-05T01:24:06+03:00&quot; level=debug msg=&quot;Change detected notify.Write: \&quot;F:\\projects\\lrn_microservices\\complex\\expiration\\src\\index.ts\&quot;&quot;
time=&quot;2020-09-05T01:24:06+03:00&quot; level=debug msg=&quot;Change detected notify.Write: \&quot;F:\\projects\\lrn_microservices\\complex\\expiration\\src\\index.ts\&quot;&quot;
time=&quot;2020-09-05T01:24:06+03:00&quot; level=debug msg=&quot;Change detected notify.Write: \&quot;F:\\projects\\lrn_microservices\\complex\\expiration\\src\\index.ts\&quot;&quot;
time=&quot;2020-09-05T01:24:06+03:00&quot; level=debug msg=&quot;Change detected notify.Write: \&quot;F:\\projects\\lrn_microservices\\complex\\expiration\\src\\index.ts\&quot;&quot;
time=&quot;2020-09-05T01:24:06+03:00&quot; level=debug msg=&quot;Change detected notify.Write: \&quot;F:\\projects\\lrn_microservices\\complex\\expiration\\src\\index.ts\&quot;&quot;
time=&quot;2020-09-05T01:24:07+03:00&quot; level=debug msg=&quot;Found dependencies for dockerfile: [{package.json /app true} {. /app true}]&quot;
time=&quot;2020-09-05T01:24:07+03:00&quot; level=debug msg=&quot;Skipping excluded path: node_modules&quot;
time=&quot;2020-09-05T01:24:07+03:00&quot; level=debug msg=&quot;Found dependencies for dockerfile: [{package.json /app true} {. /app true}]&quot;
time=&quot;2020-09-05T01:24:07+03:00&quot; level=debug msg=&quot;Skipping excluded path: .next&quot;
time=&quot;2020-09-05T01:24:07+03:00&quot; level=debug msg=&quot;Skipping excluded path: node_modules&quot;
time=&quot;2020-09-05T01:24:07+03:00&quot; level=debug msg=&quot;Found dependencies for dockerfile: [{package.json /app true} {. /app true}]&quot;
time=&quot;2020-09-05T01:24:07+03:00&quot; level=debug msg=&quot;Skipping excluded path: node_modules&quot;
time=&quot;2020-09-05T01:24:07+03:00&quot; level=debug msg=&quot;Found dependencies for dockerfile: [{package.json /app true} {. /app true}]&quot;
time=&quot;2020-09-05T01:24:07+03:00&quot; level=debug msg=&quot;Skipping excluded path: node_modules&quot;
time=&quot;2020-09-05T01:24:07+03:00&quot; level=debug msg=&quot;Found dependencies for dockerfile: [{package.json /app true} {. /app true}]&quot;
time=&quot;2020-09-05T01:24:07+03:00&quot; level=debug msg=&quot;Skipping excluded path: node_modules&quot;
time=&quot;2020-09-05T01:24:07+03:00&quot; level=info msg=&quot;files modified: [expiration\\src\\index.ts]&quot;
Syncing 1 files for us.gcr.io/ts-maps-286111/expiration:2aae7ff-dirty@sha256:2e31caedf3d9b2bcb2ea5693f8e22478a9d6caa21d1a478df5ff8ebcf562573e
time=&quot;2020-09-05T01:24:07+03:00&quot; level=info msg=&quot;Copying files: map[expiration\\src\\index.ts:[/app/src/index.ts]] to us.gcr.io/ts-maps-286111/expiration:2aae7ff-dirty@sha256:2e31caedf3d9b2bcb2ea5693f8e22478a9d6caa21d1a478df5ff8ebcf562573e&quot;
time=&quot;2020-09-05T01:24:07+03:00&quot; level=debug msg=&quot;getting client config for kubeContext: ``&quot;
time=&quot;2020-09-05T01:24:07+03:00&quot; level=debug msg=&quot;Running command: [kubectl --context gke_ts-maps-286111_europe-west3-a_ticketing-dev exec expiration-depl-5cb997d597-p49lv --namespace default -c expiration -i -- tar xmf - -C / --no-same-owner]&quot;
time=&quot;2020-09-05T01:24:09+03:00&quot; level=debug msg=&quot;Command output: [], stderr: tar: removing leading '/' from member names\n&quot;
Watching for changes...
time=&quot;2020-09-05T01:24:11+03:00&quot; level=info msg=&quot;Streaming logs from pod: expiration-depl-5cb997d597-p49lv container: expiration&quot;
time=&quot;2020-09-05T01:24:11+03:00&quot; level=debug msg=&quot;Running command: [kubectl --context gke_ts-maps-286111_europe-west3-a_ticketing-dev logs --since=114s -f expiration-depl-5cb997d597-p49lv -c expiration --namespace default]&quot;
[expiration]
[expiration] &gt; expiration@1.0.0 start /app
[expiration] &gt; ts-node-dev --watch src src/index.ts
[expiration]
[expiration] ts-node-dev ver. 1.0.0-pre.62 (using ts-node ver. 8.10.2, typescript ver. 3.9.7)
[expiration] starting expiration!kdd
[expiration] Connected to NATS!
</code></pre>
<p>NodeJS server inside the pod restarts. Sometimes I see this line, sometimes not, the result overall is the same</p>
<pre class="lang-sh prettyprint-override"><code>[expiration] [INFO] 22:23:42 Restarting: src/index.ts has been modified
</code></pre>
<p>But there are no changes made. If I cat the changed file inside a pod it's the old version, if I delete a pod it starts again with an old version.</p>
<p>My folder structure:</p>
<pre class="lang-sh prettyprint-override"><code>+---auth
|   \---src
|       +---models
|       +---routes
|       |   \---__test__
|       +---services
|       \---test
+---client
|   +---.next
|   |   +---cache
|   |   |   \---next-babel-loader
|   |   +---server
|   |   |   \---pages
|   |   |       +---auth
|   |   |       \---next
|   |   |           \---dist
|   |   |               \---pages
|   |   \---static
|   |       +---chunks
|   |       |   \---pages
|   |       |       +---auth
|   |       |       \---next
|   |       |           \---dist
|   |       |               \---pages
|   |       +---development
|   |       \---webpack
|   |           \---pages
|   |               \---auth
|   +---api
|   +---components
|   +---hooks
|   \---pages
|       \---auth
+---common
|   +---build
|   |   +---errors
|   |   +---events
|   |   |   \---types
|   |   \---middlewares
|   \---src
|       +---errors
|       +---events
|       |   \---types
|       \---middlewares
+---config
+---expiration
|   \---src
|       +---events
|       |   +---listeners
|       |   \---publishers
|       +---queue
|       \---__mocks__
+---infra
|   \---k8s
+---orders
|   \---src
|       +---events
|       |   +---listeners
|       |   |   \---__test__
|       |   \---publishers
|       +---models
|       +---routes
|       |   \---__test__
|       +---test
|       \---__mocks__
+---payment
\---tickets
    \---src
        +---events
        |   +---listeners
        |   |   \---__test__
        |   \---publishers
        +---models
        |   \---__test__
        +---routes
        |   \---__test__
        +---test
        \---__mocks__
</code></pre>
<p>Would be grateful for any help!</p>

<p>What worked for me was using <code>--poll</code> flag with <code>ts-node-dev</code>.
My script looks like this</p>
<pre class="lang-json prettyprint-override"><code>&quot;start&quot; : &quot;ts-node-dev --respawn --poll --inspect --exit-child src/index.ts
</code></pre>
