<p>Looks like there is no support to delete HorizontalPodAutoscaler using fabric8's K8S Java client ver:6.0.0.</p>
<p>Although It is straightforward to create HorizontalPodAutoscaler using fabric8's K8S Java client ver:6.0.0.</p>
<p>E.g.</p>
<pre><code> HorizontalPodAutoscalerStatus hpaStatus = k8sClient.resource(createHPA())
                .inNamespace(namespace)
                .createOrReplace().getStatus();
</code></pre>
<pre><code>public HorizontalPodAutoscaler createHPA(){
return new HorizontalPodAutoscalerBuilder()
                .withNewMetadata()
                    .withName(applicationName)
                    .addToLabels(&quot;name&quot;, applicationName)
                .endMetadata()
                .withNewSpec()
                    .withNewScaleTargetRef()
                        .withApiVersion(hpaApiVersion)
                        .withKind(&quot;Deployment&quot;)
                        .withName(applicationName)
                    .endScaleTargetRef()
                    .withMinReplicas(minReplica)
                    .withMaxReplicas(maxReplica)
                    .addNewMetric()
                        .withType(&quot;Resource&quot;)
                        .withNewResource()
                            .withName(&quot;cpu&quot;)
                            .withNewTarget()
                                .withType(&quot;Utilization&quot;)
                                .withAverageUtilization(cpuAverageUtilization)
                            .endTarget()
                        .endResource()
                    .endMetric()
                    .addNewMetric()
                        .withType(&quot;Resource&quot;)
                        .withNewResource()
                            .withName(&quot;memory&quot;)
                            .withNewTarget() 
                                .withType(&quot;AverageValue&quot;)
                                .withAverageValue(new Quantity(memoryAverageValue))
                            .endTarget()
                        .endResource()
                    .endMetric()
                    .withNewBehavior()
                        .withNewScaleDown()
                            .addNewPolicy()
                                .withType(&quot;Pods&quot;)
                                .withValue(podScaleDownValue)
                                .withPeriodSeconds(podScaleDownPeriod)
                            .endPolicy()
                            .withStabilizationWindowSeconds(podScaledStabaliztionWindow)
                        .endScaleDown()
                    .endBehavior()
                .endSpec().build();
}
</code></pre>
<p>Any solution to delete HorizontalPodAutoscaler using fabric8's K8S Java client ver:6.0.0 will be appriciated.</p>

<p>First, Need to identify which API group <code>(v1, v2beta1, v2beta2)</code> was used during deployment creation based on the same API group the autoscaling function  need to be call to get the HPA instance and then go ahead to perform any action on that HPA instance.</p>
<p>In my case the deployment was created with v2beta2 API group, Below code snnipt helped me to deleted the HorizontalPodAutoscaler object from the provided name space.</p>
<pre><code>k8sClient.autoscaling().v2beta2().horizontalPodAutoscalers().inNamespace(&quot;test&quot;).withName(&quot;myhpa&quot;).delete()
</code></pre>
