insights-admission

by Fairwinds

Helm chartv2.2.0App 2.3.30Verified publisher

A Validating Webhook Admission Controller that utilizes Fairwinds Insights.

About this chart

Fairwinds Insights Admission Controller

Intro

This is an Admission Controller to reject deployment of objects into your Kubernetes cluster that woudld create dangerous action items in Fairwinds Insights

Installation

A valid TLS certificate is required for this admission controller to work. If you have cert-manager installed then everything should work out of the box. If you don't use cert-manager and don't want to install it then you can supply a CA Bundle with the caBundle parameter and create a TLS secret and pass the name of that secret as secretName.

Changes in 2.0.0

The default image now comes from Google Artifact Registry (us-docker.pkg.dev/fairwinds-ops/oss/insights-admission-controller) instead of Quay, pinned to immutable semver (2.3.20). If you mirror images or allow registries explicitly, update your configuration before upgrading.

helm repo add fairwinds-stable https://charts.fairwinds.com/stable
helm install insights-admission fairwinds-stable/insights-admission \
  --namespace insights-admission \
  --set insights.organization=acme-co \
  --set insights.cluster=staging \
  --set insights.base64token="dG9rZW4="

If you have an additional type of object to monitor with this admission controller then you can add a values file that looks like this.

rules:
- apiGroups:
  - custom
  apiVersions:
  - v1
  operations:
  - CREATE
  - UPDATE
  resources:
  - customResource
  scope: Namespaced

Values

KeyTypeDefaultDescription
global.proxy.httpstringnilAnnotations used to access the proxy servers(http).
global.proxy.httpsstringnilAnnotations used to access the proxy servers(https).
global.proxy.ftpstringnilAnnotations used to access the proxy servers(ftp).
global.proxy.no_proxystringnilAnnotations to provides a way to exclude traffic destined to certain hosts from using the proxy.
global.sslCertFileSecretNamestringnilThe name of an existing Secret containing an SSL certificate file to be used when communicating with a self-hosted Insights API.
global.sslCertFileSecretKeystringnilThe key, within global.sslCertFileSecretName, containing an SSL certificate file to be used when communicating with a self-hosted Insights API.
insights.organizationstring""The name of your Organization from Fairwinds Insights
insights.clusterstring""The name of your cluster from Fairwinds Insights
insights.hoststring"https://insights.fairwinds.com"Override the hostname for Fairwinds Insights
insights.base64tokenstring""The token for your cluster from the Cluster Settings page in Fairwinds Insights. This should already be base64 encoded.
insights.secret.createbooltrueCreate a secret containing the base64 encoded token.
insights.secret.nameOverridestringnilThe name of the secret to use.
insights.secret.suffixstring"token"The suffix to add onto the relase name to get the secret that contains the base64 token
insights.configmap.createbooltrueCreate a config map with Insights configuration
insights.configmap.nameOverridestringnilThe name of the configmap to use.
insights.configmap.suffixstring"configmap"The suffix to add onto the release name to get the configmap that contains the host/organization/cluster
webhookConfig.failurePolicystring"Ignore"failurePolicy for the ValidatingWebhookConfiguration and MutatingWebhookConfiguration. This also informs whether the admission controller blocks validation requests on errors, such as while executing OPA policies.
webhookConfig.matchPolicystring"Exact"matchPolicy for the ValidatingWebhookConfiguration and MutatingWebhookConfiguration
webhookConfig.timeoutSecondsint30number of seconds to wait before failing the admission request (max is 30)
webhookConfig.namespaceSelectorobject{"matchExpressions":[{"key":"control-plane","operator":"DoesNotExist"}]}namespaceSelector for the ValidatingWebhookConfiguration and MutatingWebhookConfiguration
webhookConfig.annotationsobject{}Annotations to add to the ValidatingWebhookConfiguration and MutatingWebhookConfiguration
webhookConfig.objectSelectorobject{}objectSelector for the ValidatingWebhookConfiguration and MutatingWebhookConfiguration
webhookConfig.ruleslist[]An array of additional rules for the ValidatingWebhookConfiguration and MutatingWebhookConfiguration. Each requires a set of apiGroups, apiVersions, operations, resources, and a scope. Rules specified here may also be granted to the Insights OPA plugin, see also the insights-agent chart values for opa.
webhookConfig.defaultRuleslist[{"apiGroups":["apps"],"apiVersions":["v1","v1beta1","v1beta2"],"operations":["CREATE","UPDATE"],"resources":["daemonsets","deployments","statefulsets"],"scope":"Namespaced"},{"apiGroups":["batch"],"apiVersions":["v1","v1beta1"],"operations":["CREATE","UPDATE"],"resources":["jobs","cronjobs"],"scope":"Namespaced"},{"apiGroups":[""],"apiVersions":["v1"],"operations":["CREATE","UPDATE"],"resources":["pods","replicationcontrollers"],"scope":"Namespaced"}]An array of rules for commons types for the ValidatingWebhookConfiguration and MutatingWebhookConfiguration
webhookConfig.rulesAutoRBACbooltrueAutomatically add RBAC rules allowing get and list operations for the APIGroups and Resources supplied in rules. This does not impact RBAC rules added for defaultRules.
webhookConfig.mutating.enableboolfalseEnable the mutating webhook, which uses settings defined in webhookConfig values.
pluto.targetVersionsstring""Pluto target versions specified as key=value[,key=value...]. These supersede all defaults in Pluto version files. If unset, the k8s component will use the current Kubernetes cluster version. For example: k8s=v1.20.0,cert-manager=v1.8.0
resourcesobject{"limits":{"cpu":1,"memory":"2Gi"},"requests":{"cpu":"100m","memory":"128Mi"}}A resources block for the controller.
image.repositorystring"us-docker.pkg.dev/fairwinds-ops/oss/insights-admission-controller"Repository for the Insights Admission Controller image
image.pullPolicystring"Always"imagePullPolicy - Highly recommended to leave this as 'Always'
image.tagstring""The Insights admission controller tag to use. Defaults to the Chart's AppVersion
imagePullSecretslist[]Secrets to use when pulling this image.
replicaCountint2The number of pods to run for the admission contrller.
autoscaling.enabledboolfalseAutoscale instead of a static number of pods running.
autoscaling.minReplicasint2Minimum number of pods to run.
autoscaling.maxReplicasint5Maximum number of pods to run.
autoscaling.targetCPUUtilizationPercentageint80Target CPU to scale towards.
autoscaling.targetMemoryUtilizationPercentagestringnilTarget memory to scale towards.
pdb.enabledbooltrueCreate a Pod Disruption Budget (PDB). This also requires autoscaling.minReplicas > 1 or replicaCount > 1
pdb.minAvailableint1The minimum number of admission controller pods that must still be available after an eviction, expressed as an absolute number or a percentage.
nameOverridestring""Overrides the name of the release.
fullnameOverridestring""Long name of the release to override.
serviceAccount.createbooltrueSpecifies whether a service account should be created
serviceAccount.annotationsobject{}Annotations to add to the service account
serviceAccount.namestring""The name of the service account to use. If not set and create is true, a name is generated using the fullname template
serviceAccount.rbac.viewSecretsboolfalseGrant the admission controller access to view secrets
serviceAccount.rbac.grantRolestringnilGrant the admission controller access to a given role (such as view)
serviceAccount.rbac.additionalAccessstringnilGrant the admission controller access to additional objects. This should contain an array of objects with each having an array of apiGroups, an array of resources, and an array of verbs. Just like a Role.
podAnnotationsobject{}Annotations to add to each pod.
podSecurityContextobject{}Security Context for the entire pod.
securityContextobject{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]},"readOnlyRootFilesystem":true,"runAsNonRoot":true,"runAsUser":15000}Security Context for the container.
service.typestring"ClusterIP"Type of service to create.
service.portint443Port to use for the service.
service.usePod443boolfalseForce binding to port 443 on pods. This is useful for GKE private clusters. Requires running as root
ignoreRequestUsernamesstring"system:addon-manager"Specify a comma-separated list of usernames whos admission-requests will be ignored. This is useful for automation that regularly updates in-cluster resources.
nodeSelectorobject{}nodSelector to add to the controller.
tolerationslist[]Toleratations to add to the controller.
topologySpreadConstraintslist[{"labelSelector":{"matchLabels":{"component":"controller"}},"maxSkew":1,"topologyKey":"topology.kubernetes.io/zone","whenUnsatisfiable":"ScheduleAnyway"},{"labelSelector":{"matchLabels":{"component":"controller"}},"maxSkew":1,"topologyKey":"kubernetes.io/hostname","whenUnsatisfiable":"ScheduleAnyway"}]TopologySpreadConstraints to add to the controller.
affinityobject{}Pod affinity/anti-affinity rules
caBundlestring""If you are providing your own certificate then this is the Certificate Authority for that certificate
secretNamestring""If you are providing your own certificate then this is the name of the secret holding the certificate.
clusterDomainstring"cluster.local"The base domain to use for cluster DNS
certManagerApiVersionstring""If secretName is empty, we assume that you use cert-manager to provision the admission controller certificates. This allows pinning the apiVersion rather than using helm capabilities detection. Useful for gitops tools such as ArgoCD
privateKeyRotationPolicystring"Always"cert-manager Certificate spec.privateKey.rotationPolicy. In cert-manager v1.18.0+ the default is Always (it was Never before). Set explicitly to silence warnings and pin behavior. Use Always to match the new default or Never for the pre-1.18 behavior.
polaris.configstringnilConfiguration for Polaris
testobject{"enabled":false,"image":{"repository":"python","tag":"3.15.2-alpine3.23"}}Used for chart CI only - deploys a test deployment

Deploy insights-admission with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has insights-admission 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 chartinsights-admission is pinned at v2.2.0 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