Giter Site home page Giter Site logo

opa-demo's Introduction

opa-demo

OPA (OPA-Istio) that allows you to enforce OPA policies at the Istio Proxy layer.

Table of contents

  1. Getting_started
  2. Configuring
  3. Running
  4. Example

Getting Started

Requirements - To run this example you will need minikube, kubectl, Docker, istio.

Configuring

To get case class objects from Kafka topic will need to make deserilaizer

Running

Steps to run this templete-

1> Start minikube

minikube start --vm-driver=none

2> Install istio on minikube cluster

istioctl manifest apply --set profile=demo

3> Ensure all pods are running

kubectl get pods -n istio-system

4> Now apply quick_start.yaml

kubectl apply -f quick_start.yaml

5> Enable the opa and istio injection for service pods

**kubectl label namespace default opa-istio-injection="enabled"

kubectl label namespace default istio-injection="enabled"**

6> Now apply bookinfo.yaml

kubectl apply -f bookinfo.yaml

7> Create a gateway for your service mesh by applying bookinfo-gateway.yaml

kubectl apply -f bookinfo-gateway.yaml

8> Node Port

export INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="http2")].nodePort}')

export INGRESS_HOST=$(minikube ip)

**export GATEWAY_URL=$INGRESS_HOST:$INGRESS_PORT **

echo $GATEWAY_URL

Now check the authorization by following curl commands

**curl --user alice:password -i http://$GATEWAY_URL/productpage **

curl --user alice:password -i http://$GATEWAY_URL/api/v1/products

curl --user bob:password -i http://$GATEWAY_URL/productpage

curl --user bob:password -i http://$GATEWAY_URL/api/v1/products

Example

opa-demo's People

Contributors

lokeshaggarwal2 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.