promitor-agent-resource-discovery

by Promitor

Helm chartv0.16.1App 0.16.1MITVerified publisherOfficial

Automatically discover Azure resources to be scraped by Promitor Scraper agent.

About this chart

Promitor

Promitor is an Azure Monitor scraper which makes the metrics available for metric systems such as Atlassian Statuspage, Prometheus and StatsD.

TL;DR

helm repo add promitor https://charts.promitor.io/
helm repo update
helm install promitor-agent-resource-discovery promitor/promitor-agent-resource-discovery

Introduction

This chart bootstraps a Promitor Scraper Agent deployment on a Kubernetes cluster using the Helm package manager. It will provide the scraper agent with a Kubernetes Service so that other Pods can consume it.

Prerequisites

  • Kubernetes v1.9 or above
  • Azure Subscription
  • Azure AD Application to authenticate with (docs)

Installing the Chart

To install the chart with the release name promitor-agent-resource-discovery:

$ helm install promitor-agent-resource-discovery promitor/promitor-agent-resource-discovery \
               --set azureAuthentication.identity.mode='ServicePrincipal' \
               --set azureAuthentication.identity.id='<azure-ad-app-id>' \
               --set azureAuthentication.identity.key='<azure-ad-app-key>' \
               --values /path/to/metric-declaration.yaml

The command deploys Prometheus on the Kubernetes cluster with the specified metrics declaration, for more information see our documentation.

Uninstalling the Chart

To uninstall/delete the promitor-agent-resource-discovery deployment:

helm uninstall promitor-agent-resource-discovery

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

Configuration

The following table lists the configurable parameters of the Promitor chart and their default values.

ParameterDescriptionDefault
image.repositoryRepository which provides the imagecontainers.promitor.io/tomkerkhove/promitor-agent-resource-discovery
image.tagTag of image to useNone, chart app version is used by default
image.pullPolicyPolicy to pull imageAlways
image.pullSecretsImagePullSecrets for the pod[]
azureLandscape.cloudAzure Cloud to discover resources in. Options are Global (default), China, UsGov & GermanyGlobal
azureLandscape.tenantIdId of Azure tenant to discover resources in
azureLandscape.subscriptionsList of Azure subscription ids to discover resources in[]
resourceDiscoveryGroupsList of resource discovery groups to configured following the resource discovery declaration docs
azureAuthentication.appId[Deprecated] Use azureAuthentication.identity.id instead
azureAuthentication.appKey[Deprecated] Use azureAuthentication.identity.key instead
azureAuthentication.modeAuthentication mode option for Azure authentication. Options are ServicePrincipal (default), UserAssignedManagedIdentity or SystemAssignedManagedIdentity
azureAuthentication.identity.idId of the Azure AD entity to authenticate with
azureAuthentication.identity.keySecret of the Azure AD entity to authenticate with, when using mode ServicePrincipal (default) or UserAssignedManagedIdentity
azureAuthentication.identity.bindingAad Pod Identity name, when using UserAssignedManagedIdentity or SystemAssignedManagedIdentity as mode
prometheus.enabledIndication whether or not metrics should be exposed as a Prometheus scraping endpointtrue
prometheus.enableServiceDiscoveryIndication whether or not service discovery with annotations should be enabled (docs)true
prometheus.serviceMonitor.enabledIndication whether or not to create a ServiceMonitor object for Prometheus Operatorfalse
prometheus.serviceMonitor.namespaceThe namespace where the ServiceMonitor should be created
prometheus.serviceMonitor.labelsLabels for the ServiceMonitor{}
prometheus.serviceMonitor.intervalHow often Prometheus should scrape60s
prometheus.serviceMonitor.timeoutTimeout for the scraping operation10s
cache.enabledIndication whether or not discovered resources should be cached in-memory to avoid Azure throttlingtrue
cache.durationInMinutesAmount of minutes to cache discovered resources5
telemetry.applicationInsights.enabledIndication whether or not to send telemetry to Azure Application Insightsfalse
telemetry.applicationInsights.logLevelMinimum level of logging for Azure Application Insights
telemetry.applicationInsights.keyApplication Insights instrumentation key
telemetry.containerLogs.enabledIndication whether or not to send telemetry to container logstrue
telemetry.containerLogs.logLevelMinimum level of logging for container logs
telemetry.defaultLogLevelMinimum level of logging for all telemetry sinks, unless specified otherwiseError
rbac.createIf true, create & use RBAC resourcestrue
rbac.podSecurityPolicyEnabledCreate pod security policy resourcesfalse
rbac.serviceAccount.createCreate service account resourcetrue
rbac.serviceAccount.nameService account name to use if create is false. If create is true, a name is generated using the fullname templatepromitor-resource-discovery
rbac.serviceAccount.annotationsService account annotations{}
rbac.serviceAccount.automountServiceAccountTokenIf service account token should be mounted inside podfalse
health.readiness.enabledIndication if readiness probes should be usedtrue
health.readiness.verifyDependenciesIndication if readiness probes should verify if Promitor can interat with external dependencies. Do note that this will contact all dependencies which can have performance impact, cause throttling or cascading failures when consumed very often.false
health.readiness.delayAmount of seconds to wait before probing the container to verify if it's ready5
health.readiness.intervalAmount of seconds to wait before probing the container again to verify if it's ready after the last attempt5
health.readiness.thresholds.failureNumber of retries after first failed check before container will be marked Unready3
health.readiness.thresholds.successMinimum consecutive successes for the probe to be considered successful after having failed1
health.readiness.timeoutSecondsAmount of seconds after which the probe times out1
health.liveness.enabledIndication if liveness probes should be usedtrue
health.liveness.verifyDependenciesIndication if liveness probes should verify if Promitor can interat with external dependencies. Do note that this will contact all dependencies which can have performance impact, cause throttling or cascading failures when consumed very often.false
health.liveness.delayAmount of seconds to wait before probing the container to verify if it's still alive5
health.liveness.intervalAmount of seconds to wait before probing the container again to verify if it's still alive after the last attempt30
health.liveness.thresholds.failureNumber of retries after first failed check before container restart3
health.liveness.thresholds.successMinimum consecutive successes for the probe to be considered successful after having failed1
health.liveness.timeoutSecondsAmount of seconds after which the probe times out1
affinityAffinity settings (docs){}
nodeSelectorNode labels for pod assignment{}
podLabelsAdditional pod labels to include{}
annotationsAdditional annotations to include{}
priorityClassNamePriority class to be used by pod (docs)""
securityContext.enabledWhether to include custom security context for pod or nottrue
securityContext.*Custom security context object for pod (docs)runAsGroup: 10000runAsNonRoot: truerunAsUser: 10000seccompProfile: type: RuntimeDefault
containerSecurityContext.enabledWhether to include custom security context for container or nottrue
containerSecurityContext.*Custom security context object for container (docs)allowPrivilegeEscalation: falsecapabilities: drop: - ALLprivileged: falsereadOnlyRootFilesystem: true
tolerationsTolerations for pod assignment[]
extraVolumeMountsPass extra volumeMounts to the promitor container[]
extraVolumesPass extra volumes to the promitor deployment[]
resourcesPod resource requests & limits{}
secrets.createSecretIndication if you want to bring your own secret level of loggingtrue
secrets.secretNameName of the secret for Azure AD identity secret""
secrets.appKeySecretName of the secret key for Azure AD identity secretazure-app-key
secrets.extraAdd extra secrets{}
service.loadbalancer.enabledIndication whether or not to expose service externally through a load balancerfalse
service.loadbalancer.azure.dnsPrefixPrefix for DNS name to expose the service on using <name>.<location>.cloudapp.azure.com format. This setting is specific to Azure Kubernetes Service (docs)``
service.loadbalancer.azure.exposeInternallyTo restrict access to Promitor by exposing it through an internal load balancer. This setting is specific to Azure Kubernetes Service (docs)false
service.portPort on service for other pods to talk to8889
service.targetPortPort on container to serve traffic5000
deployment.env.extraAdd extra environment variables to the promitor deployment[]

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

$ helm install promitor-agent-resource-discovery promitor/promitor-agent-resource-discovery \
               --set azureAuthentication.identity.mode='ServicePrincipal' \
               --set azureAuthentication.identity.id='<azure-ad-app-id>' \
               --set azureAuthentication.identity.key='<azure-ad-app-key>' \
               --set azureLandscape.tenantId='<azure-tenant-id>' \
               --set azureLandscape.subscriptionId='<azure-subscription-id>' \
               --values C:\Promitor\metric-declaration.yaml

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

helm install promitor-agent-resource-discovery promitor/promitor-agent-resource-discovery -f values.yaml

Deploy promitor-agent-resource-discovery with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has promitor-agent-resource-discovery 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 chartpromitor-agent-resource-discovery is pinned at v0.16.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