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 コードとしてのポリシー

第8章. KubernetesとKyverno

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

ギリシャ語で統治を意味するKyvernoは、Kubernetesのために特別に設計された成熟したOSSインキュベートCNCFポリシーエンジンプロジェクトである。Kyvernoを使えば、KubernetesクラスタとDevOpsパイプラインをポリシーイネーブルにして、クラスタの振る舞いを制御し、使用前にポリシーを検証することができる。本章で見ていくように、Kyvernoは同じ動的アドミッションコントローラーを介してKubernetesに統合される。

Nirmataによって作成されたKyvernoプロジェクトは、貢献者とユーザの非常に活発なコミュニティを享受している。以下のリンクはカイバーノについてのより詳しい情報を得るのに役立つ:

これまで説明してきたKubernetesのPaCソリューションとは異なり、KyvernoはOPAやRegoに支えられていない。KyvernoのポリシーはYAMLを使って記述される。 YAML構文はKubernetes全体で広く使われているため、Kyvernoを採用しても新しいポリシー言語構文を学ぶ必要はない。Kyvernoの学習曲線には、Kyverno YAML語彙が含まれる。この章の後半で説明するように、追加のJSONクエリ言語-JMESPath-を使用して、Kyvernoポリシーにきめ細かい選択ロジックを適用することができる。

さっそくカイヴァーノをminikubeにインストールしてみよう。

インストール

KyvernoはHelmを使ってインストールすることもできるし、kubectlとYAMLリソースを使ってインストールすることもできる。 Kyvernoユーザとして、私はHelmによるインストールを好む。HelmのチャートはYAMLマニフェストよりも微調整や設定がはるかに可能だ。

Kyvernoは互換性マトリックスを使用して、KyvernoのバージョンとKubernetesのバージョンが一致するようにしている。

以前のPaCインストールと同じように、Makefileとシェルスクリプトを使ってインストールを自動化した。インストール中に使ったHelmコマンドは以下のコンソール出力に示されている:

# Helm command
$ helm install kyverno kyverno/kyverno -n kyverno --create-namespace \
--values values.yaml

以下のインストール出力では、ヘルムチャートのバージョンとカイバーノのバージョンが出力されていた:

 # Kyverno install $ make up ./up.sh NAME: kyverno LAST DEPLOYED: Sat Mar 16 20:24:20 2024 NAMESPACE: kyverno STATUS: deployed REVISION: 1 NOTES: Chart version: 3.1.4 Kyverno version: v1.11.4 Thank you for installing kyverno! Your ...
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