GoogleContainerTools / GoogleContainerTools/skaffold

Skaffold after sync hook to target specific containers

Open
#9,044 3 comments 0 reactions 0 assignees View on GitHub
area/hooks priority/p2
Dominant language
Go
Stars
15.9k
Forks
1.7k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

Let me just start by saying that I've really been enjoying using Skaffold in one of my projects. I would like to make a feature request, or maybe someone can give me some idea of how I can achieve this using the existing skaffold.yaml schema https://skaffold.dev/docs/references/yaml/.

I'm running the sync functionality for the local development of an Airflow instance within a Kind Kubernetes cluster. Basically, every time I make changes to files in my local directory they are synced with the Airflow deployment and I'm able to dev in a complete environment that accurately simulates production. This works well!

The problem is that Airflow has intervals in which it scans the file structure for changes. So between syncs, there could at most be 30 seconds to wait before Airflow picks up the changes. But if I could run `airflow dags reserialize` inside one of the pods after every sync, I could force Airflow to rescan immediately. This is almost completely possible with the current structure of the skaffold.yaml schema, I could just use the after sync hook and run the command in the containers. But what happens, is that because I cant target a specific pod, like I can in other hooks, this command runs 4 or 5 times (depending on how many pods are running).

Would it make sense to allow that after-sync hook to target specific pods? like the other hooks seem to allow you to do?

A workaround is that instead of using the `container` parameter, I just write a script that get's triggered after every sync that basically does a `kubectl exec` on one of the pods. I'm not sure if there are any other suggestions on this?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.