Skip to content

Commit

Permalink
add optional signalilo
Browse files Browse the repository at this point in the history
  • Loading branch information
alesz committed Sep 17, 2024
1 parent c2ae833 commit bd9128c
Show file tree
Hide file tree
Showing 7 changed files with 151 additions and 30 deletions.
17 changes: 14 additions & 3 deletions deploy/charts/scrubbed/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,31 @@ Deploy Scrubbed via Helm

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| image.repository | string | `"quay.io/adfinis/scrubbed"` | Scrubbed image repository |
| image.tag | string | `nil` | Scrubbed image version |
| replicaCount | int | `1` | Number of replicas |
| scrubbed.alertAnnotations | string | `""` | Space separated list of alert annotations to keep |
| scrubbed.alertLabels | string | `"alertname severity"` | Space separated list of alert labels to keep |
| scrubbed.commonAnnotations | string | `""` | Space separated list of common annotations to keep |
| scrubbed.commonLabels | string | `"alertname severity"` | Space separated list of common labels to keep |
| scrubbed.destinationURL | string | `"http://alert-receiver:8888/webhook"` | Destination URL to send scrubbed alerts to |
| scrubbed.groupLabels | string | `""` | Space separated list of group labels to keep |
| scrubbed.image.repository | string | `"quay.io/adfinis/scrubbed"` | Scrubbed image repository |
| scrubbed.image.tag | string | `nil` | Scrubbed image version |
| scrubbed.listenHost | string | `"0.0.0.0"` | Listener host of Scrubbed service |
| scrubbed.listenPort | string | `"8080"` | Listener port of Scrubbed service |
| scrubbed.logLevel | string | `"INFO"` | Scrubbed log level |
| scrubbed.replicaCount | int | `1` | Number of replicas |
| scrubbed.resources | object | `{}` | Resource limits and requests for scrubbed |
| scrubbed.serviceName | string | `"scrubbed"` | Scrubbed service name |
| signalilo.alertmanagerPluginOutputAnnotations | string | `"description\nmessage\n"` | The name of an annotation to retrieve the plugin_output from |
| signalilo.debug | string | `"0"` | If true, enable debugging mode in Icinga client |
| signalilo.enabled | bool | `false` | Enable Signalilo sidecar. If enabled, use image scrubbed-signalilo. |
| signalilo.icingaCA | string | `""` | A PEM string of the trusted CA certificate for the Icinga2 API certificate |
| signalilo.icingaHostname | string | `""` | Name of the Servicehost in Icinga2 |
| signalilo.icingaURL | string | `""` | URL of the Icinga API. It's possible to specify one or more URLs. The Parameter content will be split on newline character |
| signalilo.icingaUUID | string | `"00000000-0000-0000-0000-000000000000"` | UUID which identifies the Signalilo instance. |
| signalilo.icingaUsername | string | `""` | Authentication against Icinga2 API. |
| signalilo.listenPort | string | `"8888"` | Listen port of Signalilo service |
| signalilo.resources | object | `{}` | Resource limits and requests for scrubbed |
| signalilo.serviceName | string | `"signalilo"` | Signalilo service name |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)
8 changes: 8 additions & 0 deletions deploy/charts/scrubbed/ci/default-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
image:
repository: quay.io/adfinis/scrubbed-signalilo

scrubbed:
destinationURL: "http://signalilo:8888/webhook"

signalilo:
enabled: true
18 changes: 18 additions & 0 deletions deploy/charts/scrubbed/templates/configmap-signalilo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{- if .Values.signalilo.enabled -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "scrubbed.fullname" . }}-signalilo
labels:
{{- include "scrubbed.labels" . | nindent 4 }}
app.kubernetes.io/component: signalilo
data:
SIGNALILO_ALERTMANAGER_PLUGINOUTPUT_ANNOTATIONS: {{ .Values.signalilo.alertmanagerPluginOutputAnnotations | quote }}
SIGNALILO_ALERTMANAGER_PORT: {{ .Values.signalilo.listenPort | quote }}
SIGNALILO_ICINGA_CA: {{ .Values.signalilo.icingaCA | quote }}
SIGNALILO_ICINGA_DEBUG: {{ .Values.signalilo.debug | quote }}
SIGNALILO_ICINGA_HOSTNAME: {{ .Values.signalilo.icingaHostname | quote }}
SIGNALILO_ICINGA_URL: {{ .Values.signalilo.icingaURL | quote }}
SIGNALILO_ICINGA_USERNAME: {{ .Values.signalilo.icingaUsername | quote }}
SIGNALILO_UUID: {{ .Values.signalilo.icingaUUID | quote }}
{{- end -}}
41 changes: 39 additions & 2 deletions deploy/charts/scrubbed/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
name: {{ include "scrubbed.fullname" . }}
spec:
progressDeadlineSeconds: 60
replicas: {{ .Values.scrubbed.replicaCount }}
replicas: {{ .Values.replicaCount }}
revisionHistoryLimit: 2
selector:
matchLabels:
Expand All @@ -29,7 +29,7 @@ spec:
envFrom:
- configMapRef:
name: {{ include "scrubbed.fullname" . }}
image: "{{ .Values.scrubbed.image.repository }}:{{ default .Chart.AppVersion .Values.scrubbed.image.tag }}"
image: "{{ .Values.image.repository }}:{{ default .Chart.AppVersion .Values.image.tag }}"
imagePullPolicy: IfNotPresent
livenessProbe:
failureThreshold: 3
Expand Down Expand Up @@ -57,6 +57,43 @@ spec:
{{ toYaml .Values.scrubbed.resources | indent 10 }}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
{{- if .Values.signalilo.enabled }}
- command:
- signalilo
envFrom:
- configMapRef:
name: {{ include "scrubbed.fullname" . }}-signalilo
- secretRef:
name: {{ include "scrubbed.fullname" . }}-signalilo
image: "{{ .Values.image.repository }}:{{ default .Chart.AppVersion .Values.image.tag }}"
imagePullPolicy: IfNotPresent
livenessProbe:
failureThreshold: 3
httpGet:
path: /healthz
port: {{ .Values.signalilo.listenPort }}
scheme: HTTP
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
name: signalilo
ports:
- containerPort: {{ .Values.signalilo.listenPort }}
protocol: TCP
readinessProbe:
failureThreshold: 3
httpGet:
path: /healthz
port: {{ .Values.signalilo.listenPort }}
scheme: HTTP
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
resources:
{{ toYaml .Values.scrubbed.resources | indent 10 }}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
{{- end }}
dnsPolicy: ClusterFirst
restartPolicy: Always
securityContext: {}
Expand Down
25 changes: 25 additions & 0 deletions deploy/charts/scrubbed/templates/service-signalilo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{{- if .Values.signalilo.enabled -}}
apiVersion: v1
kind: Service
metadata:
name: {{ .Values.signalilo.serviceName }}
labels:
{{- include "scrubbed.labels" . | nindent 4 }}
app.kubernetes.io/component: signalilo
spec:
internalTrafficPolicy: Cluster
ipFamilyPolicy: SingleStack
ports:
- name: signalilo
port: {{ .Values.signalilo.listenPort }}
protocol: TCP
targetPort: {{ .Values.signalilo.listenPort }}
selector:
{{- include "scrubbed.selectorLabels" . | nindent 4 }}
app.kubernetes.io/component: scrubbed
sessionAffinity: ClientIP
sessionAffinityConfig:
clientIP:
timeoutSeconds: 10800
type: ClusterIP
{{- end -}}
72 changes: 47 additions & 25 deletions deploy/charts/scrubbed/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

image:
# -- Scrubbed image repository
repository: quay.io/adfinis/scrubbed
# -- Scrubbed image version
tag: ~

# -- Number of replicas
replicaCount: 1

scrubbed:
image:
# -- Scrubbed image repository
repository: quay.io/adfinis/scrubbed
# -- Scrubbed image version
tag: ~
# -- Number of replicas
replicaCount: 1
# -- Space separated list of alert annotations to keep
alertAnnotations: ""
# -- Space separated list of alert labels to keep
Expand All @@ -29,7 +31,8 @@ scrubbed:
# -- Scrubbed log level
logLevel: "INFO"
# -- Resource limits and requests for scrubbed
resources: {}
resources:
{}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
Expand All @@ -43,20 +46,39 @@ scrubbed:
# -- Scrubbed service name
serviceName: scrubbed

# signalilo:
# enabled: true
# alertmanagerPluginoutputAnnotations: |
# description
# message
# alertmanagerPort: "8888"
# icingaCA: |
# -----BEGIN CERTIFICATE-----
# -----END CERTIFICATE-----
# debug: "0"
# icingaHostname: ""
# icingaURL: ""
# icingaUsername: ""
# icingaUUID: ""
# externalSecret:
# enabled: true
# name: adfinis-alerting
signalilo:
# -- Enable Signalilo sidecar. If enabled, use image scrubbed-signalilo.
enabled: false
# -- The name of an annotation to retrieve the plugin_output from
alertmanagerPluginOutputAnnotations: |
description
message
# -- Listen port of Signalilo service
listenPort: "8888"
# -- A PEM string of the trusted CA certificate for the Icinga2 API certificate
icingaCA: ""
# -- If true, enable debugging mode in Icinga client
debug: "0"
# -- Name of the Servicehost in Icinga2
icingaHostname: ""
# -- URL of the Icinga API. It's possible to specify one or more URLs. The Parameter content will be split on newline character
icingaURL: ""
# -- Authentication against Icinga2 API.
icingaUsername: ""
# -- UUID which identifies the Signalilo instance.
icingaUUID: "00000000-0000-0000-0000-000000000000"
# -- Resource limits and requests for scrubbed
resources:
{}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 32Mi
# requests:
# cpu: 10m
# memory: 16Mi
# -- Signalilo service name
serviceName: signalilo

0 comments on commit bd9128c

Please sign in to comment.