polaris

by Fairwinds

Helm chartv6.0.1App 10.2.4Verified publisher

Validation of best practices in your Kubernetes clusters

About this chart

Polaris

Polaris is a tool for auditing and enforcing best practices in Kubernetes.

Installation

We recommend installing polaris in its own namespace.

Dashboard

helm repo add fairwinds-stable https://charts.fairwinds.com/stable
helm install polaris fairwinds-stable/polaris --namespace polaris

Webhook

A valid TLS certificate is required for the Polaris Validating Webhook. If you have cert-manager installed in your cluster then the helm install below will work.

If you don't use cert-manager, you'll need to:

  • Supply a CA Bundle with the webhook.caBundle
  • Create a TLS secret in your cluster with a valid certificate that uses that CA
  • Pass the name of that secret with the webhook.secretName parameter.
helm repo add fairwinds-stable https://charts.fairwinds.com/stable
helm install polaris fairwinds-stable/polaris --namespace polaris --set webhook.enable=true --set dashboard.enable=false

A Note on Chart Version 0.10.0+

Due to the deprecation of various extensions/v1beta1 API's, the 0.10.0 version of this chart will only work on kubernetes 1.14.0+

Values

KeyTypeDefaultDescription
configstringnilThe polaris configuration. If not provided then the default config from Polaris is used.
configUrlstringnilUse a config from an accessible URL source. NOTE: config & configUrl are mutually exclusive. Setting configURL will take precedence over config. Only one may be used. configUrl: https://example.com/config.yaml
additionalExemptionsstringnilList of additional exemptions to append to the exemptions given in config
mergeConfigboolfalseIf the config should be merged with the default config. See https://github.com/FairwindsOps/polaris/pull/1075
image.repositorystring"us-docker.pkg.dev/fairwinds-ops/oss/polaris"Image repo
image.tagstring""The Polaris Image tag to use. Defaults to the Chart's AppVersion
image.pullPolicystring"Always"Image pull policy
image.pullSecretslist[]Image pull secrets
rbac.enabledbooltrueWhether RBAC resources (ClusterRole, ClusterRolebinding) should be created
serviceAccount.createbooltrueSpecifies whether a service account should be created
serviceAccount.namestringnilThe name of the service account to use.
templateOnlyboolfalseOutputs Namespace names, used with helm template
dashboard.basePathstringnilPath on which the dashboard is served. Defaults to /
dashboard.enablebooltrueWhether to run the dashboard.
dashboard.portint8080Port that the dashboard will run from.
dashboard.listeningAddressstringnilDashboard listerning address.
dashboard.replicasint2Number of replicas to run.
dashboard.logLevelstring"Info"Set the logging level for the Dashboard command
dashboard.podAdditionalLabelsobject{}Custom additional labels on dashboard pods.
dashboard.deploymentAnnotationsobject{}Custom additional annotations on dashboard Deployment.
dashboard.resourcesobject{"limits":{},"requests":{"cpu":"100m","memory":"128Mi"}}Requests and limits for the dashboard
dashboard.extraContainerslist[]allows injecting additional containers.
dashboard.service.typestring"ClusterIP"Service Type
dashboard.service.annotationsobject{}Service annotations
dashboard.service.targetPortstringnilService targetport, defaults to dashboard.port
dashboard.service.loadBalancerSourceRangeslist[]List of allowed CIDR values
dashboard.nodeSelectorobject{}Dashboard pod nodeSelector
dashboard.tolerationslist[]Dashboard pod tolerations
dashboard.affinityobject{}Dashboard pods affinity
dashboard.topologySpreadConstraintslist[{"labelSelector":{"matchLabels":{"component":"dashboard"}},"maxSkew":1,"topologyKey":"topology.kubernetes.io/zone","whenUnsatisfiable":"ScheduleAnyway"},{"labelSelector":{"matchLabels":{"component":"dashboard"}},"maxSkew":1,"topologyKey":"kubernetes.io/hostname","whenUnsatisfiable":"ScheduleAnyway"}]Dashboard pods topologySpreadConstraints
dashboard.ingress.enabledboolfalseWhether to enable ingress to the dashboard
dashboard.ingress.ingressClassNamestringnilFrom Kubernetes 1.18+ this field is supported in case your ingress controller supports it. When set, you do not need to add the ingress class as annotation.
dashboard.ingress.hostslist[]Web ingress hostnames
dashboard.ingress.annotationsobject{}Web ingress annotations
dashboard.ingress.tlslist[]Ingress TLS configuration
dashboard.ingress.defaultBackendEnabledboolfalseDefaultBackend is required by GKE container native load balancer, set to true for this use case
dashboard.priorityClassNamestringnilPriority Class name to be used in deployment if provided.
dashboard.disallowExemptionsboolfalseDisallow any exemption
dashboard.disallowConfigExemptionsboolfalseDisallow exemptions that are configured in the config file
dashboard.disallowAnnotationExemptionsboolfalseDisallow exemptions that are configured via annotations
dashboard.containerSecurityContextobject{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]},"privileged":false,"readOnlyRootFilesystem":true,"runAsNonRoot":true}securityContext to apply to the dashboard container
dashboard.pdb.enablebooltrueIf true, enables a PDB for the dashboard
webhook.enableboolfalseWhether to run the webhook
webhook.validatebooltrueEnables the Validating Webhook, to reject resources with issues
webhook.mutateboolfalseEnables the Mutating Webhook, to modify resources with issues
webhook.replicasint2Number of replicas
webhook.logLevelstring"info"Set the logging level for the Webhook command
webhook.nodeSelectorobject{}Webhook pod nodeSelector
webhook.tolerationslist[]Webhook pod tolerations
webhook.affinityobject{}Webhook pods affinity
webhook.topologySpreadConstraintslist[{"labelSelector":{"matchLabels":{"component":"webhook"}},"maxSkew":1,"topologyKey":"topology.kubernetes.io/zone","whenUnsatisfiable":"ScheduleAnyway"},{"labelSelector":{"matchLabels":{"component":"webhook"}},"maxSkew":1,"topologyKey":"kubernetes.io/hostname","whenUnsatisfiable":"ScheduleAnyway"}]Webhook pods topologySpreadConstraints
webhook.certManager.apiVersionstring""Allows overriding .Capabilities.APIVersions with a specified version. Useful for GitOps.
webhook.caBundlestringnilCA Bundle to use for Validating Webhook instead of cert-manager
webhook.secretNamestringnilName of the secret containing a TLS certificate to use if cert-manager is not used.
webhook.failurePolicystring"Fail"failurePolicy for the ValidatingWebhookConfiguration
webhook.matchPolicystring"Exact"matchPolicy for the ValidatingWebhookConfiguration
webhook.namespaceSelectorobject{"matchExpressions":[{"key":"control-plane","operator":"DoesNotExist"}]}namespaceSelector for the ValidatingWebhookConfiguration
webhook.objectSelectorobject{}objectSelector for the ValidatingWebhookConfiguration
webhook.ruleslist[]An array of additional rules for the ValidatingWebhookConfiguration. Each requires a set of apiGroups, apiVersions, operations, resources, and a scope.
webhook.mutatingRuleslist[]An array of additional rules for the MutatingWebhookConfiguration. Each requires a set of apiGroups, apiVersions, operations, resources, and a scope.
webhook.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 common types for the ValidatingWebhookConfiguration
webhook.podAdditionalLabelsobject{}Custom additional labels on webhook pods.
webhook.deploymentAnnotationsobject{}Custom additional annotations on webhook Deployment.
webhook.resourcesobject{"limits":{},"requests":{"cpu":"100m","memory":"128Mi"}}Requests and limits for the webhook.
webhook.priorityClassNamestringnilPriority Class name to be used in deployment if provided.
webhook.disallowExemptionsboolfalseDisallow any exemption
webhook.disallowConfigExemptionsboolfalseDisallow exemptions that are configured in the config file
webhook.disallowAnnotationExemptionsboolfalseDisallow exemptions that are configured via annotations
webhook.mutatingConfigurationAnnotationsobject{}
webhook.validatingConfigurationAnnotationsobject{}
webhook.pdb.enablebooltrueIf true, enables a PDB for the webhook
audit.enableboolfalseRuns a one-time audit. This is used internally at Fairwinds, and may not be useful for others.
audit.cleanupboolfalseWhether to delete the namespace once the audit is finished.
audit.outputURLstring""A URL which will receive a POST request with audit results.

Deploy polaris with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has polaris 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 chartpolaris is pinned at v6.0.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