Skip to main content
Version: v3.19.x

Runtime Flags

Runtime Flags

The following flags can be used to configure Gatekeeper's runtime behavior:

FlagDefault ValueDescription
--log-file""Log to file, if specified. Default is to log to stderr.
--log-level"INFO"Minimum log level. For example, DEBUG, INFO, WARNING, ERROR. Defaulted to INFO if unspecified.
--log-level-key"level"JSON key for the log level field, defaults to level
--log-level-encoder"lower"Encoder for the value of the log level field. Valid values: [lower, capital, color, capitalcolor], default: lower
--health-addr":9090"The address to which the health endpoint binds.
--metrics-addr"0"The address the metric endpoint binds to.
--port443Port for the server. defaulted to 443 if unspecified.
--host""The host address the webhook server listens on. defaults to all addresses.
--cert-dir"/certs"The directory where certs are stored, defaults to /certs.
--disable-cert-rotationfalseDisable automatic generation and rotation of webhook TLS certificates/keys.
--enable-pproffalseEnable pprof profiling.
--pprof-port6060Port for pprof profiling. defaulted to 6060 if unspecified.
--cert-service-name"gatekeeper-webhook-service"The service name used to generate the TLS cert's hostname. Defaults to gatekeeper-webhook-service.
--enable-tls-healthcheckfalseEnable probing webhook API with certificate stored in certDir.
--enable-k8s-native-validationtrueEnable the validating admission policy driver.
--external-data-provider-response-cache-ttl3mTTL for the external data provider response cache. Specify the duration in 'h', 'm', or 's' for hours, minutes, or seconds respectively. Defaults to 3 minutes if unspecified. Setting the TTL to 0 disables the cache.
--audit-interval60Interval to run audit in seconds. defaulted to 60 secs if unspecified, 0 to disable.
--constraint-violations-limit20Limit of number of violations per constraint. defaulted to 20 violations if unspecified.
--audit-chunk-size500(alpha) Kubernetes API chunking List results when retrieving cluster resources using discovery client. defaulted to 500 if unspecified.
--audit-from-cachefalseAudit synced resources from internal cache, bypassing direct queries to Kubernetes API server.
--emit-audit-eventsfalse(alpha) Emit Kubernetes events with detailed info for each violation from an audit.
--audit-events-involved-namespacefalseEmit audit events for each violation in the involved objects namespace, the default (false) generates events in the namespace Gatekeeper is installed in. Audit events from cluster-scoped resources will still follow the default behavior.
--audit-match-kind-onlyfalseOnly use kinds specified in all constraints for auditing cluster resources. if kind is not specified in any of the constraints, it will audit all resources (same as setting this flag to false).
--api-cache-dir"/tmp/audit"The directory where audit from api server cache are stored, defaults to /tmp/audit.
--audit-connection"audit-connection"(alpha) Connection name for exporting audit violation messages. Defaults to audit-connection.
--audit-channel"audit-channel"(alpha) Channel name for exporting audit violation messages. Defaults to audit-channel.
--log-stats-auditfalse(alpha) Log stats metrics for the audit run.
--default-create-vap-binding-for-constraintsfalse(alpha) Create VAPBinding resource for constraint of the template containing VAP-style CEL source. Allowed values are false: do not create Validating Admission Policy Binding, true: create Validating Admission Policy Binding.
--default-create-vap-for-templatesfalse(alpha) Create VAP resource for template containing VAP-style CEL source. Allowed values are false: do not create Validating Admission Policy unless generateVAP: true is set on constraint template explicitly, true: create Validating Admission Policy unless generateVAP: false is set on constraint template explicitly.
--default-wait-for-vapb-generation30(alpha) Wait time in seconds before generating a ValidatingAdmissionPolicyBinding after a constraint CRD is created.
--debug-use-fake-podfalseUse a fake pod name so the Gatekeeper executable can be run outside of Kubernetes.
--enable-violation-exportfalse(alpha) Enable exporting violations to external systems.
--enable-generator-resource-expansiontrue(beta) Enable the expansion of generator resources.
--enable-external-datatrueEnable external data feature.
--otlp-endpoint""Opentelemetry exporter endpoint.
--otlp-metric-interval10sInterval to read metrics for opentelemetry exporter. Defaulted to 10 secs if unspecified.
--prometheus-port8888Prometheus port for metrics backend.
--stackdriver-only-when-availablefalseOnly attempt to start the stackdriver exporter if credentials are available.
--stackdriver-metric-interval10sInterval to read metrics for stackdriver exporter. defaulted to 10 secs if unspecified.
--metrics-backendprometheusBackend used for metrics. e.g. prometheus, stackdriver. This flag can be declared more than once. Omitting will default to supporting prometheus.
--enable-mutationfalseDeprecated. This used to enable the mutation feature, now it has no effect. Use --operation=mutation-webhook and --operation=mutation-status instead.
--log-mutationsfalseEnable detailed logging of mutation events.
--mutation-annotationsfalseEnable mutation annotations.
--operationNoneThe operation to be performed by this instance. e.g. audit, webhook. This flag can be declared more than once. Omitting will default to supporting all operations.
--readiness-retries0The number of resource ingestion attempts allowed before the resource is disregarded. A value of -1 will retry indefinitely.
--disable-enforcementaction-validationfalseDisable validation of the enforcementAction and scopedEnforcementActions field of a constraint.
--log-deniesfalseLog detailed info on each deny.
--emit-admission-eventsfalse(alpha) Emit Kubernetes events for each admission violation.
--admission-events-involved-namespacefalseEmit admission events for each violation in the involved objects namespace, the default (false) generates events in the namespace Gatekeeper is installed in. Admission events from cluster-scoped resources will still follow the default behavior.
--log-stats-admissionfalse(alpha) Log stats for admission webhook.
--validating-webhook-configuration-name"gatekeeper-validating-webhook-configuration"Name of the ValidatingWebhookConfiguration.
--mutating-webhook-configuration-name"gatekeeper-mutating-webhook-configuration"Name of the MutatingWebhookConfiguration.
--tls-min-version"1.3"Minimum version of TLS supported.
--client-ca-name""Name of the certificate authority bundle to authenticate the Kubernetes API server requests against.
--client-cn-name"kube-apiserver"Expected CN name on the client certificate attached by apiserver in requests to the webhook.
--exempt-namespaceNoneThe specified namespace is allowed to set the admission.gatekeeper.sh/ignore label. To exempt multiple namespaces, this flag can be declared more than once.
--exempt-namespace-prefixNoneA namespace with the specified prefix is allowed to set the admission.gatekeeper.sh/ignore label. To exempt multiple prefixes, this flag can be declared more than once.
--exempt-namespace-suffixNoneA namespace with the specified suffix is allowed to set the admission.gatekeeper.sh/ignore label. To exempt multiple suffixes, this flag can be declared more than once.
--max-serving-threads-1Cap the number of threads handling non-trivial requests, -1 caps the number of threads to GOMAXPROCS. Defaults to -1.
--enable-referential-rulestrueEnable referential rules. This flag defaults to true. Set this value to false if you want to disallow referential constraints. Because referential constraints read objects other than the object-under-test, they may be subject to race conditions. Users concerned about this may want to disable referential rules.