Handlers

A handler is a set of configurations that's needed to instantiate an external adapter. For example, a listchecker adapter needs the address of the dogstatsd server, which can be provided through a handler that's passed to the Datadog instance. The following example creates a handler for the listchecker adapter so that we can define whitelists and blacklists:

apiVersion: config.istio.io/v1alpha2
kind: handler
metadata:
name: whitelist
spec:
compiledAdapter: listchecker
params:
# providerUrl: ordinarily black and white lists are maintained
# externally and fetched asynchronously using the providerUrl.
overrides: ["v1", "v2"] # overrides provide a static list
blacklist: false

The params list attribute of the specification is specific to a given adapter. A list of all available adaptors for Mixer can be found at https://archive.istio.io/v1.3/docs/reference/config/policy-and-telemetry/adapters/.  

Request mapping from attributes to adapter inputs is defined through instance configuration. For example, the appversion instance maps the source pod or service label version to the values of the params instances:

apiVersion: config.istio.io/v1alpha2
kind: instance
metadata:
name: appversion
spec:
compiledTemplate: listentry
params:
value: source.labels["version"]

Note that templates are used to define a mapping between attributes and params. In the preceding example, the listentry template is used to verify whether the value is present for the label-defined version or not.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.107.90