<p>So at work we are having a bit of a mare with Helm and Kubernetes.</p>
<p>Long-term we have a fix, but short-term we have some patches that I'm currently manually applying using <code>kubectl edit deployment -n {namespace} {podBaseName}</code>, then editing in vim...</p>
<p>It feels a bit cowboy.</p>
<p>I found <a href="https://kubernetes.io/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch/</a> which suggests I can issue a <code>kubectl patch deployment -n {namespace} {podBaseName} --patch 'some: patch: definition'</code></p>
<p>I'm looking to add to a <code>livenessProbe</code> but I'm not 100% sure of the Syntax to ensure I only add the property I want, which is <code>initialDelaySeconds: 60</code></p>
<p>Is it also possible to <code>upsert</code> using a patch if I wanted to add <code>startupProbe</code> or <code>readinessProbe</code>?</p>

MrMesees
<p>So this is as far as I have got.</p>
<p>It does solve some problems (mostly not going via vim as the <code>kubectl edit deployment</code> leads to, with possible user-error etc).</p>
<p>Our Helm is still broken, and I've no definitive ETA on the fix.</p>
<p>So The current <code>kubectl</code> fix/hack is limited (or seems to be) limited to single container pod type.</p>
<pre><code>kubectl patch deployment \
    -n ${KUBE_NAMESPACE} \
    ${KUBE_POD_PREFIX} \
    --patch '{&quot;spec&quot;:{&quot;containers&quot;:[{&quot;livenessProbe&quot;:{&quot;exec&quot;:{&quot;command&quot;:[&quot;your&quot;, &quot;health&quot;, &quot;check&quot;, &quot;command&quot;]},&quot;failureThreshold&quot;:5,&quot;initialDelaySeconds&quot;:60,&quot;periodSeconds:5,&quot;successThreshold&quot;:1,&quot;timeoutSeconds&quot;:1},&quot;name&quot;:&quot;sqs-worker&quot;}]}}}}'
</code></pre>
<p>This is to patch an sqs-worker type container in a pod, which only has that container. We also have web-containers which have an nginx ingress as well as an instance of an app.</p>
<p><code>KUBE_NAMESPACE</code> is how we are separating internal environments. This might be a branch name or <code>prod</code> or <code>dev</code>. <code>kubectl get namespaces</code> should be your guide to picking a value for you.</p>
<p><code>KUBE_POD_PREFIX</code> is the pod name, without the odd suffix that is appended. This might be helm or our helm related. All I know is I might have <code>service-a-specific-task-worker-sdhhdg3jh</code> pod and I supply <code>service-a-specific-task-worker</code>. I use <code>kubectl get pods -n ${KUBE_NAMESPACE}</code> as my source of truth here.</p>
