Skip to Content
コードとしてのポリシー
book

コードとしてのポリシー

by Jimmy Ray
March 2025
Intermediate to advanced
556 pages
9h 13m
Japanese
O'Reilly Media, Inc.
Audio summary available
Content preview from コードとしてのポリシー

第5章. Open Policy AgentとKubernetes

この作品はAIを使って翻訳されている。ご意見、ご感想をお待ちしている:translation-feedback@oreilly.com

これまで、PaC を一般化し、基礎的な知識を中心に解説してきた。第2章では、OPA(Open Policy Agent)を紹介し、OPAツール群を検討した。 ポリシーの書き方、テスト方法、管理方法、OPA の拡張と統合方法について説明した。第 3 章では、PaC と AuthZ について検討し、OPA をこれらのユースケースでどのように使用できるかの例を再度検討した。最後に第4章では、Kubernetesクラスタ内でPaCが使用されるさまざまな機能、コンポーネント、ユースケースを取り上げた。

これから数章にわたって、具体的なPaCソリューションと、それらがKubernetesクラスタ内でどのように使用され、変異や検証のユースケースを満たすかを探っていく。その過程で、ベスト・プラクティスと潜在的な課題に触れていく。これらの章では、本書で取り上げるそれぞれのPaCソリューションが、どのようにあなたのニーズと能力に最適なのかを学ぶはずだ。

この章では、OPAとKubernetesを取り上げる。第2章で説明したように、OPAはドメインにとらわれないPaCソリューションであり、Regoポリシーをサブミットされたデータやストアされたデータに対して評価する。まずはインストールとコンポーネントから始め、Kubernetes固有のOPAポリシー、ライブラリ、ツール、テクニックについて深く掘り下げていく。

本書では、、OPA/Gatekeeper ではなく OPAclassic と呼ぶことがある。OPAをOPA/Gatekeeperと区別するために、この古典的な呼称を追加した。

OPA は非常に成熟した OSS プロジェクトであり、開発者とユーザの強力で活発なコミュニティがある。以下のリンクは、OPAに関するより詳細な情報を得るのに役立つ:

この章を読み進める際には、他の章と同様に、すべての例は私が表面化した参照資料に含まれているか、Policy as Code Bookのコードの組織化において、関連するGitHubリポジトリにある例から利用可能になることを覚えておいてほしい。

では、まずOPAをKubernetes(私のローカルのminikube)にインストールするところから始め、変異させたり検証したりするWebhookのユースケースにどのように適合するかを見ていこう。

OPAの設置

第4章で学んだように、Kubernetes APIサーバが起動すると、mutatingアドミッションコントローラとvalidatingアドミッションコントローラがロードされる。 最も一般的なアドミッションコントローラの2つ(動的なアドミッション制御も可能)は、mutating admission webhookとvalidating admission webhookである。これらのアドミッションコントローラは、APIサーバの起動時に、カスタムAPIサーバ設定を持つアドミッションコントローラとしてロードすることなく、OPAや他のPaCソリューションをアドミッション制御サービスとして構成することを可能にする。

OPAをKubernetesクラスタにインストールするための公式のインストール手順は、この ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

クラウドアプリケーションアーキテクチャパターン

クラウドアプリケーションアーキテクチャパターン

Kyle Brown, Bobby Woolf, Joseph Yoder
初めてのGraphQL ―Webサービスを作って学ぶ新世代API

初めてのGraphQL ―Webサービスを作って学ぶ新世代API

Eve Porcello, Alex Banks, 尾崎 沙耶, あんどうやすし

Publisher Resources

ISBN: 9798341627093