With kubectl I can execute the following command:
kubectl get serviceentries
Then I receive some information back. But serviceentries is a custom resource. So how do I go about getting the same information back but then with the kubernetes client?
Yaml looks like this for example:
apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
name: external-svc-https
spec:
hosts:
- api.dropboxapi.com
- www.googleapis.com
- api.facebook.com
location: MESH_EXTERNAL
ports:
- number: 443
name: https
protocol: TLS
resolution: DNS
Anyone know the right method to use?
you should be able to pull it using the python client like this:
kubernetes.client.CustomObjectsApi().list_cluster_custom_object(group="networking.istio.io", version="v1alpha3", plural="serviceentries")
That method applies to every custom resource within kubernetes and doesn't require any further definition to the python client.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With