Kyverno CRD
Kyverno는 정책 정의(Policy), 정책 보고(PolicyReport), 그리고 기타 내부 타입을 위해 쿠버네티스의 Custom Resource Definitions(CRDs)를 사용해요. 이 페이지에서는 Kyverno의 CRD 참조 문서를 확인하는 방법과 kubectl explain을 이용해 네이티브하게 타입 구조를 살펴보는 법을 알아봐요.
출처: 문서
본문
Kyverno는 정책 정의, 정책 보고 그리고 기타 내부 타입을 위해 쿠버네티스 Custom Resource Definitions(CRDs)를 사용해요.
Kyverno CRD의 전체 참조 문서는 여기에서 확인할 수 있어요.
HTML 소스는 Kyverno GitHub 리포지토리에서 확인할 수 있으며, 여기에 저장된 타입 정의로부터 생성돼요.
kubectl explain
Kyverno가 설치된 쿠버네티스 클러스터에서 작업할 때는 항상 kubectl explain을 사용해 Kyverno 타입을 네이티브하게 조회할 수 있어요.
예를 들어, 다음은 Kyverno Policy 리소스의 policy.spec에 대한 정의예요.
KIND: Policy
VERSION: kyverno.io/v1
RESOURCE: spec <Object>
DESCRIPTION:
Spec defines policy behaviors and contains one or more rules.
FIELDS:
background <boolean>
Background controls if rules are applied to existing resources during a
background scan. Optional. Default value is "true". The value must be set
to "false" if the policy rule uses variables that are only available in the
admission review request (e.g. user name).
failurePolicy <string>
FailurePolicy defines how unrecognized errors from the admission endpoint
are handled. Rules within the same policy share the same failure behavior.
Allowed values are Ignore or Fail. Defaults to Fail.
rules <[]Object>
Rules is a list of Rule instances. A Policy contains multiple rules and
each rule can validate, mutate, or generate resources.
schemaValidation <boolean>
Deprecated.
validationFailureAction <string>
ValidationFailureAction controls if a validation policy rule failure should
disallow the admission review request (enforce), or allow (audit) the
admission review request and report an error in a policy report. Optional.
Allowed values are `Audit` or `Enforce`. The default value is `Audit`.
validationFailureActionOverrides <[]Object>
ValidationFailureActionOverrides is a ClusterPolicy attribute that
specifies ValidationFailureAction namespace-wise. It overrides
ValidationFailureAction for the specified namespaces.
webhookTimeoutSeconds <integer>
WebhookTimeoutSeconds specifies the maximum time in seconds allowed to
apply this policy. After the configured time expires, the admission request
may fail, or may simply ignore the policy results, based on the failure
policy. The default timeout is 10s, the value must be between 1 and 30
seconds.
또한 Kyverno는 구조적 스키마(structural schemas)를 지원하므로, Kubernetes Extension이 설치된 VS Code 같은 쿠버네티스 지원 통합 개발 환경(IDE)에서도 통합된 도움말 기능을 사용할 수 있어요.