Skip to content

Commit

Permalink
Merge pull request #101 from qpoint-io/marc-barry/qtap
Browse files Browse the repository at this point in the history
Add a qpoint-tap chart
  • Loading branch information
tylerflint authored Jul 5, 2024
2 parents 0faa94e + 35a68fc commit d3a322b
Show file tree
Hide file tree
Showing 9 changed files with 377 additions and 0 deletions.
23 changes: 23 additions & 0 deletions charts/qpoint-tap/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
17 changes: 17 additions & 0 deletions charts/qpoint-tap/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v2
name: qpoint-tap
description: A Helm chart for running Qpoint Tap on Kubernetes
icon: data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyBpZD0iTGF5ZXJfMiIgZGF0YS1uYW1lPSJMYXllciAyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNDMuNjMgMzIuOSI+CiAgPGRlZnM+CiAgICA8c3R5bGU+CiAgICAgIC5jbHMtMSwgLmNscy0yIHsKICAgICAgICBzdHJva2Utd2lkdGg6IDBweDsKICAgICAgfQoKICAgICAgLmNscy0zIHsKICAgICAgICBmaWxsOiBub25lOwogICAgICAgIHN0cm9rZTogIzEwMTQxNzsKICAgICAgICBzdHJva2UtbGluZWNhcDogcm91bmQ7CiAgICAgICAgc3Ryb2tlLW1pdGVybGltaXQ6IDEwOwogICAgICAgIHN0cm9rZS13aWR0aDogMi41NXB4OwogICAgICB9CgogICAgICAuY2xzLTIgewogICAgICAgIGZpbGw6ICMxMDE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hdGggY2xhc3M9ImNscy0xIiBkPSJtMTI1LjUzLDEwLjM2di0zLjU2aDE1LjMydjMuNTZoLTUuNXYxNC41N2gtNC4zMnYtMTQuNTdoLTUuNTFaIi8+CiAgICAgIDwvZz4KICAgIDwvZz4KICA8L2c+Cjwvc3ZnPg==

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.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.0.1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "v0.1.8"
5 changes: 5 additions & 0 deletions charts/qpoint-tap/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# qpoint-tap Helm chart

This deploys Qpoint Tap to Kubernetes using [Helm](https://helm.sh/).

Tap into traffic streams and analyze without a proxy. This chart uses eBPF and requires necessary permissions to load eBPF programs.
62 changes: 62 additions & 0 deletions charts/qpoint-tap/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "qpoint.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 "qpoint.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 "qpoint.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "qpoint.labels" -}}
helm.sh/chart: {{ include "qpoint.chart" . }}
{{ include "qpoint.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "qpoint.selectorLabels" -}}
app.kubernetes.io/name: {{ include "qpoint.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "qpoint.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "qpoint.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
8 changes: 8 additions & 0 deletions charts/qpoint-tap/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "qpoint.fullname" . }}-config
labels: {{- include "qpoint.labels" . | nindent 4 }}
data:
tap-config.yaml: |
{{- .Values.config | nindent 4 }}
123 changes: 123 additions & 0 deletions charts/qpoint-tap/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: {{ include "qpoint.fullname" . }}
labels:
{{- include "qpoint.labels" . | nindent 4 }}
spec:
selector:
matchLabels:
{{- include "qpoint.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "qpoint.labels" . | nindent 8 }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
hostPID: true
hostNetwork: true
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "qpoint.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
{{- toYaml .Values.args | nindent 12 }}
env:
- name: REGISTRATION_ENDPOINT
value: "{{ .Values.registrationEndpoint }}"
{{- if .Values.registrationToken }}
- name: REGISTRATION_TOKEN
valueFrom:
secretKeyRef:
name: {{ include "qpoint.fullname" . }}-token
key: token
{{- end }}
{{- if .Values.config }}
- name: QPOINT_CONFIG
value: "/app/tap-config.yaml"
{{- end }}
- name: STATUS_LISTEN
value: "{{ .Values.status.addr }}:{{ .Values.status.port }}"
- name: LOG_LEVEL
value: "{{ .Values.logLevel }}"
- name: LOG_ENCODING
value: "{{ .Values.logEncoding }}"
- name: TINI_SUBREAPER
value: "1"
ports:
- name: status
containerPort: {{ .Values.status.port }}
protocol: TCP
startupProbe:
httpGet:
path: /readyz
port: status
initialDelaySeconds: 3
periodSeconds: 5
timeoutSeconds: 2
successThreshold: 1
failureThreshold: 20
readinessProbe:
httpGet:
path: /readyz
port: status
initialDelaySeconds: 3
periodSeconds: 5
timeoutSeconds: 2
successThreshold: 1
failureThreshold: 1
livenessProbe:
httpGet:
path: /healthz
port: status
initialDelaySeconds: 3
periodSeconds: 10
timeoutSeconds: 2
successThreshold: 1
failureThreshold: 3
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- name: config-volume
mountPath: /app/tap-config.yaml
subPath: tap-config.yaml
{{- with .Values.volumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
volumes:
- name: config-volume
configMap:
name: {{ include "qpoint.fullname" . }}-config
items:
- key: tap-config.yaml
path: tap-config.yaml
{{- with .Values.volumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
10 changes: 10 additions & 0 deletions charts/qpoint-tap/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{{- if .Values.registrationToken }}
apiVersion: v1
kind: Secret
metadata:
name: {{ include "qpoint.fullname" . }}-token
labels: {{- include "qpoint.labels" . | nindent 4 }}
type: Opaque
data:
token: {{ .Values.registrationToken | b64enc }}
{{- end }}
13 changes: 13 additions & 0 deletions charts/qpoint-tap/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "qpoint.serviceAccountName" . }}
labels:
{{- include "qpoint.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
automountServiceAccountToken: {{ .Values.serviceAccount.automount }}
{{- end }}
116 changes: 116 additions & 0 deletions charts/qpoint-tap/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# Default values for qpoint.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

replicaCount: 1

image:
repository: us-docker.pkg.dev/qpoint-edge/public/qpoint
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: ""

imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""

args: ["tap"]

registrationEndpoint: "https://api.qpoint.io"

serviceAccount:
# Specifies whether a service account should be created
create: true
# Automatically mount a ServiceAccount's API credentials?
automount: true
# Annotations to add to the service account
annotations: {}
# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name: ""

podAnnotations: {}
podLabels: {}

podSecurityContext:
# fsGroup: 2000

securityContext:
allowPrivilegeEscalation: true
capabilities:
add: ["CAP_BPF", "CAP_SYS_ADMIN"]
readOnlyRootFilesystem: false
runAsNonRoot: false
runAsUser: 0
runAsGroup: 0
privileged: true

# One of debug, info, warn, error, dpanic, panic, fatal
logLevel: "info"

# One of console, json
logEncoding: "json"

status:
addr: 0.0.0.0
port: 10001

middlewareEgress:
addr: 127.0.0.1
port: 11001

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: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi

# Additional volumes on the output Deployment definition.
volumes:
# - name: foo
# secret:
# secretName: mysecret
# optional: false
- name: sys
hostPath:
# Ensure the file directory is created.
path: /sys
type: Directory

# Additional volumeMounts on the output Deployment definition.
volumeMounts:
# - name: foo
# mountPath: "/etc/foo"
# readOnly: true
- name: sys
mountPath: "/sys"
readOnly: true

nodeSelector: {}

tolerations: []

affinity: {}

# API token
registrationToken: ""

config: ""
# config: |
# stacks: {}
# tap:
# default_stack: "example"
# default_domain_action: IGNORE # default capture action
# endpoints: []
# # Proxy configurations
# proxy:
# jwt_hmac_key: "qwertyuiopasdfghjklzxcvbnm123456"
# default_domain_action: ALLOW
# endpoints: []

0 comments on commit d3a322b

Please sign in to comment.