diff --git a/deploy/charts/scrubbed/README.md b/deploy/charts/scrubbed/README.md index 2256766..090ffc6 100644 --- a/deploy/charts/scrubbed/README.md +++ b/deploy/charts/scrubbed/README.md @@ -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) diff --git a/deploy/charts/scrubbed/ci/default-values.yaml b/deploy/charts/scrubbed/ci/default-values.yaml index e69de29..289fb0b 100644 --- a/deploy/charts/scrubbed/ci/default-values.yaml +++ b/deploy/charts/scrubbed/ci/default-values.yaml @@ -0,0 +1,8 @@ +image: + repository: quay.io/adfinis/scrubbed-signalilo + +scrubbed: + destinationURL: "http://signalilo:8888/webhook" + +signalilo: + enabled: true diff --git a/deploy/charts/scrubbed/templates/configmap-signalilo.yaml b/deploy/charts/scrubbed/templates/configmap-signalilo.yaml new file mode 100644 index 0000000..2710a13 --- /dev/null +++ b/deploy/charts/scrubbed/templates/configmap-signalilo.yaml @@ -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 -}} diff --git a/deploy/charts/scrubbed/templates/deployment.yaml b/deploy/charts/scrubbed/templates/deployment.yaml index 4125044..312dbeb 100644 --- a/deploy/charts/scrubbed/templates/deployment.yaml +++ b/deploy/charts/scrubbed/templates/deployment.yaml @@ -7,7 +7,7 @@ metadata: name: {{ include "scrubbed.fullname" . }} spec: progressDeadlineSeconds: 60 - replicas: {{ .Values.scrubbed.replicaCount }} + replicas: {{ .Values.replicaCount }} revisionHistoryLimit: 2 selector: matchLabels: @@ -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 @@ -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: {} diff --git a/deploy/charts/scrubbed/templates/service.yaml b/deploy/charts/scrubbed/templates/service-scrubbed.yaml similarity index 100% rename from deploy/charts/scrubbed/templates/service.yaml rename to deploy/charts/scrubbed/templates/service-scrubbed.yaml diff --git a/deploy/charts/scrubbed/templates/service-signalilo.yaml b/deploy/charts/scrubbed/templates/service-signalilo.yaml new file mode 100644 index 0000000..c560c34 --- /dev/null +++ b/deploy/charts/scrubbed/templates/service-signalilo.yaml @@ -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 -}} diff --git a/deploy/charts/scrubbed/values.yaml b/deploy/charts/scrubbed/values.yaml index 277c109..56ada8a 100644 --- a/deploy/charts/scrubbed/values.yaml +++ b/deploy/charts/scrubbed/values.yaml @@ -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 @@ -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 @@ -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