diff --git a/stable/prometheus-mongodb-exporter/Chart.yaml b/stable/prometheus-mongodb-exporter/Chart.yaml index 861a071f5c66..9b7ac15ba1d8 100644 --- a/stable/prometheus-mongodb-exporter/Chart.yaml +++ b/stable/prometheus-mongodb-exporter/Chart.yaml @@ -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: @@ -13,4 +13,4 @@ maintainers: name: prometheus-mongodb-exporter sources: - https://github.com/percona/mongodb_exporter -version: 1.1.1 +version: 2.0.0 diff --git a/stable/prometheus-mongodb-exporter/README.md b/stable/prometheus-mongodb-exporter/README.md index 7aa574aa22c0..85113e5da60c 100644 --- a/stable/prometheus-mongodb-exporter/README.md +++ b/stable/prometheus-mongodb-exporter/README.md @@ -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 @@ -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` | diff --git a/stable/prometheus-mongodb-exporter/templates/NOTES.txt b/stable/prometheus-mongodb-exporter/templates/NOTES.txt index 3ebe6e520780..3fb9a92ac788 100644 --- a/stable/prometheus-mongodb-exporter/templates/NOTES.txt +++ b/stable/prometheus-mongodb-exporter/templates/NOTES.txt @@ -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 diff --git a/stable/prometheus-mongodb-exporter/templates/deployment.yaml b/stable/prometheus-mongodb-exporter/templates/deployment.yaml index dd21e9565820..63eb660cd47c 100644 --- a/stable/prometheus-mongodb-exporter/templates/deployment.yaml +++ b/stable/prometheus-mongodb-exporter/templates/deployment.yaml @@ -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 }} @@ -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 }} diff --git a/stable/prometheus-mongodb-exporter/templates/service.yaml b/stable/prometheus-mongodb-exporter/templates/service.yaml deleted file mode 100644 index f98dc9667da4..000000000000 --- a/stable/prometheus-mongodb-exporter/templates/service.yaml +++ /dev/null @@ -1,22 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ include "prometheus-mongodb-exporter.fullname" . }} - labels: - app.kubernetes.io/name: {{ include "prometheus-mongodb-exporter.name" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - helm.sh/chart: {{ include "prometheus-mongodb-exporter.chart" . }} - annotations: - {{- toYaml .Values.service.annotations | nindent 4 }} -spec: - ports: - - name: metrics - port: {{ .Values.service.port }} - protocol: TCP - targetPort: metrics - selector: - app.kubernetes.io/name: {{ include "prometheus-mongodb-exporter.name" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - type: {{ .Values.service.type }} - diff --git a/stable/prometheus-mongodb-exporter/templates/tests/test-connection.yaml b/stable/prometheus-mongodb-exporter/templates/tests/test-connection.yaml deleted file mode 100644 index 2bc3c4692f1b..000000000000 --- a/stable/prometheus-mongodb-exporter/templates/tests/test-connection.yaml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: "{{ include "prometheus-mongodb-exporter.fullname" . }}-test-connection" - labels: - app.kubernetes.io/name: {{ include "prometheus-mongodb-exporter.name" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - helm.sh/chart: {{ include "prometheus-mongodb-exporter.chart" . }} - annotations: - "helm.sh/hook": test-success -spec: - containers: - - name: wget - image: busybox - command: ['wget'] - args: ['-qO-', '{{ include "prometheus-mongodb-exporter.fullname" . }}:{{ .Values.service.port }}/metrics'] - restartPolicy: Never diff --git a/stable/prometheus-mongodb-exporter/values.yaml b/stable/prometheus-mongodb-exporter/values.yaml index eb85d061726e..d3449a5d07e0 100644 --- a/stable/prometheus-mongodb-exporter/values.yaml +++ b/stable/prometheus-mongodb-exporter/values.yaml @@ -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: [] @@ -23,7 +23,7 @@ livenessProbe: port: metrics initialDelaySeconds: 10 -# mongodb://metrics-user:password@mongodb:27017 +# [mongodb://][user:pass@]host1[:port1][,host2[:port2],...][/database][?options] mongodb: uri: @@ -31,6 +31,12 @@ nameOverride: "" nodeSelector: {} +podAnnotations: {} +# prometheus.io/scrape: "true" +# prometheus.io/port: "metrics" + +port: "9216" + priorityClassName: "" readinessProbe: @@ -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