Skip to content

Commit

Permalink
Helm chart notifications (#222)
Browse files Browse the repository at this point in the history
* Notifications should work without http proxy set

Before this change when proxy was not set in config, sending notification resulted in notification error:

E0728 16:44:53.027020       1 notifications.go:47] error reporting attack for v1.Deployment <NAME> to <URL> with message <MESSAGE> send request: http request: Post "<URL>": proxyconnect tcp: dial tcp :0: connect: connection refused

* helm chart support for notifications

* chore: fix whitespace trim in rbac template

right trim resulted in `helm template ...` output:
```

---apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
```

* bump chart version

* chore: add whitespace in debug config to match other lines

Co-authored-by: Daniel Albuquerque <[email protected]>
  • Loading branch information
danielllek and worldtiki authored Jul 29, 2021
1 parent 3a31519 commit 2144ca6
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion helm/kubemonkey/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ apiVersion: v1
appVersion: 0.4.0
description: A Helm chart for Kubernetes
name: kube-monkey
version: 1.4.0
version: 1.4.1
1 change: 1 addition & 0 deletions helm/kubemonkey/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ $ helm get manifest my-release
| `config.debug.enabled` | debug mode,need to be enabled to see debuging behaviour | false |
| `config.debug.schedule_immediate_kill` | immediate pod kill matching other rules apart from time | false |
| `config.notifications.enabled` | enables reporting of attacks to an HTTP endpoint | false |
| `config.notifications.proxy` | notifications proxy URL | |
| `config.notifications.attacks` | HTTP collector in the form (endpoint,message,headers) where attacks will be reported to | |
| `args.logLevel` | go log level | 5 |
| `args.logDir` | log directory | /var/log/kube-monkey |
Expand Down
11 changes: 9 additions & 2 deletions helm/kubemonkey/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ data:
{{- end }}
time_zone = {{ .Values.config.timeZone | quote }}
[debug]
enabled= {{ .Values.config.debug.enabled }}
schedule_immediate_kill= {{ .Values.config.debug.schedule_immediate_kill }}
enabled = {{ .Values.config.debug.enabled }}
schedule_immediate_kill = {{ .Values.config.debug.schedule_immediate_kill }}
[notifications]
enabled = {{ .Values.config.notifications.enabled }}
{{- if ne .Values.config.notifications.proxy "" }}
proxy = {{ .Values.config.notifications.proxy}}
{{- end }}
[notifications.attacks]
{{ indent 6 .Values.config.notifications.attacks -}}

2 changes: 1 addition & 1 deletion helm/kubemonkey/templates/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ metadata:

---

{{- if .Values.rbac.enabled -}}
{{- if .Values.rbac.enabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
Expand Down
4 changes: 4 additions & 0 deletions helm/kubemonkey/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ config:
debug:
enabled: false # if you want to enable debugging and see how pods killed immediately set enabled and schedule_immediate_kill to true
schedule_immediate_kill: false
notifications:
enabled: false
proxy: ""
attacks: ""

args:
logLevel: 5
Expand Down

0 comments on commit 2144ca6

Please sign in to comment.