<p>I have a pod that needs to clean up an external reference when it is terminated.  (I can do this with a a curl command.)</p>
<p>I looked into <a href="https://kubernetes.io/docs/tasks/configure-pod-container/attach-handler-lifecycle-event/" rel="nofollow noreferrer">container lifecycle events</a> and they seem just what I need.</p>
<p>But the example shows creating a Pod resource directly via yaml.  With Helm, I just made deployments and the pods are auto created.</p>
<p>How can I define a PreStop container lifecycle hook in a Kubernetes deployment?</p>

Vaccano
<p>I should have looked a bit longer.</p>
<p>The <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#writing-a-deployment-spec" rel="nofollow noreferrer">Writing a Deployment Spec</a> section of the deployment documentation says:</p>
<blockquote>
<p>The .spec.template is a Pod template. It has exactly the same schema as a Pod, except it is nested and does not have an apiVersion or kind.</p>
</blockquote>
<p>So I can just add my hook in there as if it were the Pod yaml.</p>
