mirror of https://github.com/istio/istio.io.git
44 lines
21 KiB
HTML
44 lines
21 KiB
HTML
<!DOCTYPE html><html lang="en" itemscope itemtype="https://schema.org/WebPage"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><meta name="theme-color" content="#466BB0"/><meta name="title" content="Mixer"><meta name="description" content="Mixer Q&A"><meta name="og:title" content="Mixer"><meta name="og:description" content="Mixer Q&A"><meta name="og:url" content="/help/faq/mixer.html"><meta name="og.site_name" content="Istio"><title>Istioldie 0.6 / Mixer</title><script> window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date; ga('create', 'UA-98480406-2', 'auto'); ga('send', 'pageview'); </script> <script async src='https://www.google-analytics.com/analytics.js'></script><link rel="alternate" type="application/rss+xml" title="Istio Blog RSS" href="/v0.6/feed.xml"><link rel="shortcut icon" href="/v0.6/favicons/favicon.ico" ><link rel="apple-touch-icon" href="/v0.6/favicons/apple-touch-icon-180x180.png" sizes="180x180"><link rel="icon" type="image/png" href="/v0.6/favicons/favicon-16x16.png" sizes="16x16"><link rel="icon" type="image/png" href="/v0.6/favicons/favicon-32x32.png" sizes="32x32"><link rel="icon" type="image/png" href="/v0.6/favicons/android-36x36.png" sizes="36x36"><link rel="icon" type="image/png" href="/v0.6/favicons/android-48x48.png" sizes="48x48"><link rel="icon" type="image/png" href="/v0.6/favicons/android-72x72.png" sizes="72x72"><link rel="icon" type="image/png" href="/v0.6/favicons/android-96x196.png" sizes="96x196"><link rel="icon" type="image/png" href="/v0.6/favicons/android-144x144.png" sizes="144x144"><link rel="icon" type="image/png" href="/v0.6/favicons/android-192x192.png" sizes="192x192"><link rel="manifest" href="/v0.6/manifest.json"><meta name="apple-mobile-web-app-title" content="Istio"><meta name="application-name" content="Istio"><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:400,100,100italic,300,300italic,400italic,500,500italic,700,700italic,900,900italic"><link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous"><link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.6/css/all.css"><link rel="stylesheet" href="/v0.6/css/light_theme.css" title="light"><link rel="alternate stylesheet" href="/v0.6/css/dark_theme.css" title="dark"> <script src="/v0.6/js/styleSwitcher.min.js"></script></head><body class="language-unknown theme-unknown"><header role="banner"><nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark"> <a class="navbar-brand" href="/v0.6/" style="visibility: visible"> <img class="logo" src="/v0.6/img/istio-logo.svg" alt="Istio Logo"/> <span class="brand-name">Istioldie 0.6</span> </a> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button><div class="collapse navbar-collapse justify-content-end" id="navbarCollapse"><ul class="navbar-nav"><li class="nav-item"> <a class="nav-link " href="/v0.6/about/intro.html">About</a></li><li class="nav-item"> <a class="nav-link " href="/v0.6/blog/2018/traffic-mirroring.html">Blog</a></li><li class="nav-item"> <a class="nav-link " href="/v0.6/docs/">Docs</a></li><li class="nav-item"> <a class="nav-link active" href="/v0.6/help/">Help</a></li><li class="nav-item"> <a class="nav-link " href="/v0.6/community.html">Community</a></li><li class="nav-item dropdown" id="gearDropdown" style="white-space: nowrap"> <a href="" class="nav-link dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <i style="width: 1em" class='fa fa-lg fa-cog'></i> </a><ul class="dropdown-menu" aria-labelledby="gearDropdown"><h6 class="dropdown-header">Other versions of this site</h6><li> <a href="https://istio.io">Current Release</a></li><li> <a href="https://preliminary.istio.io">Next Release</a></li><li> <a href="https://archive.istio.io">Older Releases</a></li><li class="dropdown-divider"></li><li> <i class='fa fa-check light'></i> <a href="" onclick="setActiveStyleSheet('light');return false;">Light Theme</a></li><li> <i class='fa fa-check dark'></i> <a href="" onclick="setActiveStyleSheet('dark');return false;">Dark Theme</a></li></ul></li></ul><form name="cse" id="searchbox" class="form-inline justify-content-end" role="search"> <input type="hidden" name="cx" value="013699703217164175118:iwwf17ikgf4" /> <input type="hidden" name="ie" value="utf-8" /> <input type="hidden" name="hl" value="en" /><div class="input-group"> <input name="q" class="form-control search-box" type="text" size="30" /> <button class="btn btn-search input-group-addon my-2 my-sm-0 fa fa-search" type="submit"></button></div></form></div></nav></header><div class="container-fluid"><div class="row row-offcanvas row-offcanvas-left"><div class="col-6 col-md-3 col-xl-2 sidebar-offcanvas"><nav class="sidebar"><div class="spacer"></div><div class="directory" role="tablist"><div class="card"><div class="card-header" role="tab" id="header0"><div title="A bunch of resources to help you deploy, configure and use Istio."> Help!</div></div><div id="collapse0" class="collapse show" data-parent="#sidebar" role="tabpanel" aria-labelledby="header0"><div class="card-body"><ul class="tree"><li class="sublist"> <label class='tree-toggle'> <i class='fa fa-lg fa-caret-down'></i> <a class="" title="Frequently Asked Questions about Istio." href="/v0.6/help/faq">FAQ</a> </label><ul class="tree"><li> <a title="General Q&A" href="/v0.6/help/faq/general.html">General</a></li><li> <a title="Setup Q&A" href="/v0.6/help/faq/setup.html">Setup</a></li><li> <a title="Security Q&A" href="/v0.6/help/faq/security.html">Security</a></li><li> <span class="current" title="Mixer Q&A">Mixer</span></li><li> <a title="Traffic Management Q&A" href="/v0.6/help/faq/traffic-management.html">Traffic Management</a></li></ul></li><li> <a title="A glossary of common Istio terms." href="/v0.6/help/glossary.html">Glossary</a></li><li> <a title="What to do about bugs" href="/v0.6/help/bugs.html">Reporting Bugs</a></li><li> <a title="Practical advice on practical problems with Istio" href="/v0.6/help/troubleshooting.html">Troubleshooting Guide</a></li></ul></div></div></div></div></nav></div><div class="col-12 col-md-9 col-lg-6 col-xl-7"><p class="d-md-none"> <label class="sidebar-toggler" data-toggle="offcanvas"> <i class="fa fa-chevron-right"></i> </label></p><main role="main"><h1>Mixer</h1><h4 id="why-mixer">Q: Why does Istio need Mixer?</h4><p>Mixer provides a rich intermediation layer between the Istio components as well as Istio-based services, and the infrastructure backends used to perform access control checks and telemetry capture. This layer enables operators to have rich insights and control over service behavior without requiring changes to service binaries.</p><p>Mixer is designed as a stand-alone component, distinct from Envoy. This has numerous benefits:</p><ul><li><p><em>Scalability</em>. The work that Mixer and Envoy do is very different in nature, leading to different scalability requirements. Keeping the components separate enables independent component-appropriate scaling.</p></li><li><p><em>Resource Usage</em>. Istio depends on being able to deploy many instances of its proxy, making it important to minimize the cost of each individual instance. Moving Mixer’s complex logic into a distinct component makes it possible for Envoy to remain svelte and agile.</p></li><li><p><em>Reliability</em>. Mixer and its open-ended extensibility model represents the most complex parts of the data path processing pipeline. By hosting this functionality in Mixer rather than Envoy, it creates distinct failure domains which enables Envoy to continue operating even if Mixer fails, preventing outages.</p></li><li><p><em>Isolation</em>. Mixer provides a level of insulation between Istio and the infrastructure backends. Each Envoy instance can be configured to have a very narrow scope of interaction, limiting the impact of potential attacks.</p></li><li><p><em>Extensibility</em>. It was imperative to design a simple extensibility model to allow Istio to interoperate with as widest breath of backends as possible. Due to its design and language choice, Mixer is inherently easier to extend than Envoy is. The separation of concerns also makes it possible to use Istio policy and telemetry processing with different proxies, just as a mix of Envoy and NGINX.</p></li></ul><p>Envoy implements sophisticated caching, batching, and prefetching, to largely mitigate the latency impact of needing to interact with Mixer on the request path.</p><h4 id="seeing-mixer-config">Q: How do I see all of the configuration for Mixer?</h4><p>Configuration for <em>instances</em>, <em>handlers</em>, and <em>rules</em> is stored as Kubernetes <a href="https://kubernetes.io/docs/concepts/api-extension/custom-resources/">Custom Resources</a>. Configuration may be accessed by using <code class="highlighter-rouge">kubectl</code> to query the Kubernetes <a href="https://kubernetes.io/docs/admin/kube-apiserver/">API server</a> for the resources.</p><h4 id="rules">Rules</h4><p>To see the list of all rules, execute the following:</p><div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>kubectl get rules <span class="nt">--all-namespaces</span>
|
||
</code></pre></div></div><p>Output will be similar to:</p><div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>NAMESPACE NAME KIND
|
||
default mongoprom rule.v1alpha2.config.istio.io
|
||
istio-system promhttp rule.v1alpha2.config.istio.io
|
||
istio-system promtcp rule.v1alpha2.config.istio.io
|
||
istio-system stdio rule.v1alpha2.config.istio.io
|
||
</code></pre></div></div><p>To see an individual rule configuration, execute the following:</p><div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>kubectl <span class="nt">-n</span> <namespace> get rules <name> <span class="nt">-o</span> yaml
|
||
</code></pre></div></div><h4 id="handlers">Handlers</h4><p>Handlers are defined based on Kubernetes <a href="https://kubernetes.io/docs/concepts/api-extension/custom-resources/#customresourcedefinitions">Custom Resource Definitions</a> for adapters.</p><p>First, identify the list of adapter kinds:</p><div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>kubectl get crd <span class="nt">-listio</span><span class="o">=</span>mixer-adapter
|
||
</code></pre></div></div><p>The output will be similar to:</p><div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>NAME KIND
|
||
deniers.config.istio.io CustomResourceDefinition.v1beta1.apiextensions.k8s.io
|
||
listcheckers.config.istio.io CustomResourceDefinition.v1beta1.apiextensions.k8s.io
|
||
memquotas.config.istio.io CustomResourceDefinition.v1beta1.apiextensions.k8s.io
|
||
noops.config.istio.io CustomResourceDefinition.v1beta1.apiextensions.k8s.io
|
||
prometheuses.config.istio.io CustomResourceDefinition.v1beta1.apiextensions.k8s.io
|
||
stackdrivers.config.istio.io CustomResourceDefinition.v1beta1.apiextensions.k8s.io
|
||
statsds.config.istio.io CustomResourceDefinition.v1beta1.apiextensions.k8s.io
|
||
stdios.config.istio.io CustomResourceDefinition.v1beta1.apiextensions.k8s.io
|
||
svcctrls.config.istio.io CustomResourceDefinition.v1beta1.apiextensions.k8s.io
|
||
</code></pre></div></div><p>Then, for each adapter kind in that list, issue the following command:</p><div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>kubectl get <adapter kind name> <span class="nt">--all-namespaces</span>
|
||
</code></pre></div></div><p>Output for <code class="highlighter-rouge">stdios</code> will be similar to:</p><div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>NAMESPACE NAME KIND
|
||
istio-system handler stdio.v1alpha2.config.istio.io
|
||
</code></pre></div></div><p>To see an individual handler configuration, execute the following:</p><div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>kubectl <span class="nt">-n</span> <namespace> get <adapter kind name> <name> <span class="nt">-o</span> yaml
|
||
</code></pre></div></div><h4 id="instances">Instances</h4><p>Instances are defined according to Kubernetes <a href="https://kubernetes.io/docs/concepts/api-extension/custom-resources/#customresourcedefinitions">Custom Resource Definitions</a> for instances.</p><p>First, identify the list of instance kinds:</p><div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>kubectl get crd <span class="nt">-listio</span><span class="o">=</span>mixer-instance
|
||
</code></pre></div></div><p>The output will be similar to:</p><div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>NAME KIND
|
||
checknothings.config.istio.io CustomResourceDefinition.v1beta1.apiextensions.k8s.io
|
||
listentries.config.istio.io CustomResourceDefinition.v1beta1.apiextensions.k8s.io
|
||
logentries.config.istio.io CustomResourceDefinition.v1beta1.apiextensions.k8s.io
|
||
metrics.config.istio.io CustomResourceDefinition.v1beta1.apiextensions.k8s.io
|
||
quotas.config.istio.io CustomResourceDefinition.v1beta1.apiextensions.k8s.io
|
||
reportnothings.config.istio.io CustomResourceDefinition.v1beta1.apiextensions.k8s.io
|
||
</code></pre></div></div><p>Then, for each instance kind in that list, issue the following command:</p><div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>kubectl get <instance kind name> <span class="nt">--all-namespaces</span>
|
||
</code></pre></div></div><p>Output for <code class="highlighter-rouge">metrics</code> will be similar to:</p><div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>NAMESPACE NAME KIND
|
||
default mongoreceivedbytes metric.v1alpha2.config.istio.io
|
||
default mongosentbytes metric.v1alpha2.config.istio.io
|
||
istio-system requestcount metric.v1alpha2.config.istio.io
|
||
istio-system requestduration metric.v1alpha2.config.istio.io
|
||
istio-system requestsize metric.v1alpha2.config.istio.io
|
||
istio-system responsesize metric.v1alpha2.config.istio.io
|
||
istio-system tcpbytereceived metric.v1alpha2.config.istio.io
|
||
istio-system tcpbytesent metric.v1alpha2.config.istio.io
|
||
</code></pre></div></div><p>To see an individual instance configuration, execute the following:</p><div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>kubectl <span class="nt">-n</span> <namespace> get <instance kind name> <name> <span class="nt">-o</span> yaml
|
||
</code></pre></div></div><h4 id="attribute-expressions">Q: What is the full set of attribute expressions Mixer supports?</h4><p>Please see the <a href="/v0.6/docs/reference/config/mixer/expression-language.html">Expression Language Reference</a> for the full set of supported attribute expressions.</p><h4 id="mixer-self-monitoring">Q: Does Mixer provide any self-monitoring?</h4><p>Mixer exposes a monitoring endpoint (default port: <code class="highlighter-rouge">9093</code>). There are a few useful paths to investigate Mixer performance and audit function:</p><ul><li><code class="highlighter-rouge">/metrics</code> provides Prometheus metrics on the Mixer process as well as gRPC metrics related to API calls and metrics on adapter dispatch.</li><li><code class="highlighter-rouge">/debug/pprof</code> provides an endpoint for profiling data in <a href="https://golang.org/pkg/net/http/pprof/">pprof format</a>.</li><li><code class="highlighter-rouge">/debug/vars</code> provides an endpoint exposing server metrics in JSON format.</li></ul><p>Mixer logs can be accessed via a <code class="highlighter-rouge">kubectl logs</code> command, as follows:</p><div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>kubectl <span class="nt">-n</span> istio-system logs <span class="k">$(</span>kubectl <span class="nt">-n</span> istio-system get pods <span class="nt">-listio</span><span class="o">=</span>mixer <span class="nt">-o</span> <span class="nv">jsonpath</span><span class="o">=</span><span class="s1">'{.items[0].metadata.name}'</span><span class="k">)</span> mixer
|
||
</code></pre></div></div><p>Mixer trace generation is controlled by the command-line flag <code class="highlighter-rouge">traceOutput</code>. If the flag value is set to <code class="highlighter-rouge">STDOUT</code> or <code class="highlighter-rouge">STDERR</code> trace data will be written directly to those locations. If a URL is provided, Mixer will post Zipkin-formatted data to that endpoint (example: <code class="highlighter-rouge">http://zipkin:9411/api/v1/spans</code>).</p><p>In the 0.2 release, Mixer only supports Zipkin tracing.</p><h4 id="writing-custom-adapters">Q: How can I write a custom adapter for Mixer?</h4><p>Learn how to implement a new adapter for Mixer by consulting the <a href="https://github.com/istio/istio/blob/master/mixer/doc/adapters.md">Adapter Developer’s Guide</a>.</p></main></div><div class="col-12 col-md-3 d-none d-lg-block"><nav class="toc"><div class="spacer"></div><div class="directory" role="directory"><ul><li><a href="#why-mixer">Q: Why does Istio need Mixer?</a></li><li><a href="#seeing-mixer-config">Q: How do I see all of the configuration for Mixer?</a></li><li><a href="#rules">Rules</a></li><li><a href="#handlers">Handlers</a></li><li><a href="#instances">Instances</a></li><li><a href="#attribute-expressions">Q: What is the full set of attribute expressions Mixer supports?</a></li><li><a href="#mixer-self-monitoring">Q: Does Mixer provide any self-monitoring?</a></li><li><a href="#writing-custom-adapters">Q: How can I write a custom adapter for Mixer?</a></li></ul></div></nav></div></div></div><div class="footer"><footer><div class="container-fluid"><div class="row"><div class="col-sm-2"></div><nav class=" col-12 col-sm-3" role="navigation"><ul class="first"><li><a class="header" href="/v0.6/docs/">Docs</a></li><li><a href="/v0.6/docs/concepts/">Concepts</a></li><li><a href="/v0.6/docs/setup/">Setup</a></li><li><a href="/v0.6/docs/tasks/">Tasks</a></li><li><a href="/v0.6/docs/guides/">Guides</a></li><li><a href="/v0.6/docs/reference/">Reference</a></li></ul></nav><nav class="col-12 col-sm-3" role="navigation"><ul><li><a class="header" href="/v0.6/help/">Help</a></li><li><a href="/v0.6/help/faq/index.html">FAQ</a></li><li><a href="/v0.6/help/glossary.html">Glossary</a></li><li><a href="/v0.6/help/troubleshooting.html">Troubleshooting</a></li><li><a href="/v0.6/help/bugs.html">Report Bugs</a></li><li><a href="https://github.com/istio/istio.github.io/issues/new?title=Issue with _help/faq/mixer.html" target="_blank" rel="noopener">Doc Bugs & Gaps</a></li><li><a href="https://github.com/istio/istio.github.io/edit/master/_help/faq/mixer.html" target="_blank" rel="noopener">Edit This Page</a></li></ul></nav><nav class="col-12 col-sm-3" role="navigation"><ul><li><a class="header" href="/v0.6/community.html">Community</a></li><li> <a href="https://groups.google.com/forum/#!forum/istio-users" target="_blank" rel="noopener">User</a> | <a href="https://groups.google.com/forum/#!forum/istio-dev" target="_blank" rel="noopener">Dev Mailing Lists</a></li><li><a href="https://twitter.com/IstioMesh" target="_blank" rel="noopener">Twitter</a></li><li><a href="https://stackoverflow.com/questions/tagged/istio" target="_blank" rel="noopener">Stack Overflow</a></li><li><a href="https://github.com/istio/community/" target="_blank" rel="noopener">GitHub</a></li><li><a href="https://github.com/istio/community/blob/master/WORKING-GROUPS.md" target="_blank" rel="noopener">Working Groups</a></li></ul></nav></div><div class="row"><div class="col-12"><p class="description text-center" role="contentinfo"> Istio Archive 0.6, Copyright © 2018 Istio Authors<br> Archived on 02-Apr-2018</p></div></div></div></footer></div><script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/1.7.1/clipboard.min.js"></script> <script src="https://www.google.com/cse/brand?form=searchbox"></script> <script src="/v0.6/js/misc.min.js"></script></body></html>
|