Closed shubhampanth-fareye closed 9 months ago
Hi @rohanKanojia
I am using KubernetesClient java client (6.3.1) and i have a virtual service yaml and i want to add this virtual service in the client could you help in the same
You can check out VirtualServiceExample, you have to load the YAML into object like I showed in previous comment
VirtualService virtualService = istioClient.v1beta1().virtualServices().load(
VirtualServiceExample.class.getResourceAsStream("/virtualService.yaml")
).get();
Can i skip using the POJO VirtualServiceExample in above
@shubhampanth-fareye : What do you mean by skipping POJO? You can directly apply the YAML like this:
istioClient.v1beta1().virtualServices().inNamespace("default").load(
VirtualServiceExample.class.getResourceAsStream("/virtualService.yaml")
).serverSideApply();
Actually my yaml is stored in S3 and will be downloading it from there so i cannot use any class as VirtualServiceExample.class
@rohanKanojia If i already have a targetStream of the yaml file can i directly load it into it
VirtualService virtualService = istioClient.v1beta1().virtualServices().load(targetStream).get();
@rohanKanojia If i already have a targetStream of the yaml file can i directly load it into it
VirtualService virtualService = istioClient.v1beta1().virtualServices().load(targetStream).get();
I think that should work. Are you facing some error when you run it?
You'd also need to specify namespace using .inNamespace
if it's not specified in YAML
hi @shubhampanth-fareye Is your issue resolved ? let us know. Thanks
This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions!
@shubhampanth-fareye : Could you please check if this works?
You can also check examples section in Istio extension.