Documentation ¶
Overview ¶
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.
Index ¶
- func New(client kube.Client, revision, domainSuffix string) (model.ConfigStoreController, error)
- func NewForSchemas(client kube.Client, revision, domainSuffix string, schemas collection.Schemas) (model.ConfigStoreController, error)
- func TranslateObject(r runtime.Object, gvk config.GroupVersionKind, domainSuffix string) config.Config
- func WaitForCRD(k config.GroupVersionKind, stop <-chan struct{}) bool
- type Client
- func (cl *Client) Create(cfg config.Config) (string, error)
- func (cl *Client) Delete(typ config.GroupVersionKind, name, namespace string, resourceVersion *string) error
- func (cl *Client) Get(typ config.GroupVersionKind, name, namespace string) *config.Config
- func (cl *Client) HasSynced() bool
- func (cl *Client) List(kind config.GroupVersionKind, namespace string) ([]config.Config, error)
- func (cl *Client) Patch(orig config.Config, patchFn config.PatchFunc) (string, error)
- func (cl *Client) RegisterEventHandler(kind config.GroupVersionKind, handler model.EventHandler)
- func (cl *Client) Run(stop <-chan struct{})
- func (cl *Client) Schemas() collection.Schemas
- func (cl *Client) SetWatchErrorHandler(handler func(r *cache.Reflector, err error)) error
- func (cl *Client) SyncAll()
- func (cl *Client) Update(cfg config.Config) (string, error)
- func (cl *Client) UpdateStatus(cfg config.Config) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewForSchemas ¶
func NewForSchemas(client kube.Client, revision, domainSuffix string, schemas collection.Schemas) (model.ConfigStoreController, error)
func TranslateObject ¶
func WaitForCRD ¶
func WaitForCRD(k config.GroupVersionKind, stop <-chan struct{}) bool
WaitForCRD waits until the request CRD exists, and returns true on success. A false return value indicates the CRD does not exist but the wait failed or was canceled. This is useful to conditionally enable controllers based on CRDs being created.
Types ¶
type Client ¶
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
func (*Client) Delete ¶
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
func (*Client) Patch ¶
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 (*Client) RegisterEventHandler ¶
func (cl *Client) RegisterEventHandler(kind config.GroupVersionKind, handler model.EventHandler)
func (*Client) Run ¶
func (cl *Client) Run(stop <-chan struct{})
Run the queue and all informers. Callers should wait for HasSynced() before depending on results.
func (*Client) SetWatchErrorHandler ¶
func (*Client) SyncAll ¶
func (cl *Client) SyncAll()
SyncAll syncs all the objects during bootstrap to make the configs updated to caches
Directories ¶
Path | Synopsis |
---|---|
Tool to generate pilot/pkg/config/kube/crdclient/types.gen.go Example run command: REPO_ROOT=`pwd` go generate ./pilot/pkg/config/kube/crdclient/...
|
Tool to generate pilot/pkg/config/kube/crdclient/types.gen.go Example run command: REPO_ROOT=`pwd` go generate ./pilot/pkg/config/kube/crdclient/... |