title: How can I retrieve just the kubectl.kubernetes.io/last-applied-configuration using kubectl -o jsonpath?
body: <p>I am trying to retrieve the kubernetes last-applied-configuration from a service yaml (under metadata annoations) using kubectl -o jsonpath, but the name of the field is "kubectl.kubernetes.io/last-applied-configuration". I believe the parser is getting confused due to the dots in the actual name field, since it uses dots for child object designation.</p>
  
  <p>e.g. (Running on Windows)</p>
  
  <pre><code>kubectl -lapp=myapp get service -o jsonpath="{range .items[*]}{
  .metadata.annotations}{\"\n\"}{end}"
  </code></pre>
  
  <p>shows the map of resulting values as expected</p>
  
  <pre><code>map[kubectl.kubernetes.io/last-applied-configuration:{"kind":"Service","apiVersion":"v1","metadata":{"name":"myapp","namespace":"mynamespace",
  "creationTimestamp":null,"labels":{"app":"myapp","version":"1.0"}},"spec":{"ports":[{"name":"http","protocol":"TCP","port":80,"ta
  rgetPort":8080}],"selector":{"app":"myapp","version":"1.0"},"type":"NodePort"},"status":{"loadBalancer":{}}}]
  </code></pre>
  
  <p>In this case, the kubectl.kubernetes.io/last-applied-configuration is the only thing in the annotations, but that is not always the case. </p>
  
  <p>The problem comes about when I try to drill down to just the last-applied-configuration.</p>
  
  <p>e.g.</p>
  
  <pre><code>kubectl -lapp=myapp get service -o jsonpath="{range .items[*]}{
  .metadata.annotations.kubectl.kubernetes.io/last-applied-configuration}{\"\n\"}{end}"
  </code></pre>
  
  <p>Returns no information.</p>
  
  <p>I have also tried</p>
  
  <pre><code>kubectl -lapp=myapp get service -o jsonpath="{range .items[*]}{
  .metadata.annotations['kubectl.kubernetes.io/last-applied-configuration']}{\"\n\"}{end}"
  </code></pre>
  
  <p>and</p>
  
  <pre><code>kubectl -lapp=myapp get service -o jsonpath="{range .items[*]}{['metadata']['annotations']['kubectl.kubernetes.io/last-applied-configuration']}{\"\n\"}{end}"
  </code></pre>
  
  <p>to no avail.</p>
  
  <p>I'm expecting the results to be simply the value of the kubectl.kubernetes.io/last-applied-configuration</p>