1"use strict";(globalThis.webpackChunkdocumentation=globalThis.webpackChunkdocumentation||[]).push([[5600],{6482(e,n,t){t.r(n),t.d(n,{assets:()=>s,contentTitle:()=>l,default:()=>h,frontMatter:()=>o,metadata:()=>i,toc:()=>c});const i=JSON.parse('{"id":"getting-started/running-opal/run-opal-client/lets-run-the-client","title":"Run the OPAL Client","description":"Step 7: Running the client","source":"@site/docs/getting-started/running-opal/run-opal-client/lets-run-the-client.mdx","sourceDirName":"getting-started/running-opal/run-opal-client","slug":"/getting-started/running-opal/run-opal-client/lets-run-the-client","permalink":"/getting-started/running-opal/run-opal-client/lets-run-the-client","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{},"sidebar":"opalSidebar","previous":{"title":"Standalone OPA URI","permalink":"/getting-started/running-opal/run-opal-client/standalone-opa-uri"},"next":{"title":"Troubleshooting","permalink":"/getting-started/running-opal/troubleshooting"}}');var r=t(1684),a=t(506);const o={},l="Run the OPAL Client",s={},c=[{value:"Step 7: Running the client",id:"step-7-running-the-client",level:3},{value:"1) Get the client image",id:"1-get-the-client-image",level:4},{value:"2) Set configuration",id:"2-set-configuration",level:4},{value:"3) Run the container (local run example)",id:"3-run-the-container-local-run-example",level:4},{value:"4) Run the container in production",id:"4-run-the-container-in-production",level:4},{value:"<a></a> How to push data updates from an authoritative source",id:"-how-to-push-data-updates-from-an-authoritative-source",level:2}];function u(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",h4:"h4",header:"header",li:"li",p:"p",pre:"pre",ul:"ul",...(0,a.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.header,{children:(0,r.jsx)(n.h1,{id:"run-the-opal-client",children:"Run the OPAL Client"})}),"\n",(0,r.jsx)(n.h3,{id:"step-7-running-the-client",children:"Step 7: Running the client"}),"\n",(0,r.jsx)(n.p,{children:"Let's recap the previous steps with example values:"}),"\n",(0,r.jsx)(n.h4,{id:"1-get-the-client-image",children:"1) Get the client image"}),"\n",(0,r.jsx)(n.p,{children:"First, download opal client docker image:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"docker pull permitio/opal-client\n"})}),"\n",(0,r.jsx)(n.h4,{id:"2-set-configuration",children:"2) Set configuration"}),"\n",(0,r.jsx)(n.p,{children:"Then, declare configuration with environment variables:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"# let's say this is the (shortened) token we obtained from opal server\nexport OPAL_CLIENT_TOKEN=eyJ0...8wsk\n# and this is where we deployed opal server\nexport OPAL_SERVER_URL=https://opal.yourdomain.com\n# and let's say we subscribe to a specific tenant's data updates (i.e: `tenant1`)\nexport OPAL_DATA_TOPICS=policy_data/tenant1\n"})}),"\n",(0,r.jsx)(n.p,{children:"and let's assume we run opa inline with the default options."}),"\n",(0,r.jsx)(n.h4,{id:"3-run-the-container-local-run-example",children:"3) Run the container (local run example)"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"docker run -it \\\n --env OPAL_CLIENT_TOKEN \\\n --env OPAL_SERVER_URL \\\n --env OPAL_DATA_TOPICS \\\n -p 7766:7000 \\\n -p 8181:8181 \\\n permitio/opal-client\n"})}),"\n",(0,r.jsx)(n.p,{children:"Please notice opal client exposes two ports when running opa inline:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["OPAL Client (port ",(0,r.jsx)(n.code,{children:":7766"}),") - the OPAL client API (i.e: healthcheck, etc)."]}),"\n",(0,r.jsxs)(n.li,{children:["OPA (port ",(0,r.jsx)(n.code,{children:":8181"}),") - the port of the OPA agent (OPA is running in server mode)."]}),"\n"]}),"\n",(0,r.jsx)(n.h4,{id:"4-run-the-container-in-production",children:"4) Run the container in production"}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.a,{href:"#run-docker-prod",children:"Same instructions as for OPAL server"}),"."]}),"\n",(0,r.jsxs)(n.h2,{id:"-how-to-push-data-updates-from-an-authoritative-source",children:[(0,r.jsx)("a",{name:"push-updates"})," How to push data updates from an authoritative source"]}),"\n",(0,r.jsx)(n.p,{children:"Now that OPAL is live, we can use OPAL server to push updates to OPAL clients in real time."}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.a,{href:"/tutorials/trigger_data_updates",children:"We have a separate tutorial on how to trigger updates"}),"."]})]})}function h(e={}){const{wrapper:n}={...(0,a.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(u,{...e})}):u(e)}},506(e,n,t){t.d(n,{R:()=>o,x:()=>l});var i=t(2888);const r={},a=i.createContext(r);function o(e){const n=i.useContext(a);return i.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),i.createElement(a.Provider,{value:n},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.