<p>I have deployment and I want to replace &quot;path&quot; value in liveness probe section. What is correct path for this in kustomize?</p>
<pre><code>- patch: |-
    - op: replace
      path: ??????????
      value:
        https://xyz.staging.something.eu/ping
</code></pre>
<hr />
<pre><code>    apiVersion: v1
    kind: Pod
    metadata:
      labels:
        test: liveness
      name: liveness-http
    spec:
      containers:
      - name: liveness
        image: k8s.gcr.io/liveness
        args:
        - /server
        livenessProbe:
          httpGet:
            path: /healthz
            port: 8080
          initialDelaySeconds: 3
          periodSeconds: 3
</code></pre>

a11eksandar
<p>It is the yaml path. You follow the nodes from the parent down to the leaf-node you want to specify.</p>
<p>Since you want the <code>path</code> node on <code>httpGet</code> of <code>livenessProbe</code> it will end with <code>livenessProbe.httpGet.path</code>.</p>
<p>The parent node of livenessProbe is a bit trickier, notice it is an element of the list <code>containers</code>. You can specify it either through an index or through an attribute (EG <code>name</code>). So either <code>containers[0]</code> or <code>containers[name=liveness]</code>.</p>
<p>By now we have <code>containers[0].livenessProbe.httpGet.path</code>. The missing root node is <code>spec</code>, so <code>spec.containers[0].livenessProbe.httpGet.path</code> will do it.</p>
<p>There is a bunch of other ways that this could be expressed as well.
<a href="https://github.com/wwkimball/yamlpath#illustration" rel="nofollow noreferrer">https://github.com/wwkimball/yamlpath#illustration</a> seems like a good more in-depth explanation.</p>
