I updated my istio from 1.5.4 to 1.6.2. Then I try to create the example delegate virtual service as in the istio 1.6 documentation. According to the documentation. for a delegate virtual service the hosts field must be empty. But I get the error:
“Error from server: error when creating “test_delegate_vs.yml”: admission webhook “validation.istio.io”
denied the request: configuration is invalid: virtual service must have at least one host”
The yaml I used to create the delegate virtual service is from the delegate virtual service section of the official istio 1.6 documentation: here
See below for the yaml I use to create the DELEGATE VIRTUAL SERVICE:
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: reviews
spec:
http:
- route:
- destination:
host: reviews.svc.cluster.local
How should I solve this problem?
Thank you!
you have to add namspace tag also
Hi mudit,
Thank you for your reply. Even after I add namespace to the yaml, It still gives me the same error:
“virtual service must have at least one host”. From the error message, it seems that the error is because istio requires the vs to have at least one host. But according to the istio 1.6 offical documentation, delegate virtual service should have no hosts. So how should I solve the problem?
Hi @GaryYangZheng
You need to enable vitualservice delegation by enabling or set the env variable
PILOT_ENABLE_VIRTUAL_SERVICE_DELEGATE=true on istiod container.
you can edit the deployment file of istiod in istio-system. by running
kubectl edit deployment istiod -n istio-system and then add this env variable in spec.template.spec.container.env
may be this will help you!
1 Like
@Shubham Thank you!
My colleague solved this problem the same way. It works!
I think this should be added to the official documentation for Delegate Virtual Service