<p>I am trying to create a BackendConfig resource on a GKE cluster v1.16.13-gke.401 but it gives me the following error:</p>
<pre><code>unable to recognize &quot;backendconfig.yaml&quot;: no matches for kind &quot;BackendConfig&quot; in version &quot;cloud.google.com/v1&quot;
</code></pre>
<p>I have checked the available apis with the <code>kubectl api-versions</code> command and cloud.google.com is not available. How can I enable it?</p>
<p>I want to create a BackendConfig whit a custom health check like this:</p>
<pre><code>apiVersion: cloud.google.com/v1
kind: BackendConfig
metadata:
  name: my-backendconfig
spec:
  healthCheck:
    checkIntervalSec: 8
    timeoutSec: 1
    healthyThreshold: 1
    unhealthyThreshold: 3
    type: HTTP
    requestPath: /health
    port: 10257
</code></pre>
<p>And attach this BackendConfig to a Service like this:</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  annotations:
    cloud.google.com/backend-config: '{&quot;default&quot;: &quot;my-backendconfig&quot;}'
</code></pre>

Diego
<p>As mentioned in the comments, issue was caused due to the lack of <code>HTTP Load Balancing</code> add-on in your cluster.</p>
<p>When you are creating GKE cluster with all default setting, feature like <code>HTTP Load Balancing</code> is enabled.</p>
<blockquote>
<p>The HTTP Load Balancing add-on is required to use the Google Cloud Load Balancer with Kubernetes Ingress. If enabled, a controller will be installed to coordinate applying load balancing configuration changes to your GCP project</p>
</blockquote>
<p>More details can be found in <a href="https://cloud.google.com/kubernetes-engine/docs/tutorials/http-balancer" rel="nofollow noreferrer">GKE documentation</a>.</p>
<p>For test I have created <code>Cluster-1</code> without <code>HTTP Load Balancing</code> add-on. There was no <code>BackendConfig CRD</code> - <a href="https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/#customresourcedefinitions" rel="nofollow noreferrer">Custom Resource Definition</a>.</p>
<blockquote>
<p>The CustomResourceDefinition API resource allows you to define custom resources. Defining a CRD object creates a new custom resource with a name and schema that you specify. The Kubernetes API serves and handles the storage of your custom resource. The name of a CRD object must be a valid DNS subdomain name.</p>
</blockquote>
<p>Without <code>BackendConfig</code> and without <code>cloud</code> <code>apiVersion</code> like below</p>
<pre><code>user@cloudshell:~ (k8s-tests-XXX)$ kubectl get crd | grep backend
user@cloudshell:~ (k8s-tests-XXX)$ kubectl api-versions | grep cloud
</code></pre>
<p>I was not able to create any <code>BackendConfig</code>.</p>
<pre><code>user@cloudshell:~ (k8s-tests-XXX) $ kubectl apply -f bck.yaml
error: unable to recognize &quot;bck.yaml&quot;: no matches for kind &quot;BackendConfig&quot; in version &quot;cloud.google.com/v1&quot;
</code></pre>
<p><strong>To make it work, you have to enable <code>HTTP Load Balancing</code></strong> You can do it via UI or command.</p>
<p>Using UI:</p>
<blockquote>
<p>Navigation Menu &gt; Clusters &gt; [Cluster-Name] &gt; Details &gt; Clikc on
<code>Edit</code> &gt; Scroll down to <code>Add-ons</code> and expand &gt; Find <code>HTTP load balancing</code> and change from <code>Disabled</code> to <code>Enabled</code>.</p>
</blockquote>
<p>or command:</p>
<pre><code>gcloud beta container clusters update &lt;clustername&gt; --update-addons=HttpLoadBalancing=ENABLED --zone=&lt;your-zone&gt;

$ gcloud beta container clusters update cluster-1 --update-addons=HttpLoadBalancing=ENABLED --zone=us-central1-c
WARNING: Warning: basic authentication is deprecated, and will be removed in GKE control plane versions 1.19 and newer. For a list of recommended authentication methods, see: https://cloud.google.com/kubernetes-engine/docs/how-to/api-server-authentication
</code></pre>
<p>After a while, when Add-on was enabled:</p>
<pre><code>$ kubectl get crd | grep backend
backendconfigs.cloud.google.com             2020-10-23T13:09:29Z
$ kubectl api-versions | grep cloud
cloud.google.com/v1
cloud.google.com/v1beta1
$ kubectl apply -f bck.yaml 
backendconfig.cloud.google.com/my-backendconfig created
</code></pre>
