# Announcing Istio client-go

DevFeed: [Announcing Istio client-go](<https://devfeed.tech/articles/announcing-istio-client-go-48677.md>)

Original publisher: [Read original article](<https://istio.io/latest/blog/2019/announcing-istio-client-go/>)

Author: Neeraj Poddar (Aspen Mesh)

Published: 2019-11-14T00:00:00Z

Content type: release

Language: en

Sources: [Istio](<https://devfeed.tech/sources/istio-blog.md>)

Topics: [istio](<https://devfeed.tech/topics/istio.md>), [Kubernetes](<https://devfeed.tech/topics/kubernetes.md>), [Go Language](<https://devfeed.tech/topics/go-language.md>), [CRUD](<https://devfeed.tech/topics/crud.md>), [API](<https://devfeed.tech/topics/api.md>), [Code generation](<https://devfeed.tech/topics/code-generation.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [client-go](<https://devfeed.tech/tags/client-go.md>), [code-generation](<https://devfeed.tech/tags/code-generation.md>), [crd](<https://devfeed.tech/tags/crd.md>), [crud](<https://devfeed.tech/tags/crud.md>), [developers](<https://devfeed.tech/tags/developers.md>), [generate](<https://devfeed.tech/tags/generate.md>), [go](<https://devfeed.tech/tags/go.md>), [istio](<https://devfeed.tech/tags/istio.md>), [kubernetes](<https://devfeed.tech/tags/kubernetes.md>), [mesh](<https://devfeed.tech/tags/mesh.md>), [microservices](<https://devfeed.tech/tags/microservices.md>), [services](<https://devfeed.tech/tags/services.md>), [tools](<https://devfeed.tech/tags/tools.md>)

## AI overview

Istio announces the initial release of client-go, a Go library that gives developers programmatic access to Istio APIs in Kubernetes environments. It provides generated informers and client sets for creating controllers and performing CRUD operations on Istio custom resources.

## Source excerpt

We are pleased to announce the initial release of the Istio client go repository which enables developers to gain programmatic access to Istio APIs in a Kubernetes environment. The generated Kubernetes informers and client set in this repository makes it easy for developers to create controllers and perform Create, Read, Update and Delete (CRUD) operations for all Istio Custom Resource Definitions (CRDs). This was a highly requested functionality by many Istio users, as is evident from the feature requests on the clients generated by Aspen Mesh and the Knative project. If you're currently using one of the above mentioned clients, you can easily switch to using Istio client go like this: import ( ... - versionedclient "github.com/aspenmesh/istio-client-go/pkg/client/clientset/versioned" + versionedclient "istio.io/client-go/pkg/clientset/versioned" ) As the generated client sets are functionally equivalent, switching the imported client libraries should be sufficient in order to consume the newly generated library. How to use client-go The Istio client go repository follows the same branching strategy as the Istio API repository, as the client repository depends on the API definitions. If you want to use a stable client set, you can use the release branches or tagged versions in the client go repository. Using the client set is very similar to using the Kubernetes client go, here's a quick example of using the client to list all Istio virtual services in the passed namespace: package main import ( "log" "os" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/tools/clientcmd" versionedclient "istio.io/client-go/pkg/clientset/versioned" ) func main() { kubeconfig := os.Getenv("KUBECONFIG") namespace := os.Getenv("NAMESPACE") if len(kubeconfig) == 0 || len(namespace) == 0 { log.Fatalf("Environment variables KUBECONFIG and NAMESPACE need to be set") } restConfig, err := clientcmd.BuildConfigFromFlags("", kubeconfig) if err != nil { log.Fatalf("Failed to crea