title: How to get vertical pod autoscaling recommendations using kubernetes client-go package?
body: <p>I am using the client-go to generate reports about resources for my team.  We are using VPA(<a href="https://github.com/kubernetes/autoscaler" rel="nofollow noreferrer">https://github.com/kubernetes/autoscaler</a>) to compare its recommendations for pods against our own.  I have everything working well except for the part where I get the recommendations from the Pod.  In kubectl, I would enter the following to get descriptions of the pods in the namespace:</p>
  <p>k describe vpa -n ABC</p>
  <p>The description for each pod includes the following section:</p>
  <pre><code>Status:
    Conditions:
      Last Transition Time:  2022-02-09T10:33:28Z
      Status:                True
      Type:                  RecommendationProvided
    Recommendation:
      Container Recommendations:
        Container Name:  my-service
        Lower Bound:
          Cpu:     25m
          Memory:  442246463
        Target:
          Cpu:     25m
          Memory:  442809964
        Uncapped Target:
          Cpu:     25m
          Memory:  442809964
        Upper Bound:
          Cpu:     25m
          Memory:  724829578
  </code></pre>
  <p>I cannot figure out how to get this information using the go-client package.  I am using  another package, &quot;k8s.io/metrics/pkg/client/clientset/versioned&quot;, to get current resource information for a pod.</p>
  <p>I'd appreciate your suggestions...  The only thing that I can think to do is to execute kubectl inside my golang app, capture the output, and go from there...  Pretty hacky and not very scalable.</p>
  <p>Thanks for your time and interest,
  Mike</p>