[PSA, 15/11/2023] Task Breaking Bug on C4W3 Lab "Implementing Canary Releases of TensorFlow Model Deployments with Kubernetes and Anthos Service Mesh"

Hi, just writing a PSA to help those who got stuck like me in the Assignment Lab
" Implementing Canary Releases of TensorFlow Model Deployments with Kubernetes and Anthos Service Mesh", specifically for Task 3: Configure sidecar injection.

So the bug I encountered is right after the step to
cd ~/asm_output

where we are instructed to type in this line:
kubectl apply -n $GATEWAY_NS -f samples/gateways/istio-ingressgateway

Running this as is gives me the error below:

kubectl apply -n $GATEWAY_NS   -f samples/gateways/istio-ingressgateway
deployment.apps/istio-ingressgateway configured
poddisruptionbudget.policy/istio-ingressgateway configured
role.rbac.authorization.k8s.io/istio-ingressgateway unchanged
rolebinding.rbac.authorization.k8s.io/istio-ingressgateway unchanged
service/istio-ingressgateway unchanged
serviceaccount/istio-ingressgateway unchanged
Error from server (BadRequest): error when creating "samples/gateways/istio-ingressgateway/autoscaling-v2beta1.yaml": HorizontalPodAutoscaler in version "v2" cannot be handled as a HorizontalPodAutoscaler: strict decoding error: unknown field "spec.metrics[0].resource.targetAverageUtilization"   

which made me stuck on this task for quite a while.

Luckily I managed to find a YT video of someone going through this same lab here, where I noticed the warning that says autoscaling/v2beta1 is deprecated, use autoscaling/v2 .... Sure enough, when I then listed all the files in the samples/gateways/istio-ingressgateway/ directory, it gave me the following list:


where the autoscalingv2/ folder contains autoscaling-v2.yaml. I tried to then delete the v2beta1 version of the YAML, and everything ran smoothly and allowed me to pass this Task.

It seems that the GKE team may have already known this issue and tried to fix it, but somehow forgot to remove the deprecated beta1 version which makes it still read during kubectl application step. Deleting this file like I did should help resolve this issue for the lab and at least allow you to pass the task.

Hope this helps


Hi Nicholas, and welcome to the community! Thank you very much for reporting this! We’ll look into it and send update requests to our partners.

Hi Nicholas! Our partners have updated the lab to get rid of the error. Thanks again for reporting!

1 Like