sidekiq-prometheus-exporter 0.1.12 → 0.1.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +5 -5
  2. data/.github/FUNDING.yml +12 -0
  3. data/.github/workflows/ci.yaml +68 -0
  4. data/.gitignore +3 -1
  5. data/.rubocop.yml +43 -296
  6. data/Appraisals +17 -4
  7. data/README.md +98 -50
  8. data/Rakefile +83 -0
  9. data/docker/Dockerfile +24 -0
  10. data/docker/README.md +61 -0
  11. data/docker/config.ru +41 -0
  12. data/examples/docker-compose.yml +2 -2
  13. data/examples/metrics/config.ru +2 -0
  14. data/examples/screenshot.png +0 -0
  15. data/examples/sidekiq/sidekiq.rb +2 -0
  16. data/examples/{sidekiq.json → sidekiq-dashboard.grafana-6.json} +10 -52
  17. data/examples/sidekiq-dashboard.grafana-7.json +845 -0
  18. data/gemfiles/{sidekiq_3.3.1.gemfile → sidekiq_3.3.1.Gemfile} +2 -1
  19. data/gemfiles/sidekiq_3.3.1.Gemfile.lock +125 -0
  20. data/gemfiles/{sidekiq_3.x.gemfile → sidekiq_3.x.Gemfile} +2 -1
  21. data/gemfiles/{sidekiq_3.x.gemfile.lock → sidekiq_3.x.Gemfile.lock} +63 -61
  22. data/gemfiles/{sidekiq_4.x.gemfile → sidekiq_4.x.Gemfile} +1 -1
  23. data/gemfiles/sidekiq_4.x.Gemfile.lock +101 -0
  24. data/gemfiles/{sidekiq_5.x.gemfile → sidekiq_5.x.Gemfile} +1 -1
  25. data/gemfiles/sidekiq_5.x.Gemfile.lock +100 -0
  26. data/gemfiles/sidekiq_6.x.Gemfile +8 -0
  27. data/gemfiles/sidekiq_6.x.Gemfile.lock +97 -0
  28. data/gemfiles/sidekiq_latest.Gemfile +9 -0
  29. data/gemfiles/sidekiq_latest.Gemfile.lock +113 -0
  30. data/helm/sidekiq-prometheus-exporter/.helmignore +22 -0
  31. data/helm/sidekiq-prometheus-exporter/Chart.yaml +6 -0
  32. data/helm/sidekiq-prometheus-exporter/README.md +87 -0
  33. data/helm/sidekiq-prometheus-exporter/templates/NOTES.txt +15 -0
  34. data/helm/sidekiq-prometheus-exporter/templates/_helpers.tpl +109 -0
  35. data/helm/sidekiq-prometheus-exporter/templates/clusterrole.yaml +20 -0
  36. data/helm/sidekiq-prometheus-exporter/templates/clusterrolebinding.yaml +17 -0
  37. data/helm/sidekiq-prometheus-exporter/templates/deployment.yaml +62 -0
  38. data/helm/sidekiq-prometheus-exporter/templates/service.yaml +17 -0
  39. data/helm/sidekiq-prometheus-exporter/templates/serviceaccount.yaml +9 -0
  40. data/helm/sidekiq-prometheus-exporter/templates/servicemonitor.yaml +26 -0
  41. data/helm/sidekiq-prometheus-exporter/values.yaml +135 -0
  42. data/lib/sidekiq/prometheus/exporter/standard.rb +19 -5
  43. data/lib/sidekiq/prometheus/exporter/templates/standard.erb +13 -1
  44. data/lib/sidekiq/prometheus/exporter/version.rb +1 -1
  45. data/lib/sidekiq/prometheus/exporter.rb +3 -1
  46. data/sidekiq-prometheus-exporter.gemspec +9 -7
  47. metadata +74 -41
  48. data/.codeclimate.yml +0 -16
  49. data/.travis.yml +0 -23
  50. data/gemfiles/sidekiq_3.3.1.gemfile.lock +0 -138
  51. data/gemfiles/sidekiq_4.x.gemfile.lock +0 -101
  52. data/gemfiles/sidekiq_5.x.gemfile.lock +0 -99
@@ -0,0 +1,113 @@
1
+ GIT
2
+ remote: https://github.com/mperham/sidekiq
3
+ revision: 2f049eae5df957786c4e9c0b5b32e0a5acc1c7d1
4
+ specs:
5
+ sidekiq (6.1.3)
6
+ connection_pool (>= 2.2.2)
7
+ rack (~> 2.0)
8
+ redis (>= 4.2.0)
9
+
10
+ GIT
11
+ remote: https://github.com/rack/rack
12
+ revision: a05f8d56f9ac4da14dddb8f312a3b43644f73397
13
+ specs:
14
+ rack (2.3.0)
15
+
16
+ GIT
17
+ remote: https://github.com/redis/redis-rb
18
+ revision: b42d25162d9856a3091ca7830635a95eed9bcb74
19
+ specs:
20
+ redis (4.2.5)
21
+
22
+ PATH
23
+ remote: ..
24
+ specs:
25
+ sidekiq-prometheus-exporter (0.1.15)
26
+ sidekiq (>= 3.3.1)
27
+
28
+ GEM
29
+ remote: https://rubygems.org/
30
+ specs:
31
+ appraisal (2.2.0)
32
+ bundler
33
+ rake
34
+ thor (>= 0.14.0)
35
+ ast (2.4.2)
36
+ byebug (10.0.2)
37
+ coderay (1.1.2)
38
+ connection_pool (2.2.3)
39
+ diff-lcs (1.3)
40
+ method_source (0.9.2)
41
+ parallel (1.21.0)
42
+ parser (3.0.2.0)
43
+ ast (~> 2.4.1)
44
+ pry (0.12.2)
45
+ coderay (~> 1.1.0)
46
+ method_source (~> 0.9.0)
47
+ pry-byebug (3.6.0)
48
+ byebug (~> 10.0)
49
+ pry (~> 0.10)
50
+ rack-test (1.1.0)
51
+ rack (>= 1.0, < 3)
52
+ rainbow (3.0.0)
53
+ rake (13.0.1)
54
+ regexp_parser (2.1.1)
55
+ rexml (3.2.5)
56
+ rspec (3.9.0)
57
+ rspec-core (~> 3.9.0)
58
+ rspec-expectations (~> 3.9.0)
59
+ rspec-mocks (~> 3.9.0)
60
+ rspec-core (3.9.1)
61
+ rspec-support (~> 3.9.1)
62
+ rspec-expectations (3.9.0)
63
+ diff-lcs (>= 1.2.0, < 2.0)
64
+ rspec-support (~> 3.9.0)
65
+ rspec-mocks (3.9.1)
66
+ diff-lcs (>= 1.2.0, < 2.0)
67
+ rspec-support (~> 3.9.0)
68
+ rspec-support (3.9.2)
69
+ rubocop (1.22.3)
70
+ parallel (~> 1.10)
71
+ parser (>= 3.0.0.0)
72
+ rainbow (>= 2.2.2, < 4.0)
73
+ regexp_parser (>= 1.8, < 3.0)
74
+ rexml
75
+ rubocop-ast (>= 1.12.0, < 2.0)
76
+ ruby-progressbar (~> 1.7)
77
+ unicode-display_width (>= 1.4.0, < 3.0)
78
+ rubocop-ast (1.13.0)
79
+ parser (>= 3.0.1.1)
80
+ rubocop-performance (1.12.0)
81
+ rubocop (>= 1.7.0, < 2.0)
82
+ rubocop-ast (>= 0.4.0)
83
+ rubocop-rake (0.6.0)
84
+ rubocop (~> 1.0)
85
+ rubocop-rspec (2.6.0)
86
+ rubocop (~> 1.19)
87
+ ruby-progressbar (1.11.0)
88
+ thor (1.0.1)
89
+ timecop (0.9.1)
90
+ unicode-display_width (2.1.0)
91
+
92
+ PLATFORMS
93
+ ruby
94
+
95
+ DEPENDENCIES
96
+ appraisal (~> 2.2)
97
+ bundler (~> 2.1)
98
+ pry-byebug (~> 3.6)
99
+ rack (>= 2)!
100
+ rack-test (~> 1.1)
101
+ rake (~> 13.0)
102
+ redis (>= 4)!
103
+ rspec (~> 3.0)
104
+ rubocop (~> 1.22)
105
+ rubocop-performance (~> 1.12)
106
+ rubocop-rake (~> 0.6)
107
+ rubocop-rspec (~> 2.6)
108
+ sidekiq (>= 6)!
109
+ sidekiq-prometheus-exporter!
110
+ timecop (~> 0.9)
111
+
112
+ BUNDLED WITH
113
+ 2.2.17
@@ -0,0 +1,22 @@
1
+ # Patterns to ignore when building packages.
2
+ # This supports shell glob matching, relative path matching, and
3
+ # negation (prefixed with !). Only one pattern per line.
4
+ .DS_Store
5
+ # Common VCS dirs
6
+ .git/
7
+ .gitignore
8
+ .bzr/
9
+ .bzrignore
10
+ .hg/
11
+ .hgignore
12
+ .svn/
13
+ # Common backup files
14
+ *.swp
15
+ *.bak
16
+ *.tmp
17
+ *~
18
+ # Various IDEs
19
+ .project
20
+ .idea/
21
+ *.tmproj
22
+ .vscode/
@@ -0,0 +1,6 @@
1
+ ---
2
+ apiVersion: v1
3
+ appVersion: 0.1.15
4
+ description: A Helm chart to deploy sidekiq-prometheus-exporter in Kubernetes
5
+ name: sidekiq-prometheus-exporter
6
+ version: 0.1.15-3
@@ -0,0 +1,87 @@
1
+ # Official Helm chart
2
+
3
+ This is an official Helm chart for [sidekiq-prometheus-exporter](https://github.com/Strech/sidekiq-prometheus-exporter)
4
+ gem. It uses Docker image published on the [Docker hub](https://hub.docker.com/r/strech/sidekiq-prometheus-exporter).
5
+
6
+ ## Installation
7
+
8
+ First of all add the chart repository
9
+
10
+ ```console
11
+ $ helm repo add strech https://strech.github.io/sidekiq-prometheus-exporter
12
+ "strech" has been added to your repositories
13
+
14
+ $ helm repo list
15
+ NAME URL
16
+ strech https://strech.github.io/sidekiq-prometheus-exporter
17
+ ```
18
+
19
+ Then you can install the chart, let's say with the release name `sidekiq-metrics`
20
+
21
+ **Helm v2**
22
+
23
+ ```console
24
+ $ helm install strech/sidekiq-prometheus-exporter --name sidekiq-metrics
25
+ ```
26
+
27
+ **Helm v3**
28
+
29
+ ```console
30
+ $ helm install sidekiq-metrics strech/sidekiq-prometheus-exporter
31
+ ```
32
+
33
+ ## Configuration
34
+
35
+ You can try out that configuration by using `--dry-run` and `--values` on
36
+ install (examples using **Helm v3**)
37
+
38
+ ```console
39
+ $ helm install sidekiq-metrics strech/sidekiq-prometheus-exporter --values myvalues.yaml --dry-run
40
+ ```
41
+
42
+ or you can try out just one value via `--set`
43
+
44
+ ```console
45
+ $ helm install sidekiq-metrics strech/sidekiq-prometheus-exporter --set serviceAccount.create=false --dry-run
46
+ ```
47
+
48
+ | Parameter | Description | Default |
49
+ | ------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------ |
50
+ | `nameOverride` | Override the resource name prefix | `nil` |
51
+ | `fullnameOverride` | Override the full resource names | `nil` |
52
+ | `image.registry` | Image registry | `docker.io` |
53
+ | `image.repository` | Image repository | `strech/sidekiq-prometheus-exporter` |
54
+ | `image.tag` | Image tag | `0.1.15-3` |
55
+ | `image.pullPolicy` | Image pull policy | `IfNotPresent` |
56
+ | `image.pullSecrets` | Image pull secrets | `nil` |
57
+ | `containerPort` | Port for the exporter to bind on | `9292` |
58
+ | `resources` | CPU/Memory resource requests/limits | `nil` |
59
+ | `nodeSelector` | Node labels for pod assignment | `nil` |
60
+ | `tolerations` | Toleration labels for pod assignment | `nil` |
61
+ | `affinity` | Affinity settings for pod assignment | `nil` |
62
+ | `securityContext` | Security Context for the pod | `nil` |
63
+ | `livenessProbe` | LivenessProbe settings for tcpSocket mapping to containerPort | (See `values.yaml`) |
64
+ | `readinessProbe` | ReadinessProbe settings for tcpSocket mapping to containerPort | (See `values.yaml`) |
65
+ | `service.type` | Kubernetes service type | `ClusterIP` |
66
+ | `service.port` | Kubernetes port where service is exposed | `80` |
67
+ | `env` | An environment variables for metrics container (exclusive with `envFrom`) | `nil` |
68
+ | `envFrom.type` | Type of resource configMapRef/secretRef to source environment variables from | `nil` |
69
+ | `envFrom.name` | Name of Secret/ConfigMap to source environment variables from | `nil` |
70
+ | `serviceMonitor.enabled` | Whether serviceMonitor resource should be deployed | `false` |
71
+ | `serviceMonitor.path` | The endpoint of the service to be scraped | `/metrics` |
72
+ | `serviceMonitor.interval` | Duration between 2 consecutive scrapes | `1m` |
73
+ | `serviceMonitor.scrapeTimeout` | Timeout for each scrape request | `nil` |
74
+ | `serviceMonitor.labels` | Labels to add to the service monitor object | `nil` |
75
+ | `serviceAccount.create` | Specifies whether a service account should be created | `true` |
76
+ | `serviceAccount.name` | Name of the service account (if not set will be generated from chart full name) | `nil` |
77
+ | `rbac.create` | If true, create & use RBAC resources (:anger: works with `envFrom` and `serviceAccount` enabled) | `false` |
78
+
79
+ ## How to uninstall?
80
+
81
+ If you already have release `sidekiq-metics` running and want to remove it
82
+
83
+ ```console
84
+ $ helm delete --purge sidekiq-metics
85
+ ```
86
+
87
+ :bulb: The command above removes all the Kubernetes components associated with the chart and deletes the release.
@@ -0,0 +1,15 @@
1
+ Try out an exporter metrics:
2
+ {{- if contains "NodePort" .Values.service.type }}
3
+ export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "sidekiq-prometheus-exporter.fullname" . }})
4
+ export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
5
+ echo "Run the following command: curl http://$NODE_IP:$NODE_PORT/metrics"
6
+ {{- else if contains "LoadBalancer" .Values.service.type }}
7
+ NOTE: It may take a few minutes for the LoadBalancer IP to be available.
8
+ You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "sidekiq-prometheus-exporter.fullname" . }}'
9
+ export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "sidekiq-prometheus-exporter.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
10
+ echo "Run the following command: curl http://$SERVICE_IP:{{ .Values.service.port }}/metrics"
11
+ {{- else if contains "ClusterIP" .Values.service.type }}
12
+ export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "sidekiq-prometheus-exporter.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
13
+ kubectl port-forward $POD_NAME 9292:{{ .Values.containerPort }}
14
+ echo "Run the following command: curl http://127.0.0.1:9292/metrics"
15
+ {{- end }}
@@ -0,0 +1,109 @@
1
+ {{/* vim: set filetype=mustache: */}}
2
+ {{/*
3
+ Expand the name of the chart.
4
+ */}}
5
+ {{- define "sidekiq-prometheus-exporter.name" -}}
6
+ {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
7
+ {{- end -}}
8
+
9
+ {{/*
10
+ Expand the name of the docker image.
11
+ */}}
12
+ {{- define "sidekiq-prometheus-exporter.image" -}}
13
+ {{- $registryName := .Values.image.registry -}}
14
+ {{- $repositoryName := .Values.image.repository -}}
15
+ {{- $tag := .Values.image.tag | toString -}}
16
+ {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}}
17
+ {{- end -}}
18
+
19
+ {{/*
20
+ Create a default fully qualified app name.
21
+ We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
22
+ If release name contains chart name it will be used as a full name.
23
+ */}}
24
+ {{- define "sidekiq-prometheus-exporter.fullname" -}}
25
+ {{- if .Values.fullnameOverride -}}
26
+ {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
27
+ {{- else -}}
28
+ {{- $name := default .Chart.Name .Values.nameOverride -}}
29
+ {{- if contains $name .Release.Name -}}
30
+ {{- .Release.Name | trunc 63 | trimSuffix "-" -}}
31
+ {{- else -}}
32
+ {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
33
+ {{- end -}}
34
+ {{- end -}}
35
+ {{- end -}}
36
+
37
+ {{/*
38
+ Create chart name and version as used by the chart label.
39
+ */}}
40
+ {{- define "sidekiq-prometheus-exporter.chart" -}}
41
+ {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
42
+ {{- end -}}
43
+
44
+ {{/*
45
+ Create the name of the service account to use.
46
+ */}}
47
+ {{- define "sidekiq-prometheus-exporter.serviceAccountName" -}}
48
+ {{- if .Values.serviceAccount.create -}}
49
+ {{ default (include "sidekiq-prometheus-exporter.fullname" .) .Values.serviceAccount.name }}
50
+ {{- else -}}
51
+ {{ default "default" .Values.serviceAccount.name }}
52
+ {{- end -}}
53
+ {{- end -}}
54
+
55
+ {{/*
56
+ Create pod service account name.
57
+ */}}
58
+ {{- define "sidekiq-prometheus-exporter.podServiceAccountName" -}}
59
+ {{- if and .Values.serviceAccount .Values.serviceAccount.create -}}
60
+ serviceAccountName: {{ include "sidekiq-prometheus-exporter.serviceAccountName" . }}
61
+ {{- end -}}
62
+ {{- end -}}
63
+
64
+ {{/*
65
+ Create pod image pull secrets.
66
+ */}}
67
+ {{- define "sidekiq-prometheus-exporter.podImagePullSecrets" -}}
68
+ {{- if .Values.image.pullSecrets -}}
69
+ imagePullSecrets:
70
+ {{- range .Values.image.pullSecrets }}
71
+ - name: {{ . }}
72
+ {{- end }}
73
+ {{- end -}}
74
+ {{- end -}}
75
+
76
+ {{/*
77
+ Create container environment variables.
78
+ */}}
79
+ {{- define "sidekiq-prometheus-exporter.env" -}}
80
+ {{- if .Values.envFrom -}}
81
+ envFrom:
82
+ {{ if eq (default "configMapRef" .Values.envFrom.type) "secretRef" -}}
83
+ - secretRef:
84
+ name: {{ .Values.envFrom.name }}
85
+ {{- else -}}
86
+ - configMapRef:
87
+ name: {{ .Values.envFrom.name }}
88
+ {{- end -}}
89
+ {{- else if .Values.env -}}
90
+ env:
91
+ {{- range $name, $value := .Values.env }}
92
+ - name: {{ $name }}
93
+ value: {{ $value | quote }}
94
+ {{- end }}
95
+ {{- end -}}
96
+ {{- end -}}
97
+
98
+ {{/*
99
+ Expand common labels.
100
+ */}}
101
+ {{- define "sidekiq-prometheus-exporter.labels" -}}
102
+ app.kubernetes.io/name: {{ include "sidekiq-prometheus-exporter.name" . }}
103
+ helm.sh/chart: {{ include "sidekiq-prometheus-exporter.chart" . }}
104
+ app.kubernetes.io/instance: {{ .Release.Name }}
105
+ {{- if .Chart.AppVersion }}
106
+ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
107
+ {{- end }}
108
+ app.kubernetes.io/managed-by: {{ .Release.Service }}
109
+ {{- end -}}
@@ -0,0 +1,20 @@
1
+ {{- if and .Values.rbac.create }}
2
+ ---
3
+ apiVersion: rbac.authorization.k8s.io/v1
4
+ kind: ClusterRole
5
+ metadata:
6
+ name: {{ template "sidekiq-prometheus-exporter.fullname" . }}
7
+ labels:
8
+ {{- include "sidekiq-prometheus-exporter.labels" . | nindent 4 }}
9
+ rules:
10
+ - apiGroups: [""]
11
+ resources:
12
+ {{- if eq (default "configMapRef" .Values.envFrom.type) "secretRef" }}
13
+ - "secrets"
14
+ {{- else }}
15
+ - "configmap"
16
+ {{- end }}
17
+ resourceNames:
18
+ - {{ .Values.envFrom.name | quote }}
19
+ verbs: ["get"]
20
+ {{- end }}
@@ -0,0 +1,17 @@
1
+ {{- if and .Values.rbac.create }}
2
+ ---
3
+ apiVersion: rbac.authorization.k8s.io/v1
4
+ kind: ClusterRoleBinding
5
+ metadata:
6
+ name: {{ template "sidekiq-prometheus-exporter.fullname" . }}
7
+ labels:
8
+ {{- include "sidekiq-prometheus-exporter.labels" . | nindent 4 }}
9
+ subjects:
10
+ - kind: ServiceAccount
11
+ name: {{ include "sidekiq-prometheus-exporter.serviceAccountName" . }}
12
+ namespace: {{ .Release.Namespace }}
13
+ roleRef:
14
+ kind: ClusterRole
15
+ name: {{ template "sidekiq-prometheus-exporter.fullname" . }}
16
+ apiGroup: rbac.authorization.k8s.io
17
+ {{- end }}
@@ -0,0 +1,62 @@
1
+ ---
2
+ apiVersion: apps/v1
3
+ kind: Deployment
4
+ metadata:
5
+ name: {{ include "sidekiq-prometheus-exporter.fullname" . }}
6
+ labels:
7
+ {{- include "sidekiq-prometheus-exporter.labels" . | nindent 4 }}
8
+ spec:
9
+ replicas: 1
10
+ selector:
11
+ matchLabels:
12
+ app.kubernetes.io/name: {{ include "sidekiq-prometheus-exporter.name" . }}
13
+ app.kubernetes.io/instance: {{ .Release.Name }}
14
+ template:
15
+ metadata:
16
+ labels:
17
+ app.kubernetes.io/name: {{ include "sidekiq-prometheus-exporter.name" . }}
18
+ app.kubernetes.io/instance: {{ .Release.Name }}
19
+ {{- with .Values.podAnnotations }}
20
+ annotations:
21
+ {{- toYaml . | nindent 8 }}
22
+ {{- end }}
23
+ spec:
24
+ containers:
25
+ - name: {{ .Chart.Name }}
26
+ image: {{ include "sidekiq-prometheus-exporter.image" . }}
27
+ imagePullPolicy: {{ .Values.image.pullPolicy }}
28
+ ports:
29
+ - name: metrics
30
+ containerPort: {{ .Values.containerPort }}
31
+ protocol: TCP
32
+ {{- with .Values.resources }}
33
+ resources:
34
+ {{- toYaml . | nindent 12 }}
35
+ {{- end }}
36
+ livenessProbe:
37
+ tcpSocket:
38
+ port: metrics
39
+ {{- toYaml .Values.livenessProbe | nindent 12 }}
40
+ readinessProbe:
41
+ tcpSocket:
42
+ port: metrics
43
+ {{- toYaml .Values.readinessProbe | nindent 12 }}
44
+ {{- include "sidekiq-prometheus-exporter.env" . | nindent 10 }}
45
+ {{- with .Values.nodeSelector }}
46
+ nodeSelector:
47
+ {{- toYaml . | nindent 8 }}
48
+ {{- end }}
49
+ {{- with .Values.affinity }}
50
+ affinity:
51
+ {{- toYaml . | nindent 8 }}
52
+ {{- end }}
53
+ {{- with .Values.tolerations }}
54
+ tolerations:
55
+ {{- toYaml . | nindent 8 }}
56
+ {{- end }}
57
+ {{- with .Values.securityContext }}
58
+ securityContext:
59
+ {{- toYaml . | nindent 8 }}
60
+ {{- end }}
61
+ {{- include "sidekiq-prometheus-exporter.podServiceAccountName" . | nindent 6 }}
62
+ {{- include "sidekiq-prometheus-exporter.podImagePullSecrets" . | nindent 6 }}
@@ -0,0 +1,17 @@
1
+ ---
2
+ apiVersion: v1
3
+ kind: Service
4
+ metadata:
5
+ name: {{ include "sidekiq-prometheus-exporter.fullname" . }}
6
+ labels:
7
+ {{- include "sidekiq-prometheus-exporter.labels" . | nindent 4 }}
8
+ spec:
9
+ type: {{ .Values.service.type }}
10
+ ports:
11
+ - port: {{ .Values.service.port }}
12
+ targetPort: metrics
13
+ protocol: TCP
14
+ name: metrics
15
+ selector:
16
+ app.kubernetes.io/name: {{ include "sidekiq-prometheus-exporter.name" . }}
17
+ app.kubernetes.io/instance: {{ .Release.Name }}
@@ -0,0 +1,9 @@
1
+ {{- if .Values.serviceAccount.create }}
2
+ ---
3
+ apiVersion: v1
4
+ kind: ServiceAccount
5
+ metadata:
6
+ name: {{ template "sidekiq-prometheus-exporter.fullname" . }}
7
+ labels:
8
+ {{- include "sidekiq-prometheus-exporter.labels" . | nindent 4 }}
9
+ {{- end }}
@@ -0,0 +1,26 @@
1
+ {{- if .Values.serviceMonitor.enabled }}
2
+ ---
3
+ apiVersion: monitoring.coreos.com/v1
4
+ kind: ServiceMonitor
5
+ metadata:
6
+ name: {{ template "sidekiq-prometheus-exporter.fullname" . }}
7
+ namespace: {{ .Release.Namespace | quote }}
8
+ labels:
9
+ {{- include "sidekiq-prometheus-exporter.labels" . | nindent 4 }}
10
+ {{- with .Values.serviceMonitor.labels }}
11
+ {{- toYaml . | nindent 4 }}
12
+ {{- end }}
13
+ spec:
14
+ jobLabel: {{ template "sidekiq-prometheus-exporter.fullname" . }}
15
+ selector:
16
+ matchLabels:
17
+ {{- include "sidekiq-prometheus-exporter.labels" . | nindent 6 }}
18
+ namespaceSelector:
19
+ matchNames:
20
+ - {{ .Release.Namespace | quote }}
21
+ endpoints:
22
+ - port: metrics
23
+ path: {{ .Values.serviceMonitor.path }}
24
+ interval: {{ .Values.serviceMonitor.interval }}
25
+ scrapeTimeout: {{ .Values.serviceMonitor.scrapeTimeout }}
26
+ {{- end }}
@@ -0,0 +1,135 @@
1
+ ---
2
+ ## Default values for sidekiq-prometheus-exporter.
3
+ ## This is a YAML-formatted file.
4
+ ## Declare variables to be passed into your templates.
5
+
6
+ ## Official docker image version
7
+ ## ref: https://hub.docker.com/r/strech/sidekiq-prometheus-exporter/tags/
8
+ ##
9
+ image:
10
+ registry: docker.io
11
+ repository: strech/sidekiq-prometheus-exporter
12
+ tag: 0.1.15-3
13
+ ## Specify a imagePullPolicy
14
+ ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
15
+ ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
16
+ ##
17
+ pullPolicy: IfNotPresent
18
+ ## Optionally specify an array of imagePullSecrets.
19
+ ## Secrets must be manually created in the namespace.
20
+ ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
21
+ ##
22
+ # pullSecrets:
23
+ # - myRegistryKeySecretName
24
+
25
+ ## String to partially override Values.fullname template (will maintain the release name)
26
+ ##
27
+ # nameOverride:
28
+
29
+ ## String to fully override Values.fullname template
30
+ ##
31
+ # fullnameOverride:
32
+
33
+ ## Metrics exporter resource requests and limits
34
+ ## ref: http://kubernetes.io/docs/user-guide/compute-resources/
35
+ ##
36
+ # resources:
37
+ # limits:
38
+ # cpu: 100m
39
+ # memory: 128Mi
40
+ # requests:
41
+ # cpu: 100m
42
+ # memory: 128Mi
43
+
44
+ ## Metrics exporter selectors and tolerations for pod assignment
45
+ ## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector
46
+ ## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#taints-and-tolerations-beta-feature
47
+ ##
48
+ # nodeSelector:
49
+ # tolerations:
50
+
51
+ ## Metrics exporter pod/node affinity/anti-affinity
52
+ ## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
53
+ ##
54
+ # affinity:
55
+
56
+ ## Metrics exporter liveness and readiness probes
57
+ ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
58
+ ##
59
+ livenessProbe:
60
+ initialDelaySeconds: 5
61
+ periodSeconds: 5
62
+ timeoutSeconds: 5
63
+ successThreshold: 1
64
+ failureThreshold: 3
65
+ readinessProbe:
66
+ initialDelaySeconds: 5
67
+ periodSeconds: 5
68
+ timeoutSeconds: 5
69
+ successThreshold: 1
70
+ failureThreshold: 3
71
+
72
+ ## Metrics exporter container port
73
+ ##
74
+ containerPort: 9292
75
+
76
+ ## Metrics exporter container Environment Variables
77
+ ## ref: https://github.com/Strech/sidekiq-prometheus-exporter/tree/master/docker#supported-envs
78
+ ##
79
+ # env:
80
+ # REDIS_SSL: "false"
81
+ # REDIS_HOST: "localhost"
82
+ # REDIS_PORT: 6379
83
+ # REDIS_URL: "..."
84
+ # REDIS_PASSWORD: "..."
85
+ # REDIS_DB_NUMBER: "0"
86
+ # REDIS_NAMESPACE: "..."
87
+ # REDIS_SENTINELS: "..."
88
+ # REDIS_SENTINEL_ROLE: "..."
89
+ # REDIS_DISABLE_CLIENT_ID: "false"
90
+ # envFrom:
91
+ # type: configMapRef
92
+ # name: myConfigMapReference
93
+
94
+ ## Metrics exporter Security Context
95
+ ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context
96
+ ##
97
+ # securityContext:
98
+ # runAsUser: 65534
99
+
100
+ ## Metrics exporter pod Annotations
101
+ ##
102
+ # podAnnotations:
103
+
104
+ ## Metrics exporter Service properties
105
+ ##
106
+ service:
107
+ ## Metrics exporter Service type
108
+ ##
109
+ type: ClusterIP
110
+ port: 80
111
+
112
+ serviceAccount:
113
+ ## Specifies whether a ServiceAccount should be created
114
+ ##
115
+ create: true
116
+ ## The name of the ServiceAccount to use.
117
+ ## If not set and create is true, a name is generated using the fullname template
118
+ ##
119
+ # name:
120
+
121
+ rbac:
122
+ ## Specifies whether RBAC resources should be created
123
+ ##
124
+ create: false
125
+
126
+ ## Enable this if you're using https://github.com/coreos/prometheus-operator
127
+ ##
128
+ serviceMonitor:
129
+ enabled: false
130
+ path: "/metrics"
131
+ interval: 1m
132
+ scrapeTimeout: 10s
133
+ ## Additional labels for the Service Monitor
134
+ ##
135
+ # labels: