Skip to content

Commit

Permalink
[stable/prometheus-mongodb-exporter] Remove service & bump to v0.7.0 (h…
Browse files Browse the repository at this point in the history
…elm#12796)

Signed-off-by: Steven Sheehy <ssheehy@firescope.com>
  • Loading branch information
Steven Sheehy authored and devnulled committed Apr 25, 2019
1 parent 4b1902b commit 2e28ae9
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 80 deletions.
4 changes: 2 additions & 2 deletions stable/prometheus-mongodb-exporter/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v1
appVersion: "v0.6.1"
appVersion: "v0.7.0"
description: A Prometheus exporter for MongoDB metrics
home: https://github.com/percona/mongodb_exporter
keywords:
Expand All @@ -13,4 +13,4 @@ maintainers:
name: prometheus-mongodb-exporter
sources:
- https://github.com/percona/mongodb_exporter
version: 1.1.1
version: 2.0.0
18 changes: 8 additions & 10 deletions stable/prometheus-mongodb-exporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@ connecting to either a MongoDB replica set member, shard, or standalone instance

The chart comes with a ServiceMonitor for use with the [Prometheus Operator](https://github.com/helm/charts/tree/master/stable/prometheus-operator).
If you're not using the Prometheus Operator, you can disable the ServiceMonitor by setting `serviceMonitor.enabled` to `false` and instead
populate the `service.annotations` as below:
populate the `podAnnotations` as below:

```yaml
service:
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "9216"
podAnnotations:
prometheus.io/scrape: "true"
prometheus.io/port: "metrics"
```
## Configuration
Expand All @@ -39,20 +38,19 @@ service:
| `extraArgs` | The extra command line arguments to pass to the MongoDB Exporter | See values.yaml |
| `fullnameOverride` | Override the full chart name | `` |
| `image.pullPolicy` | MongoDB Exporter image pull policy | `IfNotPresent` |
| `image.repository` | MongoDB Exporter image name | `ssalaues/mongodb-exporter` |
| `image.tag` | MongoDB Exporter image tag | `0.6.1` |
| `image.repository` | MongoDB Exporter image name | `ssheehy/mongodb-exporter` |
| `image.tag` | MongoDB Exporter image tag | `0.7.0` |
| `imagePullSecrets` | List of container registry secrets | `[]` |
| `mongodb.uri` | The required [URI](https://docs.mongodb.com/manual/reference/connection-string) to connect to MongoDB | `` |
| `nameOverride` | Override the application name | `` |
| `nodeSelector` | Node labels for pod assignment | `{}` |
| `podAnnotations` | Annotations to be added to all pods | `{}` |
| `port` | The container port to listen on | `9216` |
| `priorityClassName` | Pod priority class name | `` |
| `replicas` | Number of replicas in the replica set | `1` |
| `resources` | Pod resource requests and limits | `{}` |
| `env` | Extra environment variables passed to pod | `{}` |
| `securityContext` | Security context for the pod | See values.yaml |
| `service.annotations` | Annotations to be added to the service | `{}` |
| `service.port` | The port to expose | `9216` |
| `service.type` | The type of service to expose | `ClusterIP` |
| `serviceMonitor.enabled` | Set to true if using the Prometheus Operator | `true` |
| `serviceMonitor.interval` | Interval at which metrics should be scraped | `30s` |
| `serviceMonitor.scrapeTimeout` | Interval at which metric scrapes should time out | `10s` |
Expand Down
14 changes: 2 additions & 12 deletions stable/prometheus-mongodb-exporter/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
Verify the application is working by running these commands:
{{if contains "NodePort" .Values.service.type }}
NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "prometheus-mongodb-exporter.fullname" . }})
curl http://$NODE_IP:$NODE_PORT/metrics
{{- else if contains "LoadBalancer" .Values.service.type }}
# NOTE: It may take a few minutes for the LoadBalancer IP to be available.
SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "prometheus-mongodb-exporter.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
curl http://$SERVICE_IP:{{ .Values.service.port }}/metrics
{{- else if contains "ClusterIP" .Values.service.type }}
kubectl port-forward service/{{ include "prometheus-mongodb-exporter.fullname" . }} {{ .Values.service.port }}
curl http://127.0.0.1:{{ .Values.service.port }}/metrics
{{- end }}
kubectl port-forward deployment/{{ include "prometheus-mongodb-exporter.fullname" . }} {{ .Values.port }}
curl http://127.0.0.1:{{ .Values.port }}/metrics
7 changes: 5 additions & 2 deletions stable/prometheus-mongodb-exporter/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ spec:
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
annotations:
{{- toYaml .Values.podAnnotations | nindent 8 }}
labels:
app.kubernetes.io/name: {{ include "prometheus-mongodb-exporter.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
Expand All @@ -33,11 +35,12 @@ spec:
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- -mongodb.uri={{ required "A MongoDB URI is required" .Values.mongodb.uri }}
- --mongodb.uri={{ required "A MongoDB URI is required" .Values.mongodb.uri }}
- --web.listen-address={{ printf ":%s" .Values.port }}
{{- toYaml .Values.extraArgs | nindent 8 }}
ports:
- name: metrics
containerPort: 9216
containerPort: {{ .Values.port }}
protocol: TCP
livenessProbe:
{{- toYaml .Values.livenessProbe | nindent 10 }}
Expand Down
22 changes: 0 additions & 22 deletions stable/prometheus-mongodb-exporter/templates/service.yaml

This file was deleted.

This file was deleted.

28 changes: 14 additions & 14 deletions stable/prometheus-mongodb-exporter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ affinity: {}
annotations: {}

extraArgs:
- -collect.collection=true
- -collect.database=true
- -collect.indexusage=true
- -collect.topmetrics=true
- --collect.collection
- --collect.database
- --collect.indexusage
- --collect.topmetrics

fullnameOverride: ""

image:
pullPolicy: IfNotPresent
repository: ssalaues/mongodb-exporter
tag: 0.6.1
repository: ssheehy/mongodb-exporter
tag: 0.7.0

imagePullSecrets: []

Expand All @@ -23,14 +23,20 @@ livenessProbe:
port: metrics
initialDelaySeconds: 10

# mongodb://metrics-user:password@mongodb:27017
# [mongodb://][user:pass@]host1[:port1][,host2[:port2],...][/database][?options]
mongodb:
uri:

nameOverride: ""

nodeSelector: {}

podAnnotations: {}
# prometheus.io/scrape: "true"
# prometheus.io/port: "metrics"

port: "9216"

priorityClassName: ""

readinessProbe:
Expand All @@ -57,16 +63,10 @@ securityContext:
capabilities:
drop: ["all"]
readOnlyRootFilesystem: true
runAsGroup: 10000
runAsNonRoot: true
runAsUser: 10000

service:
annotations: {}
# prometheus.io/scrape: "true"
# prometheus.io/port: "9216"
port: 9216
type: ClusterIP

serviceMonitor:
enabled: true
interval: 30s
Expand Down

0 comments on commit 2e28ae9

Please sign in to comment.