{"id":17789523,"url":"https://github.com/benderscript/mopa","last_synced_at":"2026-03-04T01:02:30.739Z","repository":{"id":156947006,"uuid":"155325186","full_name":"BenderScript/mopa","owner":"BenderScript","description":"Mixer Out of Process Adapter","archived":false,"fork":false,"pushed_at":"2018-10-30T08:16:01.000Z","size":100,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-27T08:54:13.262Z","etag":null,"topics":["istio","kubernetes","logentry","mixer"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BenderScript.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-10-30T04:38:46.000Z","updated_at":"2020-03-30T03:32:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"4872840e-ae6c-4000-8852-ddee0260e6f1","html_url":"https://github.com/BenderScript/mopa","commit_stats":null,"previous_names":["benderscript/mopa"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenderScript%2Fmopa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenderScript%2Fmopa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenderScript%2Fmopa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenderScript%2Fmopa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BenderScript","download_url":"https://codeload.github.com/BenderScript/mopa/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243814880,"owners_count":20352037,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["istio","kubernetes","logentry","mixer"],"created_at":"2024-10-27T10:33:02.059Z","updated_at":"2026-03-04T01:02:20.708Z","avatar_url":"https://github.com/BenderScript.png","language":"Go","readme":"# LogEntry Mixer Out of Process Adapter (MOPA) Walkthrough\n\nThis is an adaptation and expansion of the [Mixer Out of Process Adapter (MOPA) Walkthrough](https://github.com/istio/istio/wiki/Mixer-Out-of-Process-Adapter-Walkthrough).\n\n## Why this Guide\n\nThe MOPA walkthrough is very nice, but the prep work needed before actually going through the example is very rough. Information is scattered across many pages with sometimes confusing or conflicting information. For example:\n\n* The [Istio Dev Guide](https://github.com/istio/istio/wiki/Dev-Guide) suggests to start Minikube with:\n\n```\nminikube start --bootstrapper kubeadm\n```\n\nBut [Minikube Platform SetUp](https://istio.io/docs/setup/kubernetes/platform-setup/minikube/) , linked from [Istio Quick Start](https://istio.io/docs/setup/kubernetes/quick-start/) suggests to start with:\n```\nminikube start --memory=8192 --cpus=4 --kubernetes-version=v1.9.4 \\\n    --extra-config=controller-manager.cluster-signing-cert-file=\"/var/lib/localkube/certs/ca.crt\" \\\n    --extra-config=controller-manager.cluster-signing-key-file=\"/var/lib/localkube/certs/ca.key\" \\\n    --extra-config=apiserver.admission-control=\"NamespaceLifecycle,LimitRanger,ServiceAccount,PersistentVolumeLabel,DefaultStorageClass,DefaultTolerationSeconds,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota\" \\\n    --vm-driver=`your_vm_driver_choice`\n```\n* The [Istio Quick Start](https://istio.io/docs/setup/kubernetes/quick-start/) which is linked from the [Istio Dev Guide](https://github.com/istio/istio/wiki/Dev-Guide) says you need to load Custom Resource Definitions (below), but during my tests this was not needed.\n\n```\nkubectl apply -f install/kubernetes/helm/istio/templates/crds.yaml\n```\n\nFinally, I faced a couple of [bugs](https://github.com/istio/istio/issues/9459) that were handled very graciously by the Istio folks.\n\nTherefore I thought it would be nice to give back to the community by writing this small guide.\n\n## Target Audience\n\nThis guide is a summary and adaption of many other existing pages. It is for people that want to experiment and get their feet wet with MOPAs but not necessarily push code back to Istio.\n\nFurthermore this guide was tested with Minikube running on MacOS with VirtualBox installed.\n\n## Background\n\nI suggest you read the page on [Policies and Telemetry](https://istio.io/docs/concepts/policies-and-telemetry/).\n\n## Setup\n\n1. We will start with the original [MOPA Walkthrough](https://github.com/istio/istio/wiki/Mixer-Out-of-Process-Adapter-Walkthrough) which will direct us to the Istio Dev Guide\n\n2. Follow the Istio Dev Guide up to and  including [Other Dependencies](https://github.com/istio/istio/wiki/Dev-Guide#other-dependencies). Do not go further.\n\n   * At some point you might be directed to the [Istio Quick Start Guide](https://istio.io/docs/setup/kubernetes/quick-start/)  but **nothing in there is needed for this example**\n\n2. Install Minikube from the [official documentation](https://kubernetes.io/docs/tasks/tools/install-minikube/) .\n\n    * Start Minikube:\n\n        ```\n        minikube start --bootstrapper kubeadm\n        ```\n3. Switch back to the Istio Dev Guide and follow _only_ the section [Setting up environment variables]https://github.com/istio/istio/wiki/Dev-Guide#setting-up-environment-variables\n\n3. Now go back to the original MOPA Walkthgouh but in the section [Before you Start](https://github.com/istio/istio/wiki/Mixer-Out-of-Process-Adapter-Walkthrough#before-you-start), checkout the Istio branch with the necessary fixes. As of this writing the branch is [release-1.1](https://github.com/istio/istio/tree/release-1.1). In other words, it should read:\n\n    ```\n    mkdir -p $GOPATH/src/istio.io/ \u0026\u0026 \\\n    cd $GOPATH/src/istio.io/  \u0026\u0026 \\\n    git clone https://github.com/istio/istio.git --branch release-1.1\n    ```\n\n    **Notice that there is no need to compile Istio at all for this MOPA walkthrough.**\n\n4. Follow the overall structure of the original MOPA walkthough but use the _mygrpcadapter_ from this repo.\n\n# Testing\n\nWhen Testing I use the following _mixc_ CLI in order to fully exercise the code. Notice that I am using MACOS.\n```\n$GOPATH/out/darwin_amd64/release/mixc report \\\n--timestamp_attributes request.time=\"2017-07-04T00:01:10Z\" \\\n-s destination.service=\"svc.cluster.local\",source.user=”kubernetes://nets-57cdb6d9d7-rj7jk.default”,\\\nrequest.method=\"POST\",request.path=”/istio.mixer.v1.Mixer/Check”,\\\nrequest.scheme=\"https\" -i request.size=1235,response.size=1024,response.duration=100 \\\n--bytes_attributes source.ip=ac:11:0:0d,destination.ip=ac:11:0:03\n```\n\nIf want to see mixs debug logs, start it with:\n\n```\n$GOPATH/out/darwin_amd64/release/mixs server --configStoreURL=fs://$(pwd)/mixer/adapter/mygrpcadapter/testdata --log_output_level debug\n```\n\nIf every goes okay you will see similar output\n\n```\nlistening on \"[::]:9000\"\n2018-10-30T08:05:55.488405Z info  received request {[\u0026InstanceMsg{Variables:map[\nstring]*istio_policy_v1beta11.Value{destinationIp:\n\u0026Value{Value:\u0026Value_IpAddressValue{IpAddressValue:\u0026IPAddress{Value:[172 17 0 3],},},},latency:\n\u0026Value{Value:\u0026Value_DurationValue{DurationValue:\u0026Duration{Value:100ns,},},},method:\n\u0026Value{Value:\u0026Value_StringValue{StringValue:POST,},},protocol:\n\u0026Value{Value:\u0026Value_StringValue{StringValue:https,},},requestSize:\n\u0026Value{Value:\u0026Value_Int64Value{Int64Value:1235,},},responseCode:\n\u0026Value{Value:\u0026Value_Int64Value{Int64Value:0,},},responseSize:\n\u0026Value{Value:\u0026Value_Int64Value{Int64Value:1024,},},sourceIp:\n\u0026Value{Value:\u0026Value_IpAddressValue{IpAddressValue:\u0026IPAddress{Value:[172 17 0 13],},},},sourceUser:\n\u0026Value{Value:\u0026Value_StringValue{StringValue:”kubernetes://nets-57cdb6d9d7-rj7jk.default”,},},url:\n\u0026Value{Value:\u0026Value_StringValue{StringValue:”/istio.mixer.v1.Mixer/Check”,},},},Timestamp:\u0026istio_polic\ny_v1beta11.TimeStamp{Value:2017-07-04T00:01:10Z,},Severity:Default,MonitoredResourceType:,\nMonitoredResourceDimensions:map[string]*istio_policy_v1beta11.Value{},Name:i1logentry.instance.istio-system,}]\n\u0026Any{TypeUrl:type.googleapis.com/adapter.mygrpcadapter.config.Params,Value:[10 7 111 117 116 46 116\n120 116],XXX_unrecognized:[],} 17679084362437296840}\n\nTimeStamp:  2017-07-04T00:01:10Z\nSeverity:  Default\nprotocol :  https\nsourceUser :  ”kubernetes://nets-57cdb6d9d7-rj7jk.default”\ndestinationIp :  172.17.0.3\nrequestSize :  1235\nsourceIp :  172.17.0.13\nresponseCode :  0\nlatency :  100ns\nurl :  ”/istio.mixer.v1.Mixer/Check”\nmethod :  POST\nresponseSize :  1024\n2018-10-30T08:05:55.488756Z\tinfo\twriting instances to file out.txt\n\n```\n\n# Troubleshooting\n\nIf you see:\n\n```\nE1029 23:21:38.114345   93959 start.go:302]\nError restarting cluster:  restarting kube-proxy: waiting for\nkube-proxy to be up for configmap update: timed out waiting\nfor the condition\n```\nIt possibly means you are (or were) connected to a VPN. In my case only a computer restart would solve this issue. Minikube stop, delete and rm -rf ~/.kube would not solve it. Other suggestions?\n\nFor reference, this is the [github](https://github.com/kubernetes/minikube/issues/3022) issue with a long list of complains and possible solutions.\n\n# References\n\n * This [page](https://github.com/istio/istio/wiki/Mixer-Running-a-Local-Instance) has a good (and maybe the only?) rich mixc example.\n\n * It is always good to have the [mixc reference](https://istio.io/docs/reference/commands/mixc/) bookmarked.\n\n * [Istio Dev Guide](https://github.com/istio/istio/wiki/Dev-Guide)\n\n * [MOPA Walkthrough](https://github.com/istio/istio/wiki/Mixer-Out-of-Process-Adapter-Walkthrough)\n\n * For some in-depth information on Istio Adapters you should read the [Mixer Compiled In Adapter Dev Guide](https://github.com/istio/istio/wiki/Mixer-Compiled-In-Adapter-Dev-Guide)\n\n * Minikube [Releases](https://github.com/kubernetes/minikube/releases) page\n\n * [Prometheus Out of Mixer Example](https://github.com/istio/istio/tree/master/mixer/test/prometheus). Useful after you've mastered the MOPA walkthough and are familiar with deploying apps in Kubernetes.\n\n * Background info on [Policies and Telemetry](https://istio.io/docs/concepts/policies-and-telemetry/) .\n\n * [Mixer Out Of Process Adapter Dev Guide](https://github.com/istio/istio/wiki/Mixer-Out-Of-Process-Adapter-Dev-Guide)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenderscript%2Fmopa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenderscript%2Fmopa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenderscript%2Fmopa/lists"}