typescriptkuberneteskubernetes-helmskaffold

ignore folder/files from skaffold watch


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.


Solution

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