{"id":16383794,"url":"https://github.com/jferrater/opa-kubernetes","last_synced_at":"2025-09-01T04:35:09.774Z","repository":{"id":151445720,"uuid":"166486282","full_name":"jferrater/opa-kubernetes","owner":"jferrater","description":"Deploying Open Policy Agent in  Kubernetes","archived":false,"fork":false,"pushed_at":"2019-01-18T23:44:43.000Z","size":1,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-22T00:26:21.358Z","etag":null,"topics":["kubernetes","opa","openpolicyagent"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jferrater.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-18T23:42:28.000Z","updated_at":"2019-01-18T23:47:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"e9f71900-56ce-4965-8320-92e48e3d7123","html_url":"https://github.com/jferrater/opa-kubernetes","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jferrater/opa-kubernetes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jferrater%2Fopa-kubernetes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jferrater%2Fopa-kubernetes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jferrater%2Fopa-kubernetes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jferrater%2Fopa-kubernetes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jferrater","download_url":"https://codeload.github.com/jferrater/opa-kubernetes/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jferrater%2Fopa-kubernetes/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273073718,"owners_count":25040802,"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","status":"online","status_checked_at":"2025-09-01T02:00:09.058Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["kubernetes","opa","openpolicyagent"],"created_at":"2024-10-11T04:09:42.374Z","updated_at":"2025-09-01T04:35:09.748Z","avatar_url":"https://github.com/jferrater.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"### Open Policy Agent - Kubernetes\n\n#### Create configmap for policy, example.rego\nFirst, create a ConfigMap containing a test policy. The test policy will define a blacklist that rejects:\n\n    - Objects missing a 'customer' label.\n    - Pods referring to images outside the corporate registry.\n\nIn this case, the policy file does not contain sensitive information so it's fine to store as a ConfigMap. If the file contained sensitive information, then we recommend you store it as a Secret.\n\n`kubectl create configmap example-policy --from-file example.rego`\n\n#### Create Deployment and Service objects\nNext, create a Deployment to run OPA. The ConfigMap containing the policy is volume mounted into the container. This allows OPA to load the policy from the file system.\n\n`kubectl create -f deployment-opa.yaml`\n\nAt this point OPA is up and running. Create a Service to expose OPA API so that you can query it.\n`kubectl create -f service-opa.yaml`\n\nNow you can query OPA's API. If you use the Pod example-pod.json, deny will be true because the Pod refers to image outside the corporate registry.\n\n`curl $OPA_URL/v1/data -d @example-pod.json`\n\nIf you update the image to refer to the corporate registry, deny will be false.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjferrater%2Fopa-kubernetes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjferrater%2Fopa-kubernetes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjferrater%2Fopa-kubernetes/lists"}