ntp-exporter

by christianhuth

Helm chartv1.5.1App v2.9.0Verified publisher

Prometheus exporter that checks the drift of Kubernetes node's clock against a given NTP server or servers

About this chart

ntp-exporter

Prometheus exporter that checks the drift of Kubernetes node's clock against a given NTP server or servers

TL;DR;

helm repo add christianhuth https://charts.christianhuth.de
helm repo update
helm install my-release christianhuth/ntp-exporter

Or install it from the OCI registry:

helm install my-release oci://ghcr.io/christianhuth/helm-charts/ntp-exporter

Introduction

This chart bootstraps a NTP-Exporter for Prometheus using the Helm package manager.

Prerequisites

  • Kubernetes 1.19+
  • Prometheus

Installing the Chart

To install the chart with the release name my-release:

helm repo add christianhuth https://charts.christianhuth.de
helm repo update
helm install my-release christianhuth/ntp-exporter

The chart is also published as an OCI artifact which can be installed like this:

helm install my-release oci://ghcr.io/christianhuth/helm-charts/ntp-exporter

These commands deploy the NTP-Exporter on the Kubernetes cluster in the default configuration. The Values section lists the values that can be configured during installation.

Tip: List all releases using helm list

Uninstalling the Chart

To uninstall the my-release deployment:

helm uninstall my-release

The command removes all the Kubernetes components associated with the chart and deletes the release.

Values

KeyTypeDefaultDescription
affinityobject{}Affinity settings for pod assignment
fullnameOverridestring""String to fully override "ntp-exporter.fullname"
image.pullPolicystring"Always"image pull policy
image.registrystring"ghcr.io"image registry
image.repositorystring"sapcc/ntp_exporter"image repository
image.tagstring"v2.9.0"Overrides the image tag
imagePullSecretslist[]If defined, uses a Secret to pull an image from a private Docker registry or repository.
ingress.annotationsobject{}
ingress.classNamestring""
ingress.enabledboolfalse
ingress.hosts[0].hoststring"chart-example.local"
ingress.hosts[0].paths[0].pathstring"/"
ingress.hosts[0].paths[0].pathTypestring"ImplementationSpecific"
ingress.tlslist[]
nameOverridestring""Provide a name in place of ntp-exporter
nodeSelectorobject{}Node labels for pod assignment
ntp.config.highDriftThresholdstring"10ms"High drift threshold
ntp.config.measurementDurationstring"30s"Duration of measurements in case of high (>10ms) drift
ntp.config.protocolVersionstring"4"NTP protocol version to use
ntp.exporter.pathstring"/metrics"Path under which to expose metrics
ntp.exporter.portint9559The port the exporter will listen on
ntp.serverstring""NTP server to query for time
ntp.sourcestring"cli"source of information about ntp server. Valid options are cli and http
podAnnotationsobject{}Annotations to be added to pods
podMonitor.additionalLabelsobject{}Prometheus PodMonitor labels
podMonitor.enabledboolfalseEnable a prometheus PodMonitor
podMonitor.intervalstring"30s"Prometheus PodMonitor interval
podMonitor.metricRelabelingslist[]Prometheus [MetricRelabelConfigs] to apply to samples before ingestion
podMonitor.namespacestring""Prometheus PodMonitor namespace
podMonitor.relabelings[0].actionstring"replace"
podMonitor.relabelings[0].sourceLabels[0]string"__meta_kubernetes_pod_node_name"
podMonitor.relabelings[0].targetLabelstring"node"
podMonitor.scrapeTimeoutstring""Prometheus PodMonitor scrapeTimeout, cannot be longer than the scrape interval
podMonitor.selectorobject{}Prometheus PodMonitor selector
podSecurityContextobjectsee values.yamlpod-level security context
prometheusRule.defaultRules.absence.enabledbooltrueEnable the rule that alerts if no metrics are scraped from ntp-exporter
prometheusRule.defaultRules.absence.ruleobjectsee values.yaml for definitionThe rule definition for clock drift alerting
prometheusRule.defaultRules.clockDrift.enabledbooltrueEnable the rule that alerts on high clock drift
prometheusRule.defaultRules.clockDrift.ruleobjectsee values.yaml for definitionThe rule definition for clock drift alerting
prometheusRule.defaultRules.enabledbooltrueEnable the default rules that alert on clock drift and metrics absence
prometheusRule.enabledboolfalseEnable a PrometheusRule
prometheusRule.ruleslist[]List of additional rules
resourcesobjectsee values.yamlResource limits and requests for the headwind pods.
route.main.additionalRuleslist[]Additional custom rules that can be added to the route
route.main.annotationsobject{}Add annotations to the route
route.main.apiVersionstring"gateway.networking.k8s.io/v1"Set the route apiVersion, e.g. gateway.networking.k8s.io/v1 or gateway.networking.k8s.io/v1alpha2
route.main.enabledboolfalseEnables or disables the route
route.main.filterslist[]Filters define the filters that are applied to requests that match this rule.
route.main.hostnameslist[]Hostnames to be matched
route.main.httpsRedirectboolfalseadds a filter for redirecting to https (HTTP 301 Moved Permanently). To redirect HTTP traffic to HTTPS, you need to have a Gateway with both HTTP and HTTPS listeners. Matches and filters do not take effect if enabled. Ref. https://gateway-api.sigs.k8s.io/guides/http-redirect-rewrite/
route.main.kindstring"HTTPRoute"Set the route kind Valid options are GRPCRoute, HTTPRoute, TCPRoute, TLSRoute, UDPRoute
route.main.labelsobject{}Add labels to the route
route.main.matcheslistsee values.yamldefine conditions used for matching the rule against incoming HTTP requests.
route.main.parentRefslist[]Parent references (Gateway)
route.main.timeoutsobject{}defines the timeouts that can be configured for an HTTP request
securityContextobjectsee values.yamlcontainer-level security context
service.portint80Kubernetes port where service is exposed
service.typestring"ClusterIP"Kubernetes service type
serviceAccount.annotationsobject{}Annotations to add to the service account
serviceAccount.createbooltrueSpecifies whether a service account should be created
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
tolerationslistsee values.yamlToleration labels for pod assignment
updateStrategyobject{}Update strategy for the DaemonSet

Specify each parameter using the --set key=value[,key=value] argument to helm install.

Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,

helm install my-release -f values.yaml christianhuth/ntp-exporter

Deploy ntp-exporter with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has ntp-exporter 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 chartntp-exporter is pinned at v1.5.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