Skydive Documentation

repository·master·Indexed 25 days ago

https://github.com/skydive-project/skydive

An open-source real-time network topology and protocols analyzer. Skydive uses distributed agents to collect topology and flow information, storing it in Elasticsearch for analysis via a Web UI, CLI, or REST API. It includes a Python client library and Graffiti, a graph database used for managing network topology.

Tokens
16.6K
Snippets
35
Records
172
Agent score
83%

What's inside Skydive

  1. Overview of the Skydive Python client library

    master
    The Skydive Python client library provides programmatic access to Skydive, an open-source real-time network topology and protocols analyzer. This library includes classes designed to interact with Skydive via both REST and WebSocket-based clients, allowing developers to monitor and understand network infrastructure in real-time.
  2. Set up Skydive with Docker Compose

    master

    Use Docker Compose to set up a complete environment including Elasticsearch (for history support), a Skydive analyzer, and a Skydive agent.

    curl -o docker-compose.yml https://raw.githubusercontent.com/skydive-project/skydive/master/contrib/docker/docker-compose.yml
    docker-compose up
  3. Run Skydive using Docker

    master

    Run Skydive in allinone mode using a Docker container. This requires --privileged mode, host PID and network access, and mounting the Docker socket and network namespaces to allow the agent to capture topology information.

    docker run -d --privileged --pid=host --net=host -p 8082:8082 -p 8081:8081 \
        -e SKYDIVE_ANALYZER_LISTEN=0.0.0.0:8082 \
        -v /var/run/docker.sock:/var/run/docker.sock -v /run/netns:/var/run/netns \
        skydive/skydive allinone
  4. Roll out configuration changes using the Skydive CLI script

    master

    You can use the Skydive automation script to resolve inconsistencies in Kubernetes when a secret is updated but dependent pods still hold old configuration values. The script identifies graph edges between secrets and pods and triggers a pod recreation to ensure they pick up the updated secret data.

    To trigger the automatic recreation of pods dependent on a specific secret, run the script with the -c flag pointing to your Skydive configuration and specify the secret resource name.

    $ ./skydive.sh -c <skydive-config-yaml> secret default/mysql-pass
  5. Quick start with Skydive All-in-one mode

    master

    The fastest way to run Skydive is using the allinone mode via a standalone binary. This mode combines the necessary components into a single process.

    Set the SKYDIVE_ETCD_DATA_DIR and SKYDIVE_ANALYZER_LISTEN environment variables before running the command. After starting, access the Web UI at http://localhost:8082.

    curl -Lo - https://github.com/skydive-project/skydive-binaries/raw/jenkins-builds/skydive-latest.gz | gzip -d > skydive && chmod +x skydive && sudo mv skydive /usr/local/bin/
    
    SKYDIVE_ETCD_DATA_DIR=/tmp SKYDIVE_ANALYZER_LISTEN=0.0.0.0:8082 sudo -E /usr/local/bin/skydive allinone
  6. Access the Skydive UI on OpenShift

    master

    Follow these steps to access the Skydive web interface:

    1. Find the UI endpoint: Retrieve the host from the skydive-ui route: oc get route skydive-ui -o jsonpath='http://{.spec.host}'
    2. Navigate: Point your browser to the retrieved URL.
    3. Logout: If already logged in, click the small person icon in the top right to logout.
    4. Configure Analyzer: Specify the analyzer endpoint by retrieving its route: oc get route skydive-analyzer -o jsonpath='http://{.spec.host}'
    5. Sign in: Use the following credentials:
      • Username: admin
      • Password: password
    oc get route skydive-ui -o jsonpath='http://{.spec.host}'
    oc get route skydive-analyzer -o jsonpath='http://{.spec.host}'
  7. Deploy Skydive on Kubernetes using Helm

    master

    To deploy Skydive in a Kubernetes cluster, use Helm. You will need the helm-git plugin to install directly from the Git repository. The deployment involves installing both the skydive-analyzer and the skydive-agent.

    helm plugin install https://github.com/aslafy-z/helm-git --version 0.10.0
    helm repo add skydive git+https://github.com/skydive-project/skydive@contrib/charts
    helm repo update
    helm install skydive-analyzer skydive/skydive-analyzer
    helm install skydive-agent skydive/skydive-agent
    kubectl port-forward service/skydive-analyzer 8082:8082
  8. Deploy Skydive on OpenShift

    master

    To deploy Skydive on OpenShift, you must have cluster-admin privileges. The deployment involves creating a project with an empty node selector to ensure Skydive runs on all nodes, granting necessary security context constraints (SCC) and cluster-reader roles, and then applying the OpenShift templates.

    1. Create a new project

    Create a project named skydive with an empty node selector:

    oc adm new-project --node-selector='' skydive
    oc project skydive

    2. Grant required privileges

    The Skydive analyzer and agent require extended privileges to run as privileged containers and to access cluster information:

    oc adm policy add-scc-to-user privileged -z default
    oc adm policy add-cluster-role-to-user cluster-reader -z default

    3. Deploy Skydive components

    Deploy the analyzer and agents using the OpenShift template. Ensure you set the VERSION variable to your target version (e.g., v0.20.1 or master).

    Deploy analyzer and agents:

    VERSION=master
    oc process -f https://raw.githubusercontent.com/skydive-project/skydive/${VERSION}/contrib/openshift/skydive-template.yaml | oc apply -f -

    Deploy flow exporter:

    VERSION=master
    oc process -f https://raw.githubusercontent.com/skydive-project/skydive/${VERSION}/contrib/openshift/skydive-flow-exporter-template.yaml | oc apply -f -
    VERSION=master
    oc process -f https://raw.githubusercontent.com/skydive-project/skydive/${VERSION}/contrib/openshift/skydive-template.yaml | oc apply -f -