GCP: Enable HttpLoadBalancing feature on Cluster to avoid errors when applying BackEndConfig

If you are configuring Istio/ASM ingress gateways with a BackendConfig for specifying health checks, timeouts, or Cloud Armor policies, then you need to ensure that your GKE cluster has the HttpLoadBalancing feature enabled.

If this feature is not enabled, you will see an error message like below when attempting to apply the BackendConfig manifest:

unable to recognize "backendconfig.yaml": no matches for kind "BackendConfig" in version "cloud.google.com/v1"

To check whether this feature is already enabled on your GKE cluster, the value below will return null if it is not enabled.

gcloud container clusters describe $cluster_name --region|zone=$location --format="json(addonsConfig.httpLoadBalancing)"

Enabling this feature on a cluster takes about 25 minutes, and is a cluster-level operation.

gcloud beta container clusters update $cluster_name --update-addons=HttpLoadBalancing=ENABLED --region|zone=$location

 

REFERENCES

stackoverflow.com, K8S api cloud.google.com not available

John Jung, Backend Config used to configure timeouts for web socket