kubeshark
by Kubeshark
The API Traffic Analyzer for Kubernetes
About this chart
Helm Chart of Kubeshark
Official
Add the Helm repo for Kubeshark:
helm repo add kubeshark https://helm.kubeshark.com
then install Kubeshark:
helm install kubeshark kubeshark/kubeshark
Local
Clone the repo:
git clone [email protected]:kubeshark/kubeshark.git --depth 1
cd kubeshark/helm-chart
In case you want to clone a specific tag of the repo (e.g. v52.3.59):
git clone [email protected]:kubeshark/kubeshark.git --depth 1 --branch <tag>
cd kubeshark/helm-chart
See the list of available tags here: https://github.com/kubeshark/kubeshark/tags
Render the templates
helm template .
Install Kubeshark:
helm install kubeshark .
Uninstall Kubeshark:
helm uninstall kubeshark
Port-forward
Do the port forwarding:
kubectl port-forward service/kubeshark-front 8899:80
Visit localhost:8899
You can also use kubeshark proxy for a more stable port-forward connection.
Add a License Key
When it's necessary, you can use:
--set license=YOUR_LICENSE_GOES_HERE
Get your license from Kubeshark's Admin Console.
Installing with Ingress (EKS) enabled
helm install kubeshark kubeshark/kubeshark -f values.yaml
Set this value.yaml:
tap:
ingress:
enabled: true
className: "alb"
host: ks.example.com
tls: []
annotations:
alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:us-east-1:7..8:certificate/b...65c
alb.ingress.kubernetes.io/target-type: ip
alb.ingress.kubernetes.io/scheme: internet-facing
Adding your own resources
tap.extraObjects renders arbitrary manifests alongside the chart's own resources, so you can add
what your cluster needs without forking the chart. Entries are rendered through the template
engine, so .Release, .Values and the chart helpers are all available.
On OpenShift, for example, you would disable the ingress and add a Route instead:
tap:
ingress:
enabled: false
extraObjects:
# A mapping entry, templated field by field.
- apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: kubeshark-front
namespace: '{{ .Release.Namespace }}'
labels:
app.kubeshark.com/app: front
spec:
host: kubeshark.apps.example.com
to:
kind: Service
name: kubeshark-front
port:
targetPort: kubeshark-front
tls:
termination: edge
insecureEdgeTerminationPolicy: Redirect
# A raw YAML string entry, templated as a whole.
- |
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-extra
namespace: {{ .Release.Namespace }}
data:
note: rendered by tap.extraObjects
The chart never parses these manifests, it only renders them, so anything the cluster accepts works here, including CRDs the chart knows nothing about.
Disabling IPV6
Not all have IPV6 enabled, hence this has to be disabled as follows:
helm install kubeshark kubeshark/kubeshark \
--set tap.ipv6=false
Prometheus Metrics
Please refer to metrics documentation for details.
Override Tag, Tags, Images
In addition to using a private registry, you can further override the images' tag, specific image tags and specific image names.
Example for overriding image names:
docker:
overrideImage:
worker: docker.io/kubeshark/worker:v52.3.87
front: docker.io/kubeshark/front:v52.3.87
hub: docker.io/kubeshark/hub:v52.3.87
Configuration
| Parameter | Description | Default |
|---|---|---|
tap.docker.registry | Docker registry to pull from | docker.io/kubeshark |
tap.docker.tag | Tag of the Docker images | latest |
tap.docker.tagLocked | Lock the Docker image tags to prevent automatic upgrades to the latest branch image version. | true |
tap.docker.tagLocked | If false - use latest minor tag | true |
tap.docker.imagePullPolicy | Kubernetes image pull policy | Always |
tap.docker.imagePullSecrets | Kubernetes secrets to pull the images | [] |
tap.docker.overrideImage | Can be used to directly override image names | "" |
tap.docker.overrideTag | Can be used to override image tags | "" |
tap.proxy.hub.srvPort | Hub server port. Change if already occupied. | 8898 |
tap.proxy.worker.srvPort | Worker server port. Change if already occupied. | 48999 |
tap.proxy.front.port | Front service port. Change if already occupied. | 8899 |
tap.proxy.host | Change to 0.0.0.0 top open up to the world. | 127.0.0.1 |
tap.regex | Target (process traffic from) pods that match regex | .* |
tap.namespaces | Target pods in namespaces | [] |
tap.excludedNamespaces | Exclude pods in namespaces | [] |
tap.bpfOverride | When using AF_PACKET as a traffic capture backend, override any existing pod targeting rules and set explicit BPF expression (e.g. net 0.0.0.0/0). | [] |
tap.capture.dissection.enabled | Set to true to have L7 protocol dissection start automatically. When set to false, dissection is disabled by default. This property can be dynamically controlled via the dashboard. | true |
tap.capture.dissection.stopAfter | Set to a duration (e.g. 30s) to have L7 dissection stop after no activity. | 5m |
tap.capture.raw.enabled | Enable raw capture of packets and syscalls to disk for offline analysis | true |
tap.capture.raw.storageSize | Maximum storage size for raw capture files (supports K8s quantity format: 1Gi, 500Mi, etc.) | 1Gi |
tap.capture.captureSelf | Include Kubeshark's own traffic in capture | false |
tap.capture.dbMaxSize | Maximum size for capture database (e.g., 4Gi, 2000Mi). | 500Mi |
tap.snapshots.local.storageClass | Storage class for local snapshots volume. When empty, uses emptyDir. When set, creates a PVC with this storage class | "" |
tap.snapshots.local.storageSize | Storage size for local snapshots volume (supports K8s quantity format: 1Gi, 500Mi, etc.) | 20Gi |
tap.snapshots.cloud.provider | Cloud storage provider for snapshots: s3, azblob, or gcs. Empty string disables cloud storage. See Cloud Storage docs. | "" |
tap.snapshots.cloud.prefix | Key prefix in the bucket/container (e.g. snapshots/). See Cloud Storage docs. | "" |
Deploy kubeshark with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has kubeshark on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartkubeshark is pinned at v53.6.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply