tfy-kyverno-config

by TrueFoundry

Helm chartv0.1.10Verified publisher

A Helm chart for kyverno configuration

About this chart

tfy-kyverno-config helm chart packaged by TrueFoundry

A Helm chart for Kyverno cluster policies used in TrueFoundry deployments.

Overview

This chart can deploy the following Kyverno policies:

PolicyValues keyDescription
Image registry replacementreplaceImageRegistryRewrites container image registries on workloads
Argo Helm repo replacementreplaceArgoHelmRepoRewrites Argo CD repoURL values
ConfigMap syncsyncConfigMapsClones ConfigMaps from a source namespace into matching target namespaces
Secret syncsyncSecretsClones Secrets from a source namespace into matching target namespaces
Pod volume mountspodVolumeMountsInjects volumes and volume mounts (ConfigMap or Secret) into pods
Custom policiesadditionalKyvernoPoliciesRenders additional raw Kyverno ClusterPolicy manifests

Custom CA certificate workflow

A common setup is to sync a CA bundle ConfigMap and mount it into application pods:

  1. Create ca-cert-bundle in a source namespace (for example truefoundry).
  2. Enable syncConfigMaps to clone it into target namespaces (for example tfy-*).
  3. Enable podVolumeMounts to mount the synced ConfigMap and set SSL-related environment variables.

Chart defaults for the pod volume mount policy live in files/default-pod-volume-mounts.yaml. When podVolumeMounts.mountDetails is empty, those defaults are used. Override the ConfigMap name with podVolumeMounts.configMapName (defaults to ca-cert-bundle).

Parameters

replaceImageRegistry Configuration options for replacing the image registry

NameDescriptionValue
replaceImageRegistry.enabledEnable or disable replacing the image registryfalse
replaceImageRegistry.excludeNamespacesNamespaces to exclude from replacing the image registry[]
replaceImageRegistry.includeNamespacesNamespaces to include from replacing the image registry. When non-empty, only these namespaces will be included[]
replaceImageRegistry.registryReplacementMapMap of source registry prefixes to target registries.{}

replaceArgoHelmRepo Configuration options for replacing the Argo Helm repository

NameDescriptionValue
replaceArgoHelmRepo.enabledEnable or disable replacing the Argo Helm repositoryfalse
replaceArgoHelmRepo.excludeNamespacesNamespaces to exclude from replacing the argo helm repo[]
replaceArgoHelmRepo.includeNamespacesNamespaces to include for replacing the argo helm repo. When non-empty, only these namespaces will be included[]
replaceArgoHelmRepo.registryReplacementMapMap of source repoURL prefixes to target registries.{}

syncConfigMaps Configuration options for syncing ConfigMaps across namespaces

NameDescriptionValue
syncConfigMaps.enabledEnable or disable syncing ConfigMaps across namespacesfalse
syncConfigMaps.useClusterPolicyUse ClusterPolicy (kyverno.io/v1) instead of GeneratingPolicy (policies.kyverno.io/v1). ClusterPolicy has more mature generateExisting support and supports wildcard namespace patterns (e.g. tfy-*)true
syncConfigMaps.excludeNamespacesNamespaces to exclude from syncing ConfigMaps[]
syncConfigMaps.includeNamespacesNamespaces to include for syncing ConfigMaps. When non-empty, only these namespaces will be included. Supports wildcard patterns (e.g. tfy-*) when useClusterPolicy is true[]
syncConfigMaps.itemsList of ConfigMaps to sync across namespaces[]

syncSecrets Configuration options for syncing Secrets across namespaces

NameDescriptionValue
syncSecrets.enabledEnable or disable syncing Secrets across namespacesfalse
syncSecrets.useClusterPolicyUse ClusterPolicy (kyverno.io/v1) instead of GeneratingPolicy (policies.kyverno.io/v1). ClusterPolicy has more mature generateExisting support and supports wildcard namespace patterns (e.g. tfy-*)true
syncSecrets.excludeNamespacesNamespaces to exclude from syncing Secrets[]
syncSecrets.includeNamespacesNamespaces to include for syncing Secrets. When non-empty, only these namespaces will be included. Supports wildcard patterns (e.g. tfy-*) when useClusterPolicy is true[]
syncSecrets.itemsList of Secrets to sync across namespaces[]

podVolumeMounts Configuration options for adding volume mounts to pods

NameDescriptionValue
podVolumeMounts.enabledEnable or disable adding volume mounts to podsfalse
podVolumeMounts.useClusterPolicyUse ClusterPolicy (kyverno.io/v1) instead of MutatingPolicy (policies.kyverno.io/v1). ClusterPolicy supports wildcard namespace patterns (e.g. tfy-*), configMap items, env vars, and readOnly volume mountstrue
podVolumeMounts.policyNameName of the ClusterPolicy when useClusterPolicy is true. Defaults to <release-name>-pod-volume-mounts""
podVolumeMounts.configMapNameDefault ConfigMap name for the built-in CA volume mount. Used when mountDetails is not overridden""
podVolumeMounts.mountInitContainersMount volumes into init containers when enabledfalse
podVolumeMounts.excludeNamespacesNamespaces to exclude from adding volume mounts to pods. Supports wildcard patterns (e.g. tfy-*) when useClusterPolicy is true[]
podVolumeMounts.includeNamespacesNamespaces to include for adding volume mounts to pods. When non-empty, only these namespaces will be included. Supports wildcard patterns (e.g. tfy-*) when useClusterPolicy is true[]
podVolumeMounts.objectSelectorLabel selector to match specific pods. When set, only pods matching these labels will be mutated{}
podVolumeMounts.mountDetailsOverride the chart default volume mounts from files/default-pod-volume-mounts.yaml. When empty, chart defaults are used. Set configMapName on each entry or use podVolumeMounts.configMapName for the built-in default[]
podVolumeMounts.additionalMountDetailsAdditional volume mounts appended to the effective mount list[]
additionalKyvernoPoliciesAdditional Kyverno clusterpolicies to apply[]

Deploy tfy-kyverno-config with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has tfy-kyverno-config 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 charttfy-kyverno-config is pinned at v0.1.10 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