Kubernetes

Sysdig provides a variety of deployment options for the Sysdig agent and associated components, including standalone installations and container deployments. However, for users deploying Sysdig components on Kubernetes, only installation using the Helm package manager is supported. If you are just installing agents for Sysdig Monitor, see Sysdig Monitor Installation. If you are installing agents for an on-prem deployment, see On-Premises Agent Installation.

Helm is a popular tool for managing Kubernetes applications, and it provides a standardized way to install, upgrade, and manage applications on a Kubernetes cluster. Using Helm to install the Sysdig components on Kubernetes provides you with a streamlined, repeatable deployment process that is easy to manage and scale.

The Sysdig Helm chart sysdig-deploy includes configuration options for customizing the agent’s behavior and integrating with other Sysdig components. By using the Helm chart, you can easily deploy the Sysdig Agent on Kubernetes and take advantage of Sysdig’s powerful monitoring and security capabilities.

Prerequisites

  • Kubectl installed.
  • Helm v3.8 and above.

Use the Quick Start Wizard

  1. Log in to Sysdig Secure as an administrator and select Integrations > Data Sources|Sysdig Agent.

  2. Click +Add Agent and select Kubernetes. The Helm installation method is recommended.

  3. As prompted by the Wizard screen, enter:

    • Cluster Name: Specify the name of your Kubernetes cluster.
  4. The Wizard will auto-populate a code snippet from the cluster name, along with autodetected Sysdig Secure endpoint and agent access key information.

  5. Copy and run the Helm commands. This will install the Sysdig agent and give you:

    • Runtime Threat Detection
    • Vulnerability Host Scanning
    • Runtime Image Scanning
    • Kubernetes Security Posture Management (Compliance)

Otherwise, you can use the generic Helm commands detailed below and customize as needed.

Use Generic Commands

Before you begin: Collect your agent access key and Sysdig SaaS region.

Full Deploy

This command replicates the Wizard process and installs the Sysdig Agent and the additional components to deliver runtime threat detection, host scanning, runtime image scanning, and compliance, or Kubernetes Security Posture Management (KSPM).

It uses the Helm chart sysdig-deploy.

helm repo add sysdig https://charts.sysdig.com
helm repo update
helm install sysdig-agent --namespace sysdig-agent --create-namespace \
--set global.sysdig.accessKey=<ACCESS_KEY> \
--set global.sysdig.region=<SAAS_REGION> \
--set nodeAnalyzer.secure.vulnerabilityManagement.newEngineOnly=true \
--set global.kspm.deploy=true \
--set nodeAnalyzer.nodeAnalyzer.benchmarkRunner.deploy=false \
--set nodeAnalyzer.nodeAnalyzer.hostScanner.deploy=true \
--set global.clusterConfig.name=<CLUSTER_NAME> \
sysdig/sysdig-deploy

  
## Create a values.yaml file with the following:

 global:
  sysdig:
    accessKey: <ACCESS_KEY>
    region: <SAAS_REGION>
  kspm:
    deploy: true
  clusterConfig:
    name: <CLUSTER_NAME>
nodeAnalyzer:
  secure:
    vulnerabilityManagement:
      newEngineOnly: true
  nodeAnalyzer:
    benchmarkRunner:
      deploy: false
    hostScanner:
      deploy: true

## Install as Follows

  helm repo add sysdig https://charts.sysdig.com
  helm install -n sysdig-agent sysdig sysdig/sysdig-deploy -f values.sysdig.yaml

 

Runtime Threat Detection Only

To install only Runtime Threat Detection (Sysdig Agent), use:

helm repo add sysdig https://charts.sysdig.com
helm install sysdig-agent --namespace sysdig-agent --create-namespace \
    --set global.sysdig.accessKey=<ACCESS_KEY> \
    --set global.sysdig.region=<SAAS_REGION> \
    --set nodeAnalyzer.enabled=false \
    --set global.clusterConfig.name=<CLUSTER_NAME> \
    sysdig/sysdig-deploy
    
  
## Create a values.yaml file with the Following:
global:
  sysdig:
    accessKey: <ACCESS_KEY>
    region: <SAAS_REGION>
  clusterConfig:
    name: <CLUSTER_NAME>
nodeAnalyzer:
  enabled: false

## Then, install with the following:

helm repo add sysdig https://charts.sysdig.com
helm install -n sysdig-agent sysdig sysdig/sysdig-deploy -f values.sysdig.yaml

 

Pod Security Admission

If you’re enforcing PSA, add the privileged policy to the sysdig-agent namespace:

kubectl label --overwrite ns sysdig-agent pod-security.kubernetes.io/enforce=privileged

Parameter Definitions

The command above specifies several options:

  • --namespace sysdig-agent

    • Specifies that the Sysdig deployment should be installed in the “sysdig-agent” namespace.
  • --set global.sysdig.accessKey=<ACCESS_KEY>

    • Specifies the Sysdig access key to use when connecting to the Sysdig backend. Replace <ACCESS_KEY> with your actual access key.
  • --set global.sysdig.region=<SAAS_REGION>

    • Specifies the Sysdig region to use. Replace <SAAS_REGION> with the region where your Sysdig account is located.
  • --set nodeAnalyzer.secure.vulnerabilityManagement.newEngineOnly=true

    • Enables the new engine for vulnerability management in Sysdig Secure.
  • --set global.kspm.deploy=true

    • Enables the deployment of the KSPM Collector and Analyzer components.
  • --set nodeAnalyzer.nodeAnalyzer.benchmarkRunner.deploy=false

    • Disables the deployment of the legacy Node Analyzer Benchmark Runner component.
  • --set nodeAnalyzer.nodeAnalyzer.hostScanner.deploy=true

    • Installs the Host Scanner.
  • --set global.clusterConfig.name=<CLUSTER_NAME>

    • Specifies the name of your Kubernetes cluster. Replace <CLUSTER_NAME> with your actual cluster name.
  • --set global.settings.tags.<myKey>=<myValue>

    • Optionally, add user-defined tag by defining a Key:Value pair. Replace <myKey> with your tag key and <myValue> with your tag value. you could add multiple tags by adding another row per tag.

After running these commands, the Sysdig agent and associated components should be installed and running on your Kubernetes cluster, and will begin sending data to the Sysdig backend for analysis and monitoring.

About Host Scanner

The runtime scanner and host scanner are deployed by default with the given Helm commands.

Opting Out

If for some reason you don’t want to use host scanning, you can opt-out using the Helm chart flag:

--set nodeAnalyzer.nodeAnalyzer.hostScanner.deploy=false

Specific Kubernetes Platforms

OpenShift, GKE, OKE, and MKE

If you are using Openshift, Google Kubernetes Engine (GKE) Standard, Oracle Kubernetes Engline (OKE), or Mirantis Kubernetes engine (MKE), enable eBPF with the following option:

  • --set agent.ebpf.enabled=true

GKE Autopilot

If you are using GKE autopilot, enable the following option:

  • -–set agent.gke.autopilot=true

Rancher Kubernetes Engine 1

Rancher Kubernetes Engine V1 (RKE1) internally changes container names at the Docker layer in Kubernetes. For instance, while a container may be named nginx in your cluster, its underlying name in the Docker engine might resemble k8s_nginx_nginx_test-container-id-b277-3066f0a5-7115-48f0-bb2d-c48f71663087_9d80f7b5-1827-4a05-83. The Sysdig Agent communicates with the Docker engine to retrieve container names, and the internal names will be displayed in the Sysdig UI instead of the container name provided within the cluster.

Rancher Kubernetes Engine 2

Rancher Kubernetes Engine V2(RKE2) uses a different containerd socket path, /run/k3s/containerd/containerd.sock, instead of the expected /var/run/containerd/containerd.sock. To accommodate this, ensure that you mount the alternative path into the runtime scanner via the chart’s values. This is necessary for the scanner to connect to the containerd socket and identify running containers for subsequent image scanning. Update the chart’s values accordingly.

Using the Key-Value Pair
--set nodeAnalyzer.nodeAnalyzer.extraVolumes.volumes[0].name=socketpath \
--set nodeAnalyzer.nodeAnalyzer.extraVolumes.volumes[0].hostPath.path=/run/k3s/containerd/containerd.sock \
--set nodeAnalyzer.nodeAnalyzer.runtimeScanner.extraMounts[0].name=socketpath \
--set nodeAnalyzer.nodeAnalyzer.runtimeScanner.extraMounts[0].mountPath=/var/run/containerd/containerd.sock \
Using values.yaml
nodeAnalyzer:
  nodeAnalyzer:
    extraVolumes:
      volumes:
        - name: socketpath
          hostPath:
            path: /run/k3s/containerd/containerd.sock
    runtimeScanner:
      extraMounts:
        - name: socketpath
          mountPath: /var/run/containerd/containerd.sock

Additional Options

For additional configuration options, including on-premises or using a proxy, see the sysdig-deploy readme.

You can also use Helm to

Install Kubernetes Audit Logging (Admission Controller)

Install Rapid Response