Skip to content

Commit 88353d6

Browse files
author
github-actions
committed
Update perfectscale-prom-exporter chart with new package version v0.0.1-alpha1
1 parent 7b50b0f commit 88353d6

16 files changed

+748
-0
lines changed

charts/psc-prom-exporter/.helmignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+
.github/
8+
.gitignore
9+
.bzr/
10+
.bzrignore
11+
.hg/
12+
.hgignore
13+
.svn/
14+
# Common backup files
15+
*.swp
16+
*.bak
17+
*.tmp
18+
*.orig
19+
*~
20+
# Various IDEs
21+
.project
22+
.idea/
23+
*.tmproj
24+
.vscode/
25+
26+
values/

charts/psc-prom-exporter/Chart.lock

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
dependencies:
2+
- name: kube-state-metrics
3+
repository: https://prometheus-community.github.io/helm-charts
4+
version: 5.13.0
5+
digest: sha256:7de23b524d9a956f3fc4f47432ef15d0d082d45f88e987bfc04e4319fd3b50d6
6+
generated: "2023-09-28T16:45:42.510712+03:00"

charts/psc-prom-exporter/Chart.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
apiVersion: v2
2+
name: psc-prom-exporter
3+
description: PerfectScale Prometheus/DataDog Metrics Exporter
4+
type: application
5+
version: 0.1.0
6+
appVersion: 1.0.0
7+
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Thank you for installing PerfectScale.
2+
Visit http://app.perfectscale.io/ to use the application.
Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "helm.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "helm.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create chart name and version as used by the chart label.
28+
*/}}
29+
{{- define "helm.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "helm.labels" -}}
37+
helm.sh/chart: {{ include "helm.chart" . }}
38+
{{ include "helm.selectorLabels" . }}
39+
{{- if .Chart.AppVersion }}
40+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41+
{{- end }}
42+
app.kubernetes.io/managed-by: {{ .Release.Service }}
43+
{{- end }}
44+
45+
{{/*
46+
Selector labels
47+
*/}}
48+
{{- define "helm.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "helm.name" . }}
50+
app.kubernetes.io/instance: {{ .Release.Name }}
51+
{{- end }}
52+
53+
{{/*
54+
Create the name of the service account to use
55+
*/}}
56+
{{- define "helm.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "helm.fullname" .) .Values.serviceAccount.name }}
59+
{{- else }}
60+
{{- default "default" .Values.serviceAccount.name }}
61+
{{- end }}
62+
{{- end }}
63+
64+
{{- define "helm.exporter.ksmAddress" -}}
65+
{{- if .Values.settings.ksmAddress }}
66+
{{- .Values.settings.ksmAddress }}
67+
{{- else }}
68+
{{- printf "http://%s-%s:8080" .Release.Name "kube-state-metrics" }}
69+
{{- end }}
70+
{{- end }}
71+
72+
{{- define "helm.exporter.dataRetentionTime" -}}
73+
{{- if .Values.settings.dataRetentionTime }}
74+
{{- .Values.settings.dataRetentionTime }}
75+
{{- else }}
76+
{{- "15m" }}
77+
{{- end }}
78+
{{- end }}
79+
80+
{{- define "helm.exporter.remoteLogBatchSize" -}}
81+
{{- if .Values.settings.remoteLogBatchSize }}
82+
{{- .Values.settings.remoteLogBatchSize }}
83+
{{- else }}
84+
{{- "1000" }}
85+
{{- end }}
86+
{{- end }}
87+
88+
{{- define "helm.exporter.remoteLogBatchInterval" -}}
89+
{{- if .Values.settings.remoteLogBatchInterval }}
90+
{{- .Values.settings.remoteLogBatchInterval }}
91+
{{- else }}
92+
{{- "15s" }}
93+
{{- end }}
94+
{{- end }}
95+
96+
{{/*
97+
For testing purposes, in prod we want to get the actual cluster's UID
98+
*/}}
99+
{{- define "helm.exporter.clusterUID" -}}
100+
{{- if .Values.settings.clusterUID }}
101+
{{- .Values.settings.clusterUID }}
102+
{{- else }}
103+
{{- "" }}
104+
{{- end }}
105+
{{- end }}
106+
107+
{{- define "datadogAD.v1annotations" -}}
108+
ad.datadoghq.com/{{ .containerName }}.check_names: '["openmetrics"]'
109+
ad.datadoghq.com/{{ .containerName }}.init_configs: '[{}]'
110+
ad.datadoghq.com/{{ .containerName }}.instances: |
111+
[
112+
{
113+
"openmetrics_endpoint": "http://%%host%%:{{ .config.port }}{{ .config.endpoint }}",
114+
"namespace": "{{ .config.namespace }}",
115+
{{- if .config.metrics }}
116+
"metrics": [
117+
{{- range $index, $metric := .config.metrics }}
118+
{{- if $index }},{{ end }}
119+
{{- if .rename }}
120+
{
121+
"{{ .name }}": "{{ .rename }}"
122+
}
123+
{{- else }}
124+
"{{ .name }}"
125+
{{- end }}
126+
{{- end }}
127+
]
128+
{{- end }}
129+
{{- if .config.options }}
130+
{{- range $key, $value := .config.options }}
131+
,"{{ $key }}": {{ $value }}
132+
{{- end }}
133+
{{- end }}
134+
}
135+
]
136+
{{- end }}
137+
138+
{{- define "datadogAD.v2annotations" -}}
139+
ad.datadoghq.com/{{ .containerName }}.checks: |
140+
{
141+
"openmetrics": {
142+
"init_config": {},
143+
"instances": [
144+
{
145+
"openmetrics_endpoint": "http://%%host%%:{{ .config.port }}{{ .config.endpoint }}",
146+
"namespace": "{{ .config.namespace }}",
147+
{{- if .config.metrics }}
148+
"metrics": {
149+
{{- range $index, $metric := .config.metrics }}
150+
{{- if $index }},{{ end }}
151+
{{- if .rename }}
152+
"{{ .name }}": "{{ .rename }}"
153+
{{- else }}
154+
"{{ .name }}": "{{ .name }}"
155+
{{- end }}
156+
{{- end }}
157+
}
158+
{{- end }}
159+
{{- if .config.options }}
160+
{{- range $key, $value := .config.options }}
161+
,"{{ $key }}": {{ $value }}
162+
{{- end }}
163+
{{- end }}
164+
}
165+
]
166+
}
167+
}
168+
{{- end }}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{{- if .Values.rbac.create -}}
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
kind: ClusterRole
4+
metadata:
5+
name: {{ template "helm.fullname" . }}
6+
labels:
7+
{{- include "helm.labels" . | nindent 4 }}
8+
rules:
9+
- apiGroups:
10+
- ""
11+
resources:
12+
- namespaces
13+
verbs:
14+
- get
15+
- nonResourceURLs:
16+
- "/version"
17+
verbs:
18+
- "get"
19+
{{- end }}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{{- if .Values.rbac.create -}}
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
kind: ClusterRoleBinding
4+
metadata:
5+
name: {{ template "helm.fullname" . }}
6+
labels: {{- include "helm.labels" . | nindent 4 }}
7+
subjects:
8+
- kind: ServiceAccount
9+
name: {{ include "helm.serviceAccountName" . }}
10+
namespace: {{ .Release.Namespace }}
11+
roleRef:
12+
kind: ClusterRole
13+
name: {{ template "helm.fullname" . }}
14+
apiGroup: rbac.authorization.k8s.io
15+
{{- end }}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: {{ include "helm.fullname" . }}
5+
data:
6+
config.yaml: |
7+
{{- .Values.config | toYaml | nindent 4 }}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{{- if and .Values.scrapers.datadogOperator.enabled }}
2+
apiVersion: datadoghq.com/v1alpha1
3+
kind: DatadogMonitor
4+
metadata:
5+
name: {{ include "helm.fullname" . }}-openmetrics
6+
labels:
7+
{{- include "helm.labels" . | nindent 4 }}
8+
spec:
9+
{{- with .Values.scrapers.datadogOperator.customConfig }}
10+
name: {{ .configName | default "psc-prom-exporter" }}
11+
namespaceSelector:
12+
matchNames: {{ .namespaceSelector.matchNames | default list }}
13+
endpoints:
14+
{{- toYaml .endpoints | nindent 4 }}
15+
pattern: {{ .pattern | default "ps_.*" }}
16+
{{- end }}
17+
{{- end }}

0 commit comments

Comments
 (0)