Skip to content

Commit 33f51ab

Browse files
authored
chore(addons): add pmm (#33)
1 parent 631a385 commit 33f51ab

20 files changed

Lines changed: 961 additions & 0 deletions

addons/index.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,6 @@ entries:
5151
kafka:
5252
- version: 3.6
5353
description: "Apache Kafka is an open-source distributed event streaming platform used by thousands of companies for high-performance data pipelines, streaming analytics, data integration, and mission-critical applications."
54+
pmm:
55+
- version: 2.41
56+
description: "Percona Monitoring and Management: an open source database monitoring, observability and management tool ."
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
apiVersion: v2
2+
name: pmm
3+
description: A Helm chart for Percona Monitoring and Management (PMM)
4+
type: application
5+
version: 1.3.11
6+
appVersion: "2.41.1"
7+
home: https://github.com/percona/pmm
8+
maintainers:
9+
- name: tplavcic
10+
email: tomislav.plavcic@percona.com
11+
- name: bupychuk
12+
email: nurlan.moldomurov@percona.com
13+
- name: spron-in
14+
email: sergey.pronin@percona.com
15+
keywords:
16+
- PMM
17+
- Monitoring
18+
icon: https://www.percona.com/sites/default/files/pmm-logo.png

addons/pmm/2.41/chart/pmm/README.md

Lines changed: 205 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
2+
Percona Monitoring and Management (PMM)
3+
4+
An open source database monitoring, observability and management tool
5+
Check more info here: https://docs.percona.com/percona-monitoring-and-management/index.html
6+
7+
Get the application URL:
8+
{{- if contains "NodePort" .Values.service.type }}
9+
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ .Values.service.name }})
10+
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
11+
echo https://$NODE_IP:$NODE_PORT
12+
{{- else if contains "LoadBalancer" .Values.service.type }}
13+
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
14+
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ .Values.service.name }}'
15+
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ .Values.service.name }} -o jsonpath="{.status.loadBalancer.ingress[0].ip}")
16+
echo https://$SERVICE_IP:{{ .Values.service.port }}
17+
{{- else if contains "ClusterIP" .Values.service.type }}
18+
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "pmm.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
19+
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[1].containerPort}")
20+
echo "Visit https://127.0.0.1:8080 to use your application"
21+
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
22+
{{- end }}
23+
24+
Get password for the "admin" user:
25+
export ADMIN_PASS=$(kubectl get secret pmm-secret --namespace {{ .Release.Namespace }} -o jsonpath='{.data.PMM_ADMIN_PASSWORD}' | base64 --decode)
26+
echo $ADMIN_PASS
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "pmm.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 "pmm.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 "pmm.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "pmm.labels" -}}
37+
helm.sh/chart: {{ include "pmm.chart" . }}
38+
{{ include "pmm.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 "pmm.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "pmm.name" . }}
50+
app.kubernetes.io/instance: {{ .Release.Name }}
51+
app.kubernetes.io/component: pmm-server
52+
app.kubernetes.io/part-of: percona-platform
53+
{{- if .Values.extraLabels }}
54+
{{ toYaml .Values.extraLabels }}
55+
{{- end }}
56+
{{- end }}
57+
58+
{{/*
59+
Pod annotation
60+
*/}}
61+
{{- define "pmm.podAnnotations" -}}
62+
app.kubernetes.io/managed-by: {{ .Release.Service }}
63+
helm.sh/chart: {{ include "pmm.chart" . }}
64+
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
65+
{{- if .Values.podAnnotations }}
66+
{{ toYaml .Values.podAnnotations }}
67+
{{- end }}
68+
{{- end }}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{{- if .Values.serviceAccount.create -}}
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
kind: ClusterRole
4+
metadata:
5+
name: {{ include "pmm.fullname" . }}
6+
labels:
7+
{{- include "pmm.labels" . | nindent 4 }}
8+
rules:
9+
# standard RBAC
10+
- apiGroups: [""] # "" indicates the core API group
11+
resources:
12+
- namespaces
13+
- endpoints
14+
- services
15+
- nodes
16+
- pods
17+
- secrets
18+
- serviceaccounts
19+
verbs:
20+
- get
21+
- watch
22+
- list
23+
- nonResourceURLs:
24+
- /metrics
25+
- /metrics/resources
26+
verbs:
27+
- get
28+
{{- end }}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{{- if .Values.serviceAccount.create -}}
2+
{{- if .Values.pmmEnv.ENABLE_CLUSTER_ROLE_ADMIN -}}
3+
apiVersion: rbac.authorization.k8s.io/v1
4+
kind: ClusterRoleBinding
5+
metadata:
6+
name: {{ include "pmm.fullname" . }}
7+
roleRef:
8+
apiGroup: rbac.authorization.k8s.io
9+
kind: ClusterRole
10+
name: cluster-admin
11+
subjects:
12+
- kind: ServiceAccount
13+
name: {{ include "pmm.serviceAccountName" . }}
14+
namespace: {{ .Release.Namespace }}
15+
{{- else }}
16+
apiVersion: rbac.authorization.k8s.io/v1
17+
kind: ClusterRoleBinding
18+
metadata:
19+
name: {{ include "pmm.fullname" . }}
20+
roleRef:
21+
apiGroup: rbac.authorization.k8s.io
22+
kind: ClusterRole
23+
name: {{ include "pmm.fullname" . }}
24+
subjects:
25+
- kind: ServiceAccount
26+
name: {{ include "pmm.fullname" . }}
27+
namespace: {{ .Release.Namespace }}
28+
{{- end }}
29+
{{- end }}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{{- if .Values.pmmEnv -}}
2+
apiVersion: v1
3+
kind: ConfigMap
4+
metadata:
5+
name: {{ include "pmm.fullname" . }}
6+
labels:
7+
{{- include "pmm.labels" . | nindent 4 }}
8+
data:
9+
# environment passed to the PMM
10+
{{- with .Values.pmmEnv }}
11+
{{- . | toYaml | nindent 6 }}
12+
{{- end }}
13+
{{- end }}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{{- if .Values.certs.name -}}
2+
apiVersion: v1
3+
kind: Secret
4+
metadata:
5+
name: {{ .Values.certs.name }}
6+
labels:
7+
{{- include "pmm.labels" . | nindent 4 }}
8+
{{- with .Values.serviceAccount.annotations }}
9+
annotations:
10+
{{- toYaml . | nindent 4 }}
11+
{{- end }}
12+
type: Opaque
13+
data:
14+
# ngnix ssl certificates
15+
{{- with .Values.certs.files }}
16+
{{- toYaml . | nindent 4 }}
17+
{{- end }}
18+
{{- end }}

0 commit comments

Comments
 (0)