added repo

This commit is contained in:
Your Name
2026-08-26 03:39:42 +05:30
parent 45c25a95af
commit b8575bb8b9
6889 changed files with 1217125 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
Percona Monitoring and Management (PMM)
An open source database monitoring, observability and management tool
Check more info here: https://docs.percona.com/percona-monitoring-and-management/index.html
Get the application URL:
{{- if .Values.ingress.enabled }}
{{- range $host := .Values.ingress.hosts }}
{{- range .paths }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }}
{{- end }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ .Values.service.name }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo https://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ .Values.service.name }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ .Values.service.name }} -o jsonpath="{.status.loadBalancer.ingress[0].ip}")
echo https://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
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}")
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[1].containerPort}")
echo "Visit https://127.0.0.1:8080 to use your application"
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
{{- end }}
Get password for the "admin" user:
export ADMIN_PASS=$(kubectl get secret pmm-secret --namespace {{ .Release.Namespace }} -o jsonpath='{.data.PMM_ADMIN_PASSWORD}' | base64 --decode)
echo $ADMIN_PASS
+79
View File
@@ -0,0 +1,79 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "pmm.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "pmm.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "pmm.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "pmm.labels" -}}
helm.sh/chart: {{ include "pmm.chart" . }}
{{ include "pmm.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "pmm.selectorLabels" -}}
app.kubernetes.io/name: {{ include "pmm.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: pmm-server
app.kubernetes.io/part-of: percona-platform
{{- if .Values.extraLabels }}
{{ toYaml .Values.extraLabels }}
{{- end }}
{{- end }}
{{/*
Create the name of the service account to use
*/}}
{{- define "pmm.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "pmm.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
{{/*
Pod annotation
*/}}
{{- define "pmm.podAnnotations" -}}
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ include "pmm.chart" . }}
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
{{- if .Values.podAnnotations }}
{{ toYaml .Values.podAnnotations }}
{{- end }}
{{- end }}
@@ -0,0 +1,28 @@
{{- if .Values.serviceAccount.create -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "pmm.fullname" . }}
labels:
{{- include "pmm.labels" . | nindent 4 }}
rules:
# standard RBAC
- apiGroups: [""] # "" indicates the core API group
resources:
- namespaces
- endpoints
- services
- nodes
- pods
- secrets
- serviceaccounts
verbs:
- get
- watch
- list
- nonResourceURLs:
- /metrics
- /metrics/resources
verbs:
- get
{{- end }}
@@ -0,0 +1,29 @@
{{- if .Values.serviceAccount.create -}}
{{- if .Values.pmmEnv.ENABLE_CLUSTER_ROLE_ADMIN -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "pmm.fullname" . }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: {{ include "pmm.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- else }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "pmm.fullname" . }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ include "pmm.fullname" . }}
subjects:
- kind: ServiceAccount
name: {{ include "pmm.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- end }}
{{- end }}
@@ -0,0 +1,13 @@
{{- if .Values.pmmEnv -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "pmm.fullname" . }}
labels:
{{- include "pmm.labels" . | nindent 4 }}
data:
# environment passed to the PMM
{{- with .Values.pmmEnv }}
{{- . | toYaml | nindent 6 }}
{{- end }}
{{- end }}
+148
View File
@@ -0,0 +1,148 @@
{{- if .Values.ingress.enabled -}}
{{- $serviceName := .Values.service.name -}}
{{- $grpcPort := (index $.Values.service.ports 0).port -}}
{{- $servicePort := (index $.Values.service.ports 1).port -}}
{{- $ingressPathType := .Values.ingress.pathType -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "pmm.fullname" . }}
labels:
{{- include "pmm.labels" . | nindent 4 }}
{{- if or .Values.ingress.annotations .Values.ingress.nginxInc }}
annotations:
{{- toYaml .Values.ingress.annotations | nindent 4 }}
{{- if .Values.ingress.nginxInc }}
nginx.org/ssl-services: {{ $serviceName }}-grpc
nginx.org/grpc-services: {{ $serviceName }}-grpc
{{- end }}
{{- end }}
spec:
{{- if .Values.ingress.ingressClassName }}
ingressClassName: {{ .Values.ingress.ingressClassName | quote }}
{{- end }}
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ . }}
pathType: {{ $ingressPathType }}
backend:
service:
name: {{ $serviceName }}
port:
number: {{ $servicePort }}
{{- if $.Values.ingress.nginxInc }}
# gRPC paths
- path: {{ printf "%s/agent." . | replace "//" "/" }}
pathType: {{ $ingressPathType }}
backend:
service:
name: {{ $serviceName }}-grpc
port:
number: {{ $grpcPort }} # MUST proxy to HTTPS
- path: {{ printf "%s/inventory." . | replace "//" "/" }}
pathType: {{ $ingressPathType }}
backend:
service:
name: {{ $serviceName }}-grpc
port:
number: {{ $grpcPort }} # MUST proxy to HTTPS
- path: {{ printf "%s/management." . | replace "//" "/" }}
pathType: {{ $ingressPathType }}
backend:
service:
name: {{ $serviceName }}-grpc
port:
number: {{ $grpcPort }} # MUST proxy to HTTPS
- path: {{ printf "%s/server." . | replace "//" "/" }}
pathType: {{ $ingressPathType }}
backend:
service:
name: {{ $serviceName }}-grpc
port:
number: {{ $grpcPort }} # MUST proxy to HTTPS
{{- end }}
{{- end }}
{{- end }}
{{- if not .Values.ingress.nginxInc }}
---
# Community version of ingress-nginx requires second Ingress for gRPC
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "pmm.fullname" . }}-grpc
labels:
{{- include "pmm.labels" . | nindent 4 }}
annotations:
{{- with .Values.ingress.community.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
nginx.ingress.kubernetes.io/backend-protocol: "GRPCS"
nginx.ingress.kubernetes.io/use-regex: "true"
spec:
{{- if .Values.ingress.ingressClassName }}
ingressClassName: {{ .Values.ingress.ingressClassName | quote }}
{{- end }}
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
# gRPC paths
- path: {{ printf "%s/agent." . | replace "//" "/" }}
pathType: {{ $ingressPathType }}
backend:
service:
name: {{ $serviceName }}-grpc
port:
number: {{ $grpcPort }} # MUST proxy to HTTPS
- path: {{ printf "%s/inventory." . | replace "//" "/" }}
pathType: {{ $ingressPathType }}
backend:
service:
name: {{ $serviceName }}-grpc
port:
number: {{ $grpcPort }} # MUST proxy to HTTPS
- path: {{ printf "%s/management." . | replace "//" "/" }}
pathType: {{ $ingressPathType }}
backend:
service:
name: {{ $serviceName }}-grpc
port:
number: {{ $grpcPort }} # MUST proxy to HTTPS
- path: {{ printf "%s/server." . | replace "//" "/" }}
pathType: {{ $ingressPathType }}
backend:
service:
name: {{ $serviceName }}-grpc
port:
number: {{ $grpcPort }} # MUST proxy to HTTPS
{{- end }}
{{- end }}
---
{{- end }}
{{- end }}
@@ -0,0 +1,18 @@
{{- if .Values.certs.name -}}
apiVersion: v1
kind: Secret
metadata:
name: {{ .Values.certs.name }}
labels:
{{- include "pmm.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
type: Opaque
data:
# ngnix ssl certificates
{{- with .Values.certs.files }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
+24
View File
@@ -0,0 +1,24 @@
{{- if .Values.secret.create -}}
apiVersion: v1
kind: Secret
metadata:
name: {{ .Values.secret.name }}
labels:
{{- include "pmm.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
type: Opaque
data:
# base64 encoded password
# encode some password: `echo -n "admin" | base64`
# to get the password on deployed cluster: `kubectl get secret pmm-secret -o jsonpath='{.data.PMM_ADMIN_PASSWORD}' | base64 --decode`
PMM_ADMIN_PASSWORD: {{ .Values.secret.pmm_password | default (randAscii 16) | b64enc | quote }}
{{- if .Values.secret.GF_AUTH_GENERIC_OAUTH_CLIENT_ID -}}
GF_AUTH_GENERIC_OAUTH_CLIENT_ID: {{ .Values.secret.GF_AUTH_GENERIC_OAUTH_CLIENT_ID }}
{{- end }}
{{- if .Values.secret.GF_AUTH_GENERIC_OAUTH_CLIENT_SECRET -}}
GF_AUTH_GENERIC_OAUTH_CLIENT_SECRET: {{ .Values.secret.GF_AUTH_GENERIC_OAUTH_CLIENT_SECRET }}
{{- end }}
{{- end }}
+49
View File
@@ -0,0 +1,49 @@
{{- $serviceType := .Values.service.type -}}
apiVersion: v1
kind: Service
metadata:
name: {{ .Values.service.name }}
labels:
{{- include "pmm.labels" . | nindent 4 }}
{{- with .Values.service.annotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.service.finalizers }}
finalizers:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
type: {{ $serviceType | default "ClusterIP" }}
{{- with .Values.service.ports }}
ports:
{{- toYaml . | nindent 8 }}
{{- end }}
selector:
{{- include "pmm.selectorLabels" . | nindent 4 }}
{{- if .Values.ingress.enabled }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ .Values.service.name }}-grpc
labels:
{{- include "pmm.labels" . | nindent 4 }}
{{- with .Values.service.annotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.service.finalizers }}
finalizers:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
type: {{ $serviceType | default "ClusterIP" }}
{{- with .Values.service.ports }}
ports:
{{- toYaml . | nindent 8 }}
{{- end }}
selector:
{{- include "pmm.selectorLabels" . | nindent 4 }}
---
{{- end }}
@@ -0,0 +1,22 @@
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "pmm.serviceAccountName" . }}
labels:
{{- include "pmm.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
secrets:
- name: {{ include "pmm.serviceAccountName" . }}-token
---
apiVersion: v1
kind: Secret
type: kubernetes.io/service-account-token
metadata:
name: {{ include "pmm.serviceAccountName" . }}-token
annotations:
kubernetes.io/service-account.name: {{ include "pmm.serviceAccountName" . }}
{{- end }}
@@ -0,0 +1,149 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ include "pmm.fullname" . }}
labels:
{{- include "pmm.labels" . | nindent 4 }}
spec:
serviceName: {{ .Values.service.name }}
replicas: 1
selector:
matchLabels:
{{- include "pmm.selectorLabels" . | nindent 6 }}
updateStrategy:
type: RollingUpdate
template:
metadata:
annotations:
{{- include "pmm.podAnnotations" . | nindent 8 }}
labels:
{{- include "pmm.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.image.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.serviceAccount.create }}
serviceAccountName: {{ include "pmm.serviceAccountName" . }}
{{- end }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
{{- if .Values.pmmResources }}
resources:
{{- toYaml .Values.pmmResources | nindent 12 }}
{{- end }}
# environment passed to PMM, defined in configMap
envFrom:
- configMapRef:
name: {{ include "pmm.fullname" . }}
optional: true
# additional secrets that could be used for Grafana iDP
env:
- name: GF_AUTH_GENERIC_OAUTH_CLIENT_ID
valueFrom:
secretKeyRef:
name: {{ .Values.secret.name }}
key: GF_AUTH_GENERIC_OAUTH_CLIENT_ID
optional: true
- name: GF_AUTH_GENERIC_OAUTH_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: {{ .Values.secret.name }}
key: GF_AUTH_GENERIC_OAUTH_CLIENT_SECRET
optional: true
- name: GF_SECURITY_ADMIN_PASSWORD
valueFrom:
secretKeyRef:
name: {{ .Values.secret.name }}
key: PMM_ADMIN_PASSWORD
optional: true
- name: PMM_INSTALL_METHOD
valueFrom:
fieldRef:
fieldPath: metadata.annotations['app.kubernetes.io/managed-by']
ports:
- name: http
containerPort: 80
- name: https
containerPort: 443
readinessProbe:
httpGet:
path: /v1/readyz
port: http
{{- if .Values.readyProbeConf }}
{{- toYaml .Values.readyProbeConf | nindent 12 }}
{{- end }}
volumeMounts:
- name: {{ .Values.storage.name }}
mountPath: /srv
- name: annotations
mountPath: "/var/run/pmm/annotations"
readOnly: true
{{- if .Values.certs.name }}
- name: {{ .Values.certs.name }}
mountPath: /srv/nginx
readOnly: true
{{- end }}
{{- if .Values.extraVolumeMounts }}
{{- toYaml .Values.extraVolumeMounts | nindent 12 }}
{{- end }}
volumes:
- name: annotations
projected:
sources:
- downwardAPI:
items:
- path: "annotations"
fieldRef:
fieldPath: metadata.annotations
{{- if .Values.certs.name }}
- name: {{ .Values.certs.name }}
secret:
secretName: {{ .Values.certs.name }}
optional: false
{{- end }}
{{- if .Values.extraVolumes }}
{{- toYaml .Values.extraVolumes | nindent 8 }}
{{- end }}
volumeClaimTemplates:
- metadata:
name: {{ .Values.storage.name }}
spec:
{{- if .Values.storage.selector }}
selector:
{{- toYaml .Values.storage.selector | nindent 10 }}
{{- end }}
{{ if .Values.storage.storageClassName }}
storageClassName: {{ .Values.storage.storageClassName }}
{{ end }}
{{- if .Values.storage.dataSource }}
dataSource:
{{- toYaml .Values.storage.dataSource | nindent 10 }}
{{- end }}
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.storage.size }}