Skip to content

Commit

Permalink
Adding helm repo
Browse files Browse the repository at this point in the history
  • Loading branch information
zentavr committed Nov 21, 2023
1 parent d25dc17 commit 420c720
Show file tree
Hide file tree
Showing 13 changed files with 1,022 additions and 0 deletions.
9 changes: 9 additions & 0 deletions helm-charts/dnsbl-exporter/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
template.*.yaml
template.*.yml
values.*.yaml
values.*.yml
*.tmp.sh
*.tmp.md
*.tmp.sql
TODO.md
charts/*
35 changes: 35 additions & 0 deletions helm-charts/dnsbl-exporter/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# 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/

# Local Files
values.*.yaml
values.*.yml
template.*.yaml
template.*.yml
*.tmp.sh
*.tmp.md
*.tmp.sql

# Kustomize stuff
kustomization-hook.sh
.kustomization/
6 changes: 6 additions & 0 deletions helm-charts/dnsbl-exporter/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: common
repository: https://charts.bitnami.com/bitnami
version: 2.8.0
digest: sha256:1e225bf982d279d23c11ffd86ce3b102547a3af814cc2f8c9450d876fa522341
generated: "2023-08-11T06:37:47.108428+03:00"
33 changes: 33 additions & 0 deletions helm-charts/dnsbl-exporter/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
annotations:
category: Exporter
apiVersion: v2
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
appVersion: v0.6.0

dependencies:
- name: common
repository: https://charts.bitnami.com/bitnami
tags:
- bitnami-common
version: 2.8.0
description: DNSBL Exporter for prometheus
keywords:
- dnsbl-exporter
maintainers:
- name: Andrii Miroshnychenko
url: https://github.com/zentavr
name: dnsbl-exporter
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 0.0.1
236 changes: 236 additions & 0 deletions helm-charts/dnsbl-exporter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,236 @@
# DNSBL Exporter

The helm chart installs DNSBL Exporter into Kubernetes cluster.

## Installation

Helm chart depends on `bitnami-common` helm chart from [Bitnami](https://github.com/bitnami/charts).
You need to install the repo before you can make any deployment:
```shell
helm repo add bitnami https://charts.bitnami.com/bitnami
```

Installation/Update looks like:

```shell
helm repo update bitnami
helm dependencies build

# Create namespace (only once)
kubectl create namespace dnsbl

# Install/Update
helm upgrade dnsbl ./ \
--install \
--create-namespace \
--namespace dnsbl ${OPTS} \
--values ./values.dnsbl.yml
```

Here we rely on `values.dnsbl.yml` which overrides the defaults in chart's `values.yaml`. As usual the defaults work well,
but if you would like to customise the setup, the file may look like this:
```yaml
---
image:
registry: docker.ti.local
repository: dnsbl-exporter
tag: 0.6.0
pullSecrets:
- rs-docker-registry

pdb:
create: true
minAvailable: 1
maxUnavailable: ""

service:
type: ClusterIP

resources:
limits:
cpu: 250m
memory: 256Mi
requests:
cpu: 50m
memory: 16Mi

configuration:
rbls:
# 0SPAM
- bl.0spam.org
- rbl.0spam.org
# NIXSPAM
- ix.dnsbl.manitu.net
# Spamhaus Zen
- zen.spamhaus.org
# Anonmails DNSBL
- spam.dnsbl.anonmails.de
# UCEPROTECT-Level 1
- dnsbl-1.uceprotect.net
# UCEPROTECT-Level 2
- dnsbl-2.uceprotect.net
# UCEPROTECT-Level 2
- dnsbl-3.uceprotect.net
# Backscatterer
- ips.backscatterer.org
# Barracuda Reputation Block List
- b.barracudacentral.org
# Blocklist.de
- bl.blocklist.de
# CALIVENT
- dnsbl.calivent.com.pe
# CYMRU BOGONS
- bogons.cymru.com
# DNS Servicios
- rbl.dns-servicios.com
# DRMX
- bl.drmx.org
# DRONEBL
- dnsbl.dronebl.org
# FABEL SOURCES
- spamsources.fabel.dk
# HIL HABEAS
- hil.habeas.com
# HIL2 HABEAS
- hil2.habeas.com
# Hostkarma
- hostkarma.junkemailfilter.com
# IBM DNS Blacklist
- dnsbl.cobion.com
# ICM FORBIDDEN
- forbidden.icm.edu.pl
# IMP WORM
- dnsrbl.swinog.ch
# IMP SPAM
- spamrbl.swinog.ch
- uribl.swinog.ch
# Spamhaus ZEN
- zen.spamhaus.org
# Spamhaus DBL - should not be used with IPs
#- dbl.spamhaus.org
- xbl.spamhaus.org
# SPFBL DNSBL
- dnsbl.spfbl.net
# Sender Score Reputation Network
- bl.score.senderscore.com
# SORBS BLOCK
- block.dnsbl.sorbs.net
# SORBS DUHL
- dul.dnsbl.sorbs.net
# SORBS HTTP
- http.dnsbl.sorbs.net
# SORBS MISC
- misc.dnsbl.sorbs.net
# SORBS NEW
- new.spam.dnsbl.sorbs.net
# SORBS SMTP
- smtp.dnsbl.sorbs.net
# SORBS SOCKS
- socks.dnsbl.sorbs.net
# SORBS SPAM
- spam.dnsbl.sorbs.net
# SORBS WEB
- web.dnsbl.sorbs.net
# SORBS ZOMBIE
- zombie.dnsbl.sorbs.net
# RATS Dyna
- dyna.spamrats.com
# RATS NoPtr
- noptr.spamrats.com
# RATS Spam
- spam.spamrats.com
# SEM BACKSCATTER
- backscatter.spameatingmonkey.net
# SEM BLACK
- bl.spameatingmonkey.net
# MSRBL Phishing
- phishing.rbl.msrbl.net
# MSRBL Spam
- spam.rbl.msrbl.net
# NETHERRELAYS
- relays.nether.net
# NETHERUNSURE
- unsure.nether.net
# NIXSPAM
- ix.dnsbl.manitu.net
# Nordspam BL
- bl.nordspam.com
# NoSolicitado
- bl.nosolicitado.org
# ORVEDB
- orvedb.aupads.org
# PSBL
- psbl.surriel.com
# RBL JP
- virus.rbl.jp
# RSBL
- rsbl.aupads.org
# s5h.net
- all.s5h.net
# SCHULTE
- rbl.schulte.org
# SERVICESNET
- korea.services.net
# SPAMCOP
- bl.spamcop.net
# Suomispam Reputation
- bl.suomispam.net
# SWINOG
- dnsrbl.swinog.ch
# TRIUMF
- rbl2.triumf.ca
# TRUNCATE
- truncate.gbudb.net
# Woodys SMTP Blacklist
- blacklist.woody.ch
# WPBL
- db.wpbl.info
# ZapBL
- dnsbl.zapbl.net
# INTERSERVER
- rbl.interserver.net
# JIPPG
- dialup.blacklist.jippg.org
# KEMPTBL
- dnsbl.kempt.net
# KISA
- spamlist.or.kr
# Konstant
- bl.konstant.no
# LASHBACK
- ubl.lashback.com
# LNSGBLOCK
- spamguard.leadmon.net
# MADAVI
- dnsbl.madavi.de
# MAILSPIKE BL
- bl.mailspike.net
# MAILSPIKE Z
- z.mailspike.net
targets:
# Main Server
- hq.example.com
# Backup MX
- mxb.example.com
# Sendgrid dedicated IP
- 10.1.1.1
resolver: "10.2.3.4:53"

extraDeploy:
- apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: dnsbl-rules
spec:
groups:
- name: dnsbl
rules:
- alert: RblsIpsBlacklisted
expr: max_over_time(luzilla_rbls_ips_blacklisted[60m]) > 0
for: 60m
labels:
severity: high
annotations:
description: '{{ "{{" }} $labels.hostname {{ "}}" }} ({{ "{{" }} $labels.ip {{ "}}" }}) has been blacklisted in {{ "{{" }} $labels.rbl {{ "}}" }} for more than 60 minutes.'
summary: 'Endpoint {{ "{{" }} $labels.hostname {{ "}}" }} is blacklisted'
```
70 changes: 70 additions & 0 deletions helm-charts/dnsbl-exporter/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "dnsbl.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 "dnsbl.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 "dnsbl.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create the name of the service account to use
*/}}
{{- define "dnsbl.serviceAccountName" -}}
{{- if .Values.serviceAccount.create -}}
{{ default (include "dnsbl.fullname" .) .Values.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.serviceAccount.name }}
{{- end -}}
{{- end -}}


{{/*
Return the proper application image name
*/}}
{{- define "dnsbl.image" -}}
{{ include "common.images.image" (dict "imageRoot" .Values.image "global" .Values.global) }}
{{- end -}}

{{/*
Return the proper Docker Image Registry Secret Names
*/}}
{{- define "dnsbl.imagePullSecrets" -}}
{{ include "common.images.pullSecrets" (dict "images" (list .Values.image) "global" .Values.global) }}
{{- end -}}

{{/*
Get the user defined LoadBalancerIP for this release.
Note, returns 127.0.0.1 if using ClusterIP.
*/}}
{{- define "dnsbl.serviceIP" -}}
{{- if eq .Values.service.type "ClusterIP" -}}
127.0.0.1
{{- else -}}
{{- .Values.service.loadBalancerIP | default "" -}}
{{- end -}}
{{- end -}}
Loading

0 comments on commit 420c720

Please sign in to comment.