Kubernetes Autoscaling - Event triggering

8/9/2017

I am trying to get Flink cluster running on top of kubernetes. Since current Flink 1.3.1 does not support dynamic scaling yet, I would like to trigger my custom script to stop and restart the job from savepoint when scale up / down with kubernetes.

Is there such feature in Kubernetes that I can have a pre/post event trigger point in autoscale, that I can run custom script after autoscale finished its job? Or it seem the only option now is to write my own cron monitoring to handle by using kubectl scale?

-- coffee_latte1020
apache-flink
kubernetes

1 Answer

8/21/2017

This can be achieve by using readinessProbe for deployment, and execute the script when the container is up and ready.

      readinessProbe:
      exec:
        command:
        - ./run_this_script.sh
      initialDelaySeconds: 5
      periodSeconds: 15
-- coffee_latte1020
Source: StackOverflow