<p>I currently use the fabric8 API to read contents of PODs, Services etc.</p>
<pre class="lang-java prettyprint-override"><code>KubernetesClient client = new DefaultKubernetesClient();
client.configMaps().withName(&quot;ConfigMapName&quot;);
</code></pre>
<p>Is there a way to retrieve contents of HTTPProxy from httpproxies  of api group                            projectcontour.io?</p>
<p>Thanks in advance!!!</p>

<p><code>HTTPProxy</code> seems to be a <a href="https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/" rel="nofollow noreferrer">Custom Resource</a>. Kubernetes Client provides a <a href="https://github.com/fabric8io/kubernetes-client/blob/master/doc/CHEATSHEET.md#customresource-typed-api" rel="nofollow noreferrer">Typed API</a> (where you need to provide POJOs for your Custom Resource) and a <a href="https://github.com/fabric8io/kubernetes-client/blob/master/doc/CHEATSHEET.md#customresource-typeless-api" rel="nofollow noreferrer">Typeless API</a>(manipulation of Custom Resouces using raw HashMaps). Here is an example on how you can do this using the Typeless API:</p>
<pre class="lang-java prettyprint-override"><code>try (KubernetesClient client = new DefaultKubernetesClient()) {
    CustomResourceDefinitionContext httpProxyContext = new CustomResourceDefinitionContext.Builder()
            .withGroup(&quot;projectcontour.io&quot;) // &lt;-  Group of Custom Resource
            .withVersion(&quot;v1&quot;)              // &lt;-  Version of Custom Resource
            .withPlural(&quot;httpproxies&quot;)      // &lt;-  Plural form as specified in CRD
            .withScope(&quot;Namespaced&quot;)        // &lt;-  Whether Custom Resource is Cluster Scoped or Namespaced
            .build();

    // List all HTTPProxies
    Map&lt;String, Object&gt; httpProxyList = client.customResource(httpProxyContext).list(&quot;ns1&quot;);
    // Get a specific HTTPProxy
    Map&lt;String, Object&gt; myHttpProxy = client.customResource(httpProxyContext).get(&quot;ns1&quot;, &quot;tls-example&quot;);
}
</code></pre>
<p>You may choose whatever approach you think fits your needs. If interested you can probably check out my blogs about these approaches in detail:</p>
<ol>
<li><a href="https://medium.com/@rohaan/handling-kubernetes-custom-resources-in-java-using-fabric8-kubernetes-client-249c4fe01d27" rel="nofollow noreferrer">Handling Kubernetes Custom Resources in Java using Fabric8 Kubernetes Client: Part-1(Typeless)</a></li>
<li><a href="https://medium.com/@rohaan/handling-kubernetes-custom-resources-in-java-using-fabric8-kubernetes-client-part-2-typed-cc0560d9af0d" rel="nofollow noreferrer">Handling Kubernetes Custom Resources in Java using Fabric8 Kubernetes Client: Part-2(Typed)</a></li>
</ol>
