Skip to content

Commit fe84628

Browse files
committed
added helm chart
1 parent 7cbee20 commit fe84628

File tree

11 files changed

+255
-1
lines changed

11 files changed

+255
-1
lines changed

helm/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```bash
2+
helm install firetail-sensor-helm firetail-sensor/ --set apiKey="example"
3+
```

helm/firetail-sensor/.helmignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/

helm/firetail-sensor/Chart.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
apiVersion: v2
2+
name: firetail-sensor
3+
description: A Helm chart for Kubernetes
4+
5+
# A chart can be either an 'application' or a 'library' chart.
6+
#
7+
# Application charts are a collection of templates that can be packaged into versioned archives
8+
# to be deployed.
9+
#
10+
# Library charts provide useful utilities or functions for the chart developer. They're included as
11+
# a dependency of application charts to inject those utilities and functions into the rendering
12+
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
13+
type: application
14+
15+
# This is the chart version. This version number should be incremented each time you make changes
16+
# to the chart and its templates, including the app version.
17+
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18+
version: 0.1.0
19+
20+
# This is the version number of the application being deployed. This version number should be
21+
# incremented each time you make changes to the application. Versions are not expected to
22+
# follow Semantic Versioning. They should reflect the version the application is using.
23+
# It is recommended to use it with quotes.
24+
appVersion: "1.16.0"

helm/firetail-sensor/templates/NOTES.txt

Whitespace-only changes.
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "firetail-sensor.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "firetail-sensor.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create chart name and version as used by the chart label.
28+
*/}}
29+
{{- define "firetail-sensor.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "firetail-sensor.labels" -}}
37+
helm.sh/chart: {{ include "firetail-sensor.chart" . }}
38+
{{ include "firetail-sensor.selectorLabels" . }}
39+
{{- if .Chart.AppVersion }}
40+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41+
{{- end }}
42+
app.kubernetes.io/managed-by: {{ .Release.Service }}
43+
{{- end }}
44+
45+
{{/*
46+
Selector labels
47+
*/}}
48+
{{- define "firetail-sensor.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "firetail-sensor.name" . }}
50+
app.kubernetes.io/instance: {{ .Release.Name }}
51+
{{- end }}
52+
53+
{{/*
54+
Create the name of the service account to use
55+
*/}}
56+
{{- define "firetail-sensor.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "firetail-sensor.fullname" .) .Values.serviceAccount.name }}
59+
{{- else }}
60+
{{- default "default" .Values.serviceAccount.name }}
61+
{{- end }}
62+
{{- end }}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
apiVersion: v1
2+
kind: Secret
3+
metadata:
4+
name: firetail-api-token-secret
5+
namespace: {{ .Values.namespace }}
6+
type: Opaque
7+
data:
8+
api-key: {{ .Values.apiKey | b64enc | quote }}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
apiVersion: apps/v1
2+
kind: DaemonSet
3+
metadata:
4+
name: {{ .Release.Name }}-daemonset
5+
namespace: {{ .Values.namespace }}
6+
labels:
7+
app: {{ .Chart.Name }}
8+
release: {{ .Release.Name }}
9+
spec:
10+
selector:
11+
matchLabels:
12+
app: {{ .Chart.Name }}
13+
release: {{ .Release.Name }}
14+
template:
15+
metadata:
16+
labels:
17+
app: {{ .Chart.Name }}
18+
release: {{ .Release.Name }}
19+
annotations:
20+
{{- toYaml .Values.podAnnotations | nindent 8 }}
21+
spec:
22+
serviceAccountName: {{ .Release.Name }}-sa
23+
hostNetwork: true
24+
containers:
25+
- name: firetail-kubernetes-sensor
26+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
27+
imagePullPolicy: {{ .Values.image.pullPolicy }}
28+
env:
29+
{{- range $key, $value := .Values.env }}
30+
- name: "{{ $key }}"
31+
value: "{{ $value }}"
32+
{{- end }}
33+
- name: "FIRETAIL_API_TOKEN"
34+
valueFrom:
35+
secretKeyRef:
36+
name: "firetail-api-token-secret"
37+
key: "api-key"
38+
resources:
39+
{{- toYaml .Values.resources | nindent 12 }}
40+
securityContext:
41+
{{- toYaml .Values.securityContext | nindent 12 }}
42+
volumeMounts:
43+
- name: lib-modules
44+
mountPath: /lib/modules
45+
- name: usr-src
46+
mountPath: /usr/src
47+
volumes:
48+
- name: lib-modules
49+
hostPath:
50+
path: /lib/modules
51+
- name: usr-src
52+
hostPath:
53+
path: /usr/src
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
apiVersion: v1
2+
kind: Namespace
3+
metadata:
4+
name: {{ .Values.namespace }}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
apiVersion: v1
2+
kind: ServiceAccount
3+
metadata:
4+
name: {{ .Release.Name }}-sa
5+
namespace: {{ .Values.namespace }}
6+
labels:
7+
app: {{ .Chart.Name }}
8+
release: {{ .Release.Name }}
9+
---
10+
apiVersion: rbac.authorization.k8s.io/v1
11+
kind: ClusterRoleBinding
12+
metadata:
13+
name: {{ .Release.Name }}-service-list-access
14+
labels:
15+
app: {{ .Chart.Name }}
16+
release: {{ .Release.Name }}
17+
subjects:
18+
- kind: ServiceAccount
19+
name: {{ .Release.Name }}-sa
20+
namespace: {{ .Values.namespace }}
21+
roleRef:
22+
kind: ClusterRole
23+
name: {{ .Release.Name }}-list-services
24+
apiGroup: rbac.authorization.k8s.io
25+
---
26+
apiVersion: rbac.authorization.k8s.io/v1
27+
kind: ClusterRole
28+
metadata:
29+
name: {{ .Release.Name }}-list-services
30+
labels:
31+
app: {{ .Chart.Name }}
32+
release: {{ .Release.Name }}
33+
rules:
34+
- apiGroups: [""]
35+
resources: ["services"]
36+
verbs: ["get", "list", "watch"]

helm/firetail-sensor/values.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Default values for firetail-sensor.
2+
# This is a YAML-formatted file.
3+
# Declare variables to be passed into your templates.
4+
5+
image:
6+
repository: ghcr.io/firetail-io/kubernetes-sensor
7+
tag: v0.1.5
8+
pullPolicy: IfNotPresent
9+
10+
imagePullSecrets: []
11+
nameOverride: ""
12+
fullnameOverride: ""
13+
namespace: "firetail"
14+
serviceAccount:
15+
# Specifies whether a service account should be created
16+
create: true
17+
# Automatically mount a ServiceAccount's API credentials?
18+
automount: true
19+
# Annotations to add to the service account
20+
annotations: {}
21+
# The name of the service account to use.
22+
# If not set and create is true, a name is generated using the fullname template
23+
name: ""
24+
namespace: default
25+
26+
securityContext:
27+
privileged: true
28+
29+
30+
31+
32+
env:
33+
FIRETAIL_API_URL: "https://api.logging.eu-west-1.sandbox.firetail.app/logs/bulk"
34+
FIRETAIL_API_URL_EU: "https://api.logging.eu-west-1.firetail.app/logs/bulk"
35+
FIRETAIL_API_URL_US: "https://api.logging.us-east-2.us.firetail.app/logs/bulk"
36+
FIRETAIL_KUBERNETES_SENSOR_DEV_MODE: "false"
37+
FIRETAIL_KUBERNETES_SENSOR_DEV_SERVER_ENABLED: "false"
38+
BPF_EXPRESSION: "tcp and (port 80 or port 443) and not net 169.254.0.0/16 and not net fd00::/8"
39+
40+
41+
apiKey: ""

0 commit comments

Comments
 (0)