5.3. Gatekeeper Operator 구성


Operator Lifecycle Manager 카탈로그에서 Gatekeeper Operator를 설치하여 클러스터에 Gatekeeper를 설치합니다. Red Hat Advanced Cluster Management를 사용하면 정책을 사용하여 거버넌스 프레임워크를 사용하여 Gatekeeper Operator를 설치할 수 있습니다. Gatekeeper Operator를 설치한 후 Gatekeeper Operator 사용자 지정 리소스를 구성하여 Gatekeeper를 설치합니다.

5.3.1. 사전 요구 사항

  • 필수 액세스: 클러스터 관리자.
  • 클러스터에 Operator 추가 및 OpenShift Container Platform 설명서추가 리소스 섹션을 완료하여 OLM(Operator Lifecycle Manager) 및 OperatorHub를 사용하는 방법을 알아봅니다.

5.3.2. Gatekeeper 사용자 정의 리소스 샘플

Gatekeeper Operator 사용자 지정 리소스는 Gatekeeper Operator가 클러스터에서 Gatekeeper 설치를 시작하도록 지시합니다. Gatekeeper를 설치하려면 샘플 및 기본값이 포함된 다음 샘플 YAML을 사용합니다.

apiVersion: operator.gatekeeper.sh/v1alpha1
kind: Gatekeeper
metadata:
  name: gatekeeper
spec:
  audit:
    replicas: 1
    auditEventsInvolvedNamespace: Enabled 
1

    logLevel: DEBUG
    auditInterval: 10s
    constraintViolationLimit: 55
    auditFromCache: Enabled
    auditChunkSize: 66
    emitAuditEvents: Enabled
    containerArguments: 
2

    - name: ""
      value: ""
    resources:
      limits:
        cpu: 500m
        memory: 150Mi
      requests:
        cpu: 500m
        memory: 130Mi
  validatingWebhook: Enabled
  mutatingWebhook: Enabled
  webhook:
    replicas: 3
    emitAdmissionEvents: Enabled
    admissionEventsInvolvedNamespace: Enabled 
3

    disabledBuiltins:
     - http.send
    operations: 
4

     - "CREATE"
     - "UPDATE"
     - "CONNECT"
    failurePolicy: Fail
    containerArguments: 
5

    - name: ""
      value: ""
    resources:
      limits:
        cpu: 480m
        memory: 140Mi
      requests:
        cpu: 400m
        memory: 120Mi
  nodeSelector:
    region: "EMEA"
  affinity:
    podAffinity:
      requiredDuringSchedulingIgnoredDuringExecution:
        - labelSelector:
            matchLabels:
              auditKey: "auditValue"
          topologyKey: topology.kubernetes.io/zone
  tolerations:
    - key: "Example"
      operator: "Exists"
      effect: "NoSchedule"
  podAnnotations:
    some-annotation: "this is a test"
    other-annotation: "another test"
  config: 
6

    matches:
      - excludedNamespaces: ["test-*", "my-namespace"]
        processes: ["*"]
    disableDefaultMatches: false 
7
Copy to Clipboard Toggle word wrap
1
버전 3.14 이상의 경우 auditEventsInvolvedNamespace 매개변수를 활성화하여 생성하려는 네임스페이스 감사 이벤트를 관리합니다. 이 매개변수를 활성화하면 Gatekeeper 컨트롤러 배포는 --audit-events-involved-namespace=true 인수를 사용하여 실행됩니다.
3
버전 3.14 이상의 경우 admissionEventsInvolvedNamespace 매개변수를 활성화하여 생성하려는 네임스페이스 승인 이벤트를 관리합니다. 이 매개변수를 활성화하면 Gatekeeper 컨트롤러 배포는 --admission-events-involved-namespace=true 인수를 사용하여 실행됩니다.
4
버전 3.14 이상에서는 Webhook 작업을 관리하려면 operations 매개변수, "CREATE", "UPDATE", "CONNECT", "DELETE" 에 대해 다음 값을 사용합니다.
2 5
버전 3.17 이상의 경우 컨테이너에 전달할 인수 이름 및 값 목록을 제공하여 containerArguments 를 지정합니다. 인수 이름에서 선행 대시를 생략합니다. 생략된 값은 true 로 처리됩니다. 인수가 이전에 다른 필드의 operator 또는 구성에 의해 설정된 경우 제공하는 인수는 무시됩니다. 다음 플래그 목록은 거부 목록이며 현재 지원되지 않는 플래그를 참조하십시오.
  • port
  • prometheus-port
  • health-addr
  • validating-webhook-configuration-name
  • mutating-webhook-configuration-name
  • disable-cert-rotation
  • client-cert-name
  • tls-min-version
6
config 섹션을 사용하여 hub 클러스터의 모든 제약 조건에 대한 특정 프로세스에서 네임스페이스를 제외합니다.
7
disableDefaultMatches 매개변수는 Gatekeeper Operator에서 제공하는 기본 제외 네임스페이스를 추가하는 것을 비활성화하는 부울 매개변수입니다. 기본 제외 네임스페이스는 OpenShift Container Platform 또는 Kubernetes 시스템 네임스페이스입니다. 기본적으로 이 매개변수는 기본 네임스페이스를 추가할 수 있도록 false 로 설정됩니다.

5.3.3. 동기화 세부 정보를 위해 auditFromCache 구성

버전 3.14 이상의 경우 Gatekeeper Operator는 auditFromCache 매개변수를 사용하여 감사 구성에 대한 Gatekeeper 사용자 정의 리소스에 설정을 노출합니다. 이 설정은 기본적으로 비활성화되어 있습니다. 제약 조건에서 리소스를 수집하도록 auditFromCache 매개변수를 구성합니다.

auditFromCache 매개변수를 자동으로 설정하면 Gatekeeper Operator가 제약에서 리소스를 수집하고 해당 리소스를 Gatekeeper Config 리소스에 삽입합니다. 리소스가 없으면 Gatekeeper Operator가 Config 리소스를 생성합니다.

auditFromCache 매개변수를 Enabled 로 설정하는 경우 Gatekeeper Config 리소스를 캐시와 동기화할 오브젝트와 수동으로 설정해야 합니다. 자세한 내용은 Gatekeeper 문서의 감사 구성 을 참조하십시오.

제약 조건에서 리소스 컬렉션에 대한 auditFromCache 매개변수를 구성하려면 다음 단계를 완료합니다.

  1. Gatekeeper 리소스에서 auditFromCache 를 자동으로 설정합니다. 다음 예제를 참조하십시오.

    apiVersion: operator.gatekeeper.sh/v1alpha1
    kind: Gatekeeper
    metadata:
      name: gatekeeper
    spec:
      audit:
        replicas: 2
        logLevel: DEBUG
        auditFromCache: Automatic
    Copy to Clipboard Toggle word wrap
  2. 리소스가 Config 리소스에 추가되었는지 확인하려면 syncOnly 매개변수 섹션이 추가되었는지 확인합니다. 다음 명령을 실행합니다.

    oc get configs.config.gatekeeper.sh config -n openshift-gatekeeper-system
    Copy to Clipboard Toggle word wrap

    Config 리소스는 다음 예와 유사할 수 있습니다.

    apiVersion: config.gatekeeper.sh/v1alpha1
    kind: Config
    metadata:
     name: config
     namespace: "openshift-gatekeeper-system"
    spec:
     sync:
       syncOnly:
       - group: ""
         version: "v1"
         kind: "Namespace"
       - group: ""
         version: "v1"
         kind: "Pod"
    Copy to Clipboard Toggle word wrap

선택 사항: 다음 명령을 실행하여 Gatekeeper Operator 사용자 정의 리소스에 대한 설명에서 auditFromCache 설정에 대한 설명을 볼 수 있습니다.

oc explain gatekeeper.spec.audit.auditFromCache
Copy to Clipboard Toggle word wrap

5.3.4. 추가 리소스

  • 자세한 내용은 Gatekeeper 문서의 감사 구성 을 참조하십시오.
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2026 Red Hat
맨 위로 이동