ignore folder/files from skaffold watch

10/13/2020

I am using the skaffold to run my typescript application with the helm in Kubernetes. Below is my skaffold build configuration.

apiVersion: skaffold/v2beta8
kind: Config
build:
  local: 
    push: false
  tagPolicy:
    gitCommit:
      variant: CommitSha
      prefix: commit-
  artifacts: 
  - image: my-app
    sync:
      infer: 
        - '**/**/*.ts'
        - '**/**/*.json' 

As per this, Whenever I start the application, the application sync my ts and JSON file when update, and other than these files, it will rebuild the app. I have a 'build' folder in my root-structure. which I have mounted on the Kubernetes pod so whenever the app builds I will get the latest build code at my local and it will help to debug the application. But due to this application continuously rebuilding as skaffold found the change in the build folder. So, How to ignore folder/file for skaffold watch? I tried to use buildpacks.dependencies but it won't be working (Giving error for builder image definition). Can anyone help me, please?

Thanks.

-- aryan
kubernetes
kubernetes-helm
skaffold
typescript

1 Answer

10/13/2020

In your example, you're using Skaffold's docker builder. Skaffold's file watcher respects the values in the .dockerignore file.

-- Brian de Alwis
Source: StackOverflow