import "istio.io/istio/pilot/pkg/config/kube/crdclient"
Package crdclient provides an implementation of the config store and cache using Kubernetes Custom Resources and the informer framework from Kubernetes
This code relies heavily on code generation for performance reasons; to implement the Istio store interface, we need to take dynamic inputs. Using the dynamic informers results in poor performance, as the cache will store unstructured objects which need to be marshaled on each Get/List call. Using istio/client-go directly will cache objects marshaled, allowing us to have cheap Get/List calls, at the expense of some code gen.
cache_handler.go client.go generate.go metrics.go types.gen.go
func NewForSchemas(client kube.Client, revision, domainSuffix string, schemas collection.Schemas) (model.ConfigStoreCache, error)
func TranslateObject(r runtime.Object, gvk config.GroupVersionKind, domainSuffix string) *config.Config
type Client struct {
// contains filtered or unexported fields
}
Client is a client for Istio CRDs, implementing config store cache This is used for CRUD operators on Istio configuration, as well as handling of events on config changes
Create implements store interface
func (cl *Client) Delete(typ config.GroupVersionKind, name, namespace string, resourceVersion *string) error
Delete implements store interface `resourceVersion` must be matched before deletion is carried out. If not possible, a 409 Conflict status will be
Get implements store interface
List implements store interface
Patch applies only the modifications made in the PatchFunc rather than doing a full replace. Useful to avoid read-modify-write conflicts when there are many concurrent-writers to the same resource.
func (cl *Client) RegisterEventHandler(kind config.GroupVersionKind, handler func(config.Config, config.Config, model.Event))
Run the queue and all informers. Callers should wait for HasSynced() before depending on results.
func (cl *Client) Schemas() collection.Schemas
Schemas for the store
Update implements store interface
Path | Synopsis |
---|---|
gen | Tool to generate pilot/pkg/config/kube/crdclient/types.gen.go Example run command: REPO_ROOT=`pwd` go generate ./pilot/pkg/config/kube/crdclient/... |
Package crdclient imports 36 packages (graph) and is imported by 3 packages. Updated 2021-01-16. Refresh now. Tools for package owners.