-
Notifications
You must be signed in to change notification settings - Fork 88
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 #142 from idealista/develop
Release 2.5.0
- Loading branch information
Showing
19 changed files
with
337 additions
and
9 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
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 |
---|---|---|
|
@@ -4,8 +4,7 @@ LABEL maintainer="[email protected]" | |
|
||
EXPOSE 8089 | ||
|
||
RUN apk add gcc libc-dev linux-headers --update-cache \ | ||
&& rm -rf /var/cache/apk/* | ||
RUN apk add gcc libc-dev linux-headers --no-cache | ||
|
||
WORKDIR /opt/prom2teams | ||
|
||
|
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
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,22 @@ | ||
# 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 | ||
.vscode/ |
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 @@ | ||
apiVersion: v1 | ||
appVersion: "1.0" | ||
description: A Helm chart for Prom2Teams | ||
name: prom2teams | ||
version: 0.1.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,43 @@ | ||
{%- set | ||
theme_colors = { | ||
'resolved' : '2DC72D', | ||
'critical' : '8C1A1A', | ||
'severe' : '8C1A1A', | ||
'warning' : 'FF9A0B', | ||
'unknown' : 'CCCCCC' | ||
} | ||
-%} | ||
|
||
{ | ||
"@type": "MessageCard", | ||
"@context": "http://schema.org/extensions", | ||
"themeColor": "{% if status=='resolved' %} {{ theme_colors.resolved }} {% else %} {{ theme_colors[msg_text.severity] }} {% endif %}", | ||
"summary": "{% if status=='resolved' %}(Resolved) {% endif %}{{ msg_text.summary }}", | ||
"title": "{{ msg_text.name }} {% if status=='resolved' %}(Resolved) {% elif status=='unknown' %} (status unknown) {% endif %}", | ||
"sections": [{ | ||
"activityTitle": "{{ msg_text.message }}", | ||
"facts": [{% if msg_text.name %}{ | ||
"name": "Alarm", | ||
"value": "{{ msg_text.name }}" | ||
},{% endif %}{% if msg_text.instance %}{ | ||
"name": "In host", | ||
"value": "{{ msg_text.instance }}" | ||
},{% endif %}{% if msg_text.severity %}{ | ||
"name": "Severity", | ||
"value": "{{ msg_text.severity }}" | ||
},{% endif %}{% if msg_text.runbook_url %}{ | ||
"name": "Runbook", | ||
"value": "{{ msg_text.runbook_url }}" | ||
},{% endif %}{% if msg_text.description %}{ | ||
"name": "Description", | ||
"value": "{{ msg_text.description }}" | ||
},{% endif %}{ | ||
"name": "Status", | ||
"value": "{{ msg_text.status }}" | ||
}{% if msg_text.extra_labels %}{% for key in msg_text.extra_labels %},{ | ||
"name": "{{ key }}", | ||
"value": "{{ msg_text.extra_labels[key] }}" | ||
}{% endfor %}{% endif %}], | ||
"markdown": true | ||
}] | ||
} |
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,2 @@ | ||
Prom2Teams has been installed. Check its status by running: | ||
kubectl --namespace {{ .Release.Namespace }} get pods -l "release={{ .Release.Name }}" |
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,45 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "prom2teams.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 "prom2teams.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 "prom2teams.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "prom2teams.labels" -}} | ||
app.kubernetes.io/name: {{ include "prom2teams.name" . }} | ||
helm.sh/chart: {{ include "prom2teams.chart" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- 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,22 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: prom2teams-config | ||
labels: | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
data: | ||
config.ini: |- | ||
[HTTP Server] | ||
Host: {{ .Values.prom2teams.ip }} | ||
Port: {{ .Values.prom2teams.port }} | ||
[Microsoft Teams] | ||
Connector: {{ .Values.prom2teams.connector }} | ||
[Group Alerts] | ||
Field: {{ .Values.prom2teams.group_alerts_by }} | ||
[Log] | ||
Level: {{ .Values.prom2teams.loglevel }} | ||
[Template] | ||
Path: {{ .Values.prom2teams.templatepath }} | ||
#config.ini: {{ .Files.Get "files/config.ini" | quote }} | ||
teams.j2: {{ .Files.Get "files/teams.j2" | quote }} |
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,54 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "prom2teams.fullname" . }} | ||
labels: | ||
{{ include "prom2teams.labels" . | indent 4 }} | ||
spec: | ||
replicas: {{ .Values.replicaCount }} | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/name: {{ include "prom2teams.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
template: | ||
metadata: | ||
labels: | ||
app.kubernetes.io/name: {{ include "prom2teams.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
spec: | ||
{{- with .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
volumes: | ||
- name: config | ||
configMap: | ||
name: prom2teams-config | ||
containers: | ||
- name: {{ .Chart.Name }} | ||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
ports: | ||
- name: http | ||
containerPort: 8089 | ||
protocol: TCP | ||
volumeMounts: | ||
- name: config | ||
mountPath: /opt/prom2teams/helmconfig/ | ||
env: | ||
- name: APP_CONFIG_FILE | ||
value: {{ .Values.prom2teams.config }} | ||
resources: | ||
{{- toYaml .Values.resources | nindent 12 }} | ||
{{- with .Values.nodeSelector }} | ||
nodeSelector: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.affinity }} | ||
affinity: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.tolerations }} | ||
tolerations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- 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,16 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ include "prom2teams.fullname" . }} | ||
labels: | ||
{{ include "prom2teams.labels" . | indent 4 }} | ||
spec: | ||
type: {{ .Values.service.type }} | ||
ports: | ||
- port: {{ .Values.service.port }} | ||
targetPort: 8089 | ||
protocol: TCP | ||
name: http | ||
selector: | ||
app.kubernetes.io/name: {{ include "prom2teams.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} |
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,16 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: "{{ include "prom2teams.fullname" . }}-test-connection" | ||
labels: | ||
{{ include "prom2teams.labels" . | indent 4 }} | ||
annotations: | ||
"helm.sh/hook": test-success | ||
"helm.sh/hook-delete-policy": test-success,test-failure | ||
spec: | ||
containers: | ||
- name: wget | ||
image: busybox | ||
command: ['wget'] | ||
args: ['{{ include "prom2teams.fullname" . }}:{{ .Values.service.port }}'] | ||
restartPolicy: Never |
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 @@ | ||
# Default values for prom2teams. | ||
# This is a YAML-formatted file. | ||
# Declare variables to be passed into your templates. | ||
|
||
image: | ||
repository: idealista/prom2teams | ||
tag: 2.4.0 | ||
pullPolicy: IfNotPresent | ||
|
||
resources: | ||
requests: | ||
cpu: 100m | ||
memory: 128Mi | ||
limits: | ||
cpu: 200m | ||
memory: 200Mi | ||
|
||
service: | ||
type: ClusterIP | ||
port: 8089 | ||
|
||
prom2teams: | ||
host: 0.0.0.0 | ||
port: 8089 | ||
connector: | ||
group_alerts_by: | ||
loglevel: INFO | ||
templatepath: /opt/prom2teams/helmconfig/teams.j2 | ||
config: /opt/prom2teams/helmconfig/config.ini |
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
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
Oops, something went wrong.