C4W3 Graded Lab Error on Task 3 -install ingress gateway

I get this error

error: resource mapping not found for name: “istio-ingressgateway” namespace: “” from “samples/gateways/istio-ingressgateway/autoscaling-v2beta1.yaml”: no matches for kind “HorizontalPodAutoscaler” in version “autoscaling/v2beta1”

when I try this:

kubectl apply -n $GATEWAY_NS
-f samples/gateways/istio-ingressgateway

Appreciate any help here.

Hello @viagarwal
It looks like a version mismatch of Istio & Kubernetes HPA.

verify Isito is installed:
kubectl get pods -n istio-system

Modify your YAML file with your correct API version for the HPA resource eg
apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler

Then give another trial to the gateway, Let me know if you will still have the error!

Regards
Isaak

I’m getting this error as well
Here’s the yaml file: (MAYBE I NEED TO MOVE apiVersion: and kind: to be under scaleTargetRef:? will try this.

apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
name: istio-ingressgateway
spec:
maxReplicas: 5
metrics:

  • resource:
    name: cpu
    targetAverageUtilization: 80
    type: Resource
    minReplicas: 3
    scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: istio-ingressgateway

Finally got this to work. In step 3 where it says to do this:
kubectl apply -n $GATEWAY_NS
-f samples/gateways/istio-ingressgateway

that applied all the config files in this directory which caused errors.

Instead I ran kubectl apply -n $GATEWAY_NS
-f samples/gateways/istio-ingressgateway/autoscalingv2

Then just the autoscalingv2 configuration is run and then I could complete the lab

I had the same issue and this solved the issue for me as well. Thank you!

Thank you so much for this! Something I was banging my head against for a while as well.

Additionally, I ran into issues with this command during the lab: kubectl label namespace default istio-injection- istio.io/rev=$REVISION --overwrite
Ends up that there is an easy to miss space that needs to be deleted between “injection-” and “istio” when you copy to the clipboard from the lab; so a heads up to anyone else who may run into that issue!

Thanks again!