Skip to content

Mixer Running a Local Instance

mtail edited this page Feb 27, 2019 · 1 revision

The following command runs Mixer locally using local configuration. The default configuration contains adapters like stackdriver that connect to outside systems. If you do not intend to use the adapter for local testing, you should move mixer/testdata/config/stackdriver.yaml out of the config directory, otherwise you will see repeated logging of configuration errors.

The local configuration uses a Kubernetes attribute producing adapter. The KUBECONFIG environment variable specifies the location of the Kubernetes configuration.

pushd $ISTIO/istio && make mixs && mixs server --configStoreURL=fs://$GOPATH/src/istio.io/istio/mixer/testdata/config

You can also run a simple client to interact with the server:

The following command sends a check request to Mixer. Note that source.ip is an ip address specified as 4 : separated bytes. 192.0.0.2 is encoded as c0:0:0:2 in the example.

pushd $ISTIO/istio && make mixc && mixc check --string_attributes destination.service=abc.ns.svc.cluster.local,source.name=myservice,destination.port=8080 --stringmap_attributes "request.headers=clnt:abcd;source:abcd,destination.labels=app:ratings,source.labels=version:v2"   --timestamp_attributes request.time="2017-07-04T00:01:10Z" --bytes_attributes source.ip=c0:0:0:2

Check RPC completed successfully. Check status was OK
  Valid use count: 10000, valid duration: 5m0s

The following command sends a report request to Mixer.

pushd $ISTIO/istio && make mixc && mixc report --string_attributes destination.service=abc.ns.svc.cluster.local,source.name=myservice,destination.port=8080 --stringmap_attributes "request.headers=clnt:abc;source:abcd,destination.labels=app:ratings,source.labels=version:v2"  --int64_attributes response.duration=2003,response.size=1024 --timestamp_attributes  request.time="2017-07-04T00:01:10Z" --bytes_attributes source.ip=c0:0:0:2

Report RPC returned OK

Dev Environment

Writing Code

Pull Requests

Testing

Performance

Releases

Misc

Central Istiod

Security

Mixer

Pilot

Telemetry

Clone this wiki locally