<p>Given a Kubernetes pod with a yaml as shown below, are there any way to set up the value of the terminationGracePeriodSeconds according to some global/internal variable of the application being executed.</p>
<p><a href="https://i.stack.imgur.com/h0shH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/h0shH.png" alt="enter image description here" /></a></p>
<p>Otherwise said and more generally, I know that through downward API, data from the infrastructure/kubernetes (IP, host, …) can be exposed to the application. On the other side, are there any method to expose internal application data/variables to the infrastructure i.e. Kubernetes.</p>

Mazen Ezzeddine
<p>You need to run a function like kubectl apply, or kubectl patch, to trigger update of manifest file parameters.
so its not just like setting
terminationGracePeriodSeconds: $somevar
and have it updated every time the variable changes.</p>
<p>If change of this value is once per deployment, you can use template tools like Helm, or Knative.</p>
<p>or you can use <a href="https://github.com/operator-framework/operator-sdk" rel="nofollow noreferrer">operator framework</a> to implement your own operator for this purpose.</p>
