gatekeeper
by douban
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
| Parameter | Description | Default |
|---|---|---|
| postInstall.labelNamespace.enabled | Add labels to the namespace during post install hooks | true |
| postInstall.labelNamespace.extraNamespaces | The extra namespaces that need to have the label during post install hooks | [] |
| postInstall.labelNamespace.extraAnnotations | Extra annotations added to the post install Job | {} |
| postInstall.labelNamespace.image.repository | Image with kubectl to label the namespace | openpolicyagent/gatekeeper-crds |
| postInstall.labelNamespace.image.tag | Image tag | Current release version: v3.17.1 |
| postInstall.labelNamespace.image.pullPolicy | Image pullPolicy | IfNotPresent |
| postInstall.labelNamespace.image.pullSecrets | Image pullSecrets | [] |
| postInstall.labelNamespace.extraRules | Extra rules for the gatekeeper-update-namespace-label Role | [] |
| postInstall.labelNamespace.priorityClassName | Priority class name for gatekeeper-update-namespace-label Job | `` |
| postInstall.probeWebhook.enabled | Probe webhook API post install. When enabled along with postInstall.labelNamespace.enabled, this probe will run as part of postInstall.labelNamespace Job as an initContainer | true |
| postInstall.probeWebhook.image.repository | Image with curl to probe the webhook API | curlimages/curl |
| postInstall.probeWebhook.image.tag | Image tag | 7.83.1 |
| postInstall.probeWebhook.image.pullPolicy | Image pullPolicy | IfNotPresent |
| postInstall.probeWebhook.image.pullSecrets | Image pullSecrets | [] |
| postInstall.probeWebhook.waitTimeout | Total time to wait for the webhook API to become available | 60 |
| postInstall.probeWebhook.httpTimeout | HTTP client timeout | 2 |
| postInstall.probeWebhook.insecureHTTPS | Ignore server SSL certificate | false |
| postInstall.probeWebhook.priorityClassName | Priority class name for gatekeeper-probe-webhook-post-install Job | `` |
| postInstall.affinity | The affinity to use for pod scheduling in postInstall hook jobs | {} |
| postInstall.tolerations | The tolerations to use for pod scheduling in postInstall hook jobs | [] |
| postInstall.nodeSelector | The 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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartgatekeeper is pinned at v3.17.1 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- 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