0.2.4-0.1.0 • Published 5 years ago

@helm-charts/banzaicloud-stable-prometheus-mysql-exporter v0.2.4-0.1.0

Weekly downloads
1
License
MIT
Repository
-
Last release
5 years ago

@helm-charts/banzaicloud-stable-prometheus-mysql-exporter

A Helm chart for prometheus mysql exporter with cloudsqlproxy

FieldValue
Repository Namebanzaicloud-stable
Chart Nameprometheus-mysql-exporter
Chart Version0.2.4
NPM Package Version0.1.0
# Default values for prometheus-mysql-exporter.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

replicaCount: 1

image:
  repository: 'prom/mysqld-exporter'
  tag: 'v0.11.0'
  pullPolicy: 'IfNotPresent'

service:
  name: mysql-exporter
  type: ClusterIP
  externalPort: 9104
  internalPort: 9104

serviceMonitor:
  enabled: true

resources:
  {}
  # We usually recommend not to specify default resources and to leave this as a conscious
  # choice for the user. This also increases chances charts run on environments with little
  # resources, such as Minikube. If you do want to specify resources, uncomment the following
  # lines, adjust them as necessary, and remove the curly braces after 'resources:'.
  # limits:
  #  cpu: 100m
  #  memory: 128Mi
  # requests:
  #  cpu: 100m
  #  memory: 128Mi

nodeSelector: {}

tolerations: []

affinity: {}

annotations:
  prometheus.io/scrape: 'true'
  prometheus.io/path: '/metrics'
  prometheus.io/port: '9104'

# mysql connection params which build the DATA_SOURCE_NAME env var of the docker container
mysql:
  db: ''
  host: 'localhost'
  param: ''
  pass: 'password'
  port: 3306
  protocol: ''
  user: 'exporter'

# cloudsqlproxy https://cloud.google.com/sql/docs/mysql/sql-proxy
cloudsqlproxy:
  enabled: false
  image:
    repo: 'gcr.io/cloudsql-docker/gce-proxy'
    tag: '1.11'
    pullPolicy: 'IfNotPresent'
  instanceConnectionName: 'project:us-central1:dbname'
  port: '3306'
  existingSecret: ''
  existingSecretKey: ''
  credentials: '{
    "type": "service_account",
    "project_id": "project",
    "private_key_id": "KEYID1",
    "private_key": "-----BEGIN PRIVATE KEY-----\sdajsdnasd\n-----END PRIVATE KEY-----\n",
    "client_email": "user@project.iam.gserviceaccount.com",
    "client_id": "111111111",
    "auth_uri": "https://accounts.google.com/o/oauth2/auth",
    "token_uri": "https://accounts.google.com/o/oauth2/token",
    "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
    "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/user%40project.iam.gserviceaccount.com"
    }'

Prometheus Mysql Exporter

TL;DR;

$ helm install stable/prometheus-mysql-exporter

Introduction

This chart bootstraps a prometheus mysql exporter deployment on a Kubernetes cluster using the Helm package manager. The exporter can connect to mysql directly or using the Cloud SQL Proxy.

Installing the Chart

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

$ helm install --name my-release stable/prometheus-mysql-exporter --set datasource="username:password@(db:3306)/"

The command deploys a mysql 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 mysql exporter chart and their default values.

ParameterDescriptionDefault
replicaCountAmount of pods for the deployment1
image.repositoryImage repositoryprom/mysqld-exporter
image.tagImage tagv0.11.0
image.pullPolicyImage pull policyIfNotPresent
service.nameService namemysql-exporter
service.typeService typeClusterIP
service.externalportThe service port9104
service.internalPortThe target port of the container9104
resourcesCPU/Memory resource requests/limits{}
annotationspod annotations for easier discovery{}
mysql.dbMySQL connection db (optional)""
mysql.hostMySQL connection hostlocalhost
mysql.paramMySQL connection parameters (optional)"tcp"
mysql.passMySQL connection passwordpassword
mysql.portMySQL connection port3306
mysql.protocolMySQL connection protocol (optional)""
mysql.userMySQL connection usernameexporter
cloudsqlproxy.enabledFlag to enable the connection using Cloud SQL Proxyfalse
cloudsqlproxy.image.repoCloud SQL Proxy image repositorygcr.io/cloudsql-docker/gce-proxy
cloudsqlproxy.image.tagCloud SQL Proxy image tag1.11
cloudsqlproxy.image.pullPolicyCloud SQL Proxy image pull policyIfNotPresent
cloudsqlproxy.instanceConnectionNameGoogle Cloud instance connection nameproject:us-central1:dbname
cloudsqlproxy.portCloud SQL Proxy listening port3306
cloudsqlproxy.credentialsCloud SQL Proxy service account credentialsbogus credential file

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

$ helm install --name my-release \
  --set mysql.user="username",mysql.password="password",mysql.host="localhost",mysql.port="3306"  \
    stable/prometheus-mysql-exporter

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 stable/prometheus-mysql-exporter

Documentation for the MySQL Exporter can be found here: (https://github.com/prometheus/mysqld_exporter) A mysql params overview can be found here: (https://github.com/go-sql-driver/mysql#dsn-data-source-name)