prometheus-cloudwatch-exporter

by joaquinito2051

Helm chartv0.4.5App 0.5.0

A Helm chart for prometheus cloudwatch-exporter

About this chart

Cloudwatch exporter

TL;DR;

$ helm install <helm-repo>/prometheus-cloudwatch-exporter

$ helm install stable/prometheus-cloudwatch-exporter

Introduction

This chart bootstraps a cloudwatch exporter deployment on a Kubernetes cluster using the Helm package manager.

Prerequisites

  • kube2iam installed to used the aws.role config option otherwise configure aws.aws_access_key_id and aws.aws_secret_access_key or aws.secret.name

Installing the Chart

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

$ # pass AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY as values
$ helm install --name my-release <helm-repo>/prometheus-cloudwatch-exporter --set aws.aws_access_key_id=$AWS_ACCESS_KEY_ID,aws.aws_secret_access_key=$AWS_SECRET_ACCESS_KEY

$ # or store them in a secret and pass its name as a value
$ helm install --name my-release stable/prometheus-cloudwatch-exporter --set aws.aws_access_key_id=$AWS_ACCESS_KEY_ID,aws.aws_secret_access_key=$AWS_SECRET_ACCESS_KEY
$ kubectl create secret generic <SECRET_NAME> --from-literal=access_key=$AWS_ACCESS_KEY_ID --from-literal=secret_key=$AWS_SECRET_ACCESS_KEY
$ helm install --name my-release <helm-repo>/prometheus-cloudwatch-exporter --set aws.secret.name=<SECRET_NAME>

$ # or add a role to aws with the [correct policy](https://github.com/prometheus/cloudwatch_exporter#credentials-and-permissions) to add to cloud watch and pass its name as a value
$ helm install --name my-release stable/prometheus-cloudwatch-exporter --set aws.secret.name=<SECRET_NAME>
$ helm install --name my-release <helm-repo>/prometheus-cloudwatch-exporter --set awsRole=<ROLL_NAME>

$ helm install --name my-release stable/prometheus-cloudwatch-exporter --set awsRole=<ROLL_NAME> The command deploys Cloudwatch exporter on the Kubernetes cluster in the default configuration. The configuration section lists the parameters that can be configured during installation.

Uninstalling the Chart

To uninstall/delete the my-release deployment:

$ helm delete my-release

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 Cloudwatch Exporter chart and their default values.

ParameterDescriptionDefault
image.repositoryImageprom/cloudwatch-exporter
image.tagImage tagcloudwatch_exporter-0.5.0
image.pullPolicyImage pull policyIfNotPresent
service.typeService typeClusterIP
service.portThe service port80
service.portNameThe name of the service porthttp
service.annotationsCustom annotations for service{}
service.labelsAdditional custom labels for the service{}
resources{}
aws.roleAWS IAM Role To Use
aws.aws_access_key_idAWS access key id
aws.aws_secret_access_keyAWS secret access key
aws.secret.nameThe name of a pre-created secret in which AWS credentials are stored
aws.secret.includesSessionTokenWhether or not the pre-created secret contains an AWS STS session token
configCloudwatch exporter configurationexample configuration
rbac.createIf true, create & use RBAC resourcesfalse
serviceAccount.createSpecifies whether a service account should be created.true
serviceAccount.nameName of the service account.
tolerationsAdd tolerations[]
nodeSelectornode labels for pod assignment{}
affinitynode/pod affinities{}
livenessProbeLiveness probe settings
readinessProbeReadiness probe settings
servicemonitor.enabledUse servicemonitor from prometheus operatorfalse
servicemonitor.namespaceNamespace thes Servicemonitor is installed in
servicemonitor.intervalHow frequently Prometheus should scrape
servicemonitor.telemetryPathpath to cloudwatch-exporter telemtery-path
servicemonitor.labelslabels for the ServiceMonitor passed to Prometheus Operator{}
servicemonitor.timeoutTimeout after which the scrape is ended
ingress.enabledEnables Ingressfalse
ingress.annotationsIngress annotations{}
ingress.labelsCustom labels{}
ingress.hostsIngress accepted hostnames[]
ingress.tlsIngress TLS configuration[]

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

Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
$ helm install --name my-release \
    --set aws.role=my-aws-role \
    <helm-repo>/prometheus-cloudwatch-exporter
$ helm install --name my-release \

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

$ helm install --name my-release -f values.yaml <helm-repo>/prometheus-cloudwatch-exporter

Deploy prometheus-cloudwatch-exporter with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has prometheus-cloudwatch-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 chartprometheus-cloudwatch-exporter is pinned at v0.4.5 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