gatekeeper

by douban

Helm chartv3.17.1App v3.17.1Verified publisher

A Helm chart for Gatekeeper

About this chart

Gatekeeper Helm Chart

This chart was forked form offical helm chart, adding podmonitor which is essential for monitoring

See official chart at: https://github.com/open-policy-agent/gatekeeper/tree/master/charts/gatekeeper

Get Repo Info

helm repo add douban https://douban.github.io/charts/
helm repo update

See helm repo for command documentation.

Install Chart

# Helm install with gatekeeper-system namespace already created
$ helm install -n gatekeeper-system [RELEASE_NAME] gatekeeper/gatekeeper

# Helm install and create namespace
$ helm install -n gatekeeper-system [RELEASE_NAME] gatekeeper/gatekeeper --create-namespace

See parameters below.

See helm install for command documentation.

Upgrade Chart

Upgrading from < v3.4.0 Chart 3.4.0 deprecates support for Helm 2 and also removes the creation of the gatekeeper-system Namespace from within the chart. This follows Helm 3 Best Practices.

Option 1: A simple way to upgrade is to uninstall first and re-install with 3.4.0 or greater.

$ helm uninstall gatekeeper
$ helm install -n gatekeeper-system [RELEASE_NAME] gatekeeper/gatekeeper --create-namespace

Option 2: Run the helm_migrate.sh script before installing the 3.4.0 or greater chart. This will remove the Helm secret for the original release, while keeping all of the resources. It then updates the annotations of the resources so that the new chart can import and manage them.

$ helm_migrate.sh
$ helm install -n gatekeeper-system gatekeeper gatekeeper/gatekeeper

Upgrading from >= v3.4.0

$ helm upgrade -n gatekeeper-system [RELEASE_NAME] gatekeeper/gatekeeper

See helm 2 to 3 for Helm 2 migration documentation.

Exempting Namespace

The Helm chart automatically sets the Gatekeeper flag --exempt-namespace={{ .Release.Namespace }} in order to exempt the namespace where the chart is installed, and adds the admission.gatekeeper.sh/ignore label to the namespace during a post-install hook.

See Exempting Namespaces for more information.

Parameters

ParameterDescriptionDefault
postInstall.labelNamespace.enabledAdd labels to the namespace during post install hookstrue
postInstall.labelNamespace.extraNamespacesThe extra namespaces that need to have the label during post install hooks[]
postInstall.labelNamespace.extraAnnotationsExtra annotations added to the post install Job{}
postInstall.labelNamespace.image.repositoryImage with kubectl to label the namespaceopenpolicyagent/gatekeeper-crds
postInstall.labelNamespace.image.tagImage tagCurrent release version: v3.17.1
postInstall.labelNamespace.image.pullPolicyImage pullPolicyIfNotPresent
postInstall.labelNamespace.image.pullSecretsImage pullSecrets[]
postInstall.labelNamespace.extraRulesExtra rules for the gatekeeper-update-namespace-label Role[]
postInstall.labelNamespace.priorityClassNamePriority class name for gatekeeper-update-namespace-label Job``
postInstall.probeWebhook.enabledProbe webhook API post install. When enabled along with postInstall.labelNamespace.enabled, this probe will run as part of postInstall.labelNamespace Job as an initContainertrue
postInstall.probeWebhook.image.repositoryImage with curl to probe the webhook APIcurlimages/curl
postInstall.probeWebhook.image.tagImage tag7.83.1
postInstall.probeWebhook.image.pullPolicyImage pullPolicyIfNotPresent
postInstall.probeWebhook.image.pullSecretsImage pullSecrets[]
postInstall.probeWebhook.waitTimeoutTotal time to wait for the webhook API to become available60
postInstall.probeWebhook.httpTimeoutHTTP client timeout2
postInstall.probeWebhook.insecureHTTPSIgnore server SSL certificatefalse
postInstall.probeWebhook.priorityClassNamePriority class name for gatekeeper-probe-webhook-post-install Job``
postInstall.affinityThe affinity to use for pod scheduling in postInstall hook jobs{}
postInstall.tolerationsThe tolerations to use for pod scheduling in postInstall hook jobs[]
postInstall.nodeSelectorThe node selector to use for pod scheduling in postInstall hook jobs

Deploy gatekeeper with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has gatekeeper on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartgatekeeper is pinned at v3.17.1 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply