Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
NAME := helm-k8s-sentry
HELM_VERSION := 3.3.4
HELM_IN_DOCKER := docker run --rm -v ${PWD}:/apps alpine/helm:$(HELM_VERSION)

helm_lint:
$(HELM_IN_DOCKER) lint ./$(NAME)

helm_template:
$(HELM_IN_DOCKER) template ./$(NAME)

helm_package:
$(HELM_IN_DOCKER) package ./$(NAME) --destination docs
$(HELM_IN_DOCKER) repo index docs --url https://daaain.github.io/k8s-sentry

.PHONY: helm_lint helm_template helm_package


20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,25 @@ _k8s-sentry_ watches for several things:

See [deploy](deploy/) for Kubernetes manifests and installation instructions.

Or you can use Helm to deploy:

```sh
helm repo add k8s-sentry https://wichert.github.io/k8s-sentry
helm repo update
helm install sentry k8s-sentry/helm-k8s-sentry --set sentry.dsn=<your Sentry DSN value>
```

For other configuration options see: [values.yaml](helm-k8s-sentry/values.yaml)

## Configuration

Configuration is done completely via environment variables.

| Variable | Description |
| -- | -- |
| `SENTRY_DSN` | **Required** DSN for a Sentry project. |
| `SENTRY_ENVIRONMENT` | Environment for Sentry issues. If not set the namespace is used as environment. |
| `NAMESPACE` | Comma separated set of namespaces to minitor. If not set all namespaces are monitored (as far as permissions allow) |
| Variable | Description |
| -------------------- | ------------------------------------------------------------------------------------------------------------------- |
| `SENTRY_DSN` | **Required** DSN for a Sentry project. |
| `SENTRY_ENVIRONMENT` | Environment for Sentry issues. If not set the namespace is used as environment. |
| `NAMESPACE` | Comma separated set of namespaces to monitor. If not set all namespaces are monitored (as far as permissions allow) |

## Issue grouping

Expand Down
Binary file added docs/helm-k8s-sentry-0.1.0.tgz
Binary file not shown.
15 changes: 15 additions & 0 deletions docs/index.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
entries:
helm-k8s-sentry:
- apiVersion: v1
created: "2020-10-15T15:57:12.9780604Z"
description: A Helm chart to enable Sentry reporting of Kubernetes errors
digest: 0203b6e006db60faaa6e75b957625490fc519e4982a6387d77dbf347dfa844ae
home: https://wichert.github.io/k8s-sentry
name: helm-k8s-sentry
sources:
- https://github.com/wichert/k8s-sentry
urls:
- https://daaain.github.io/k8s-sentry/helm-k8s-sentry-0.1.0.tgz
version: 0.1.0
generated: "2020-10-15T15:57:12.9741673Z"
7 changes: 7 additions & 0 deletions helm-k8s-sentry/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
name: helm-k8s-sentry
description: A Helm chart to enable Sentry reporting of Kubernetes errors
version: 0.1.0
home: https://wichert.github.io/k8s-sentry
sources:
- https://github.com/wichert/k8s-sentry
40 changes: 40 additions & 0 deletions helm-k8s-sentry/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{.Values.name}}
spec:
selector:
matchLabels:
app: {{.Values.deploymentName}}
template:
metadata:
labels:
app: {{.Values.deploymentName}}
spec:
serviceAccountName: {{.Values.name}}
containers:
- name: {{.Values.deploymentName}}
image: {{.Values.image}}
env:
- name: SENTRY_DSN
value: {{.Values.sentry.dsn}}
{{- if .Values.namespaces }}
- name: NAMESPACE
value: {{.Values.namespaces}}
{{- else if .Values.singleNamespace }}
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{- end }}
{{- if .Values.sentry.environment }}
- name: SENTRY_ENVIRONMENT
value: {{.Values.sentry.environment}}
{{- end }}
resources:
requests:
memory: 10Mi
cpu: 5m
limits:
memory: 64Mi
cpu: 50m
34 changes: 34 additions & 0 deletions helm-k8s-sentry/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{.Values.name}}
{{- if not .Values.singleNamespace }}
namespace: default
{{- end }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{.Values.name}}
rules:
- apiGroups: [""]
resources: ["events"]
verbs: ["list", "watch"]
- apiGroups: [""]
resources: ["pods"]
verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{.Values.name}}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{.Values.name}}
subjects:
- kind: ServiceAccount
name: {{.Values.name}}
{{- if not .Values.singleNamespace }}
namespace: default
{{- end }}
9 changes: 9 additions & 0 deletions helm-k8s-sentry/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: k8s-sentry
deploymentName: k8s-sentry
image: wichert/k8s-sentry:1.5.0

# singleNamespace: true # do not set to true if `namespaces` is set
# namespaces: "default,kube-system"
sentry:
dsn: "this must be set when deploying the Helm chart"
# environment: "test"