-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #64 from ygqygq2/develop
feat: add prometheusalert
- Loading branch information
Showing
24 changed files
with
2,231 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Changelog | ||
|
||
## 1.0.0 (2024-11-20) | ||
|
||
- [ygqygq2/prometheusalert] - Release 1.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
annotations: | ||
category: ApplicationServer | ||
licenses: Apache-2.0 | ||
images: | | ||
- name: prometheusalert | ||
image: docker.io/feiyu563/prometheus-alert:v4.9.1 | ||
apiVersion: v2 | ||
appVersion: 4.9.1 | ||
dependencies: | ||
- name: common | ||
repository: https://ygqygq2.github.io/charts/ | ||
tags: | ||
- bitnami-common | ||
version: 2.x.x | ||
description: Chart for PrometheusAlert | ||
engine: gotpl | ||
name: prometheusalert | ||
version: 1.0.0 | ||
home: https://github.com/feiyu563/PrometheusAlert | ||
icon: https://raw.githubusercontent.com/feiyu563/PrometheusAlert/refs/heads/master/static/dist/img/logo.png | ||
keywords: | ||
- prometheus | ||
- alert | ||
- webhook | ||
maintainers: | ||
- email: [email protected] | ||
name: ygqygq2 | ||
sources: | ||
- https://github.com/feiyu563/PrometheusAlert |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
CHART NAME: {{ .Chart.Name }} | ||
CHART VERSION: {{ .Chart.Version }} | ||
APP VERSION: {{ .Chart.AppVersion }} | ||
** Please be patient while the chart is being deployed ** | ||
|
||
prometheusalert can be accessed: | ||
|
||
{{ if .Values.ingress.enabled }} | ||
* The application URL: | ||
|
||
{{- range .Values.ingress.hosts }} | ||
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ . }}{{ $.Values.ingress.path }} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
* Within your cluster, at the following DNS name at port {{ .Values.service.ingressPort }}: | ||
|
||
{{ include "common.names.fullname" . }}.{{ .Release.Namespace }}.svc | ||
|
||
* From outside the cluster, run these commands in the same shell: | ||
{{- if contains "NodePort" .Values.service.type }} | ||
|
||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "common.names.fullname" . }}) | ||
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") | ||
echo http://$NODE_IP:$NODE_PORT | ||
{{- else if contains "LoadBalancer" .Values.service.type }} | ||
|
||
WARNING: You have likely exposed your prometheusalert direct to the internet. | ||
prometheusalert does not implement any security for public facing clusters by default. | ||
As a minimum level of security; switch to ClusterIP/NodePort and place an Nginx gateway infront of the cluster in order to lock down access to dangerous HTTP endpoints and verbs. | ||
|
||
NOTE: It may take a few minutes for the LoadBalancer IP to be available. | ||
You can watch the status of by running 'kubectl get svc -w {{ include "common.names.fullname" . }}' | ||
|
||
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "common.names.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') | ||
echo http://$SERVICE_IP:{{ .Values.service.ports.http.port }} | ||
{{- else if contains "ClusterIP" .Values.service.type }} | ||
|
||
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") | ||
echo "Visit http://127.0.0.1:{{ .Values.service.ports.http.port }} to use prometheusalert" | ||
kubectl port-forward --namespace {{ .Release.Namespace }} $POD_NAME {{ .Values.service.ports.http.port }}:{{ .Values.service.ports.http.port }} | ||
{{- end }} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
{{/* | ||
Return the proper NGINX image name | ||
*/}} | ||
{{- define "prometheusalert.image" -}} | ||
{{ include "common.images.image" (dict "imageRoot" .Values.image "global" .Values.global) }} | ||
{{- end -}} | ||
|
||
{{/* | ||
Return the proper Prometheus metrics image name | ||
*/}} | ||
{{- define "prometheusalert.metrics.image" -}} | ||
{{ include "common.images.image" (dict "imageRoot" .Values.metrics.image "global" .Values.global) }} | ||
{{- end -}} | ||
|
||
{{/* | ||
Return the proper Docker Image Registry Secret Names | ||
*/}} | ||
{{- define "prometheusalert.imagePullSecrets" -}} | ||
{{ include "common.images.pullSecrets" (dict "images" (list .Values.image .Values.metrics.image) "global" .Values.global) }} | ||
{{- end -}} | ||
|
||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "prometheusalert.pvc" -}} | ||
{{- coalesce .Values.persistence.existingClaim (include "common.names.fullname" .) -}} | ||
{{- end -}} | ||
|
||
|
||
|
||
{{/* Check if there are rolling tags in the images */}} | ||
{{- define "prometheusalert.checkRollingTags" -}} | ||
{{- include "common.warnings.rollingTag" .Values.image }} | ||
{{- include "common.warnings.rollingTag" .Values.metrics.image }} | ||
{{- include "common.warnings.rollingTag" .Values.volumePermissions.image }} | ||
{{- end -}} | ||
|
||
{{/* | ||
Return the secret containing TLS certificates | ||
*/}} | ||
{{- define "prometheusalert.tlsSecretName" -}} | ||
{{- $secretName := coalesce .Values.tls.existingSecret .Values.tls.secretName -}} | ||
{{- if $secretName -}} | ||
{{- printf "%s" (tpl $secretName $) -}} | ||
{{- else -}} | ||
{{- printf "%s-crt" (include "common.names.fullname" .) -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Return true if a TLS secret object should be created | ||
*/}} | ||
{{- define "prometheusalert.createTlsSecret" -}} | ||
{{- if and .Values.tls.enabled .Values.tls.autoGenerated (not .Values.tls.secretName) (not .Values.tls.existingSecret) }} | ||
{{- true -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "prometheusalert.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create -}} | ||
{{ default (include "common.names.fullname" .) .Values.serviceAccount.name }} | ||
{{- else -}} | ||
{{ default "default" .Values.serviceAccount.name }} | ||
{{- end -}} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{{- if .Values.config.enabled -}} | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ include "common.names.fullname" . }} | ||
namespace: {{ .Release.Namespace | quote }} | ||
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} | ||
{{- if .Values.commonAnnotations }} | ||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} | ||
{{- end }} | ||
data: | ||
{{- toYaml .Values.config.data | nindent 2 }} | ||
{{- end -}} |
Oops, something went wrong.