Skydive Documentation
repository·master·Indexed 25 days ago
https://github.com/skydive-project/skydiveAn 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.
What's inside Skydive
- 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.
Expose the Skydive UI management port
masterTo access the Skydive UI, use
kubectl port-forwardto map theskydive-analyzerservice port8082to your local machine.kubectl port-forward service/skydive-analyzer 8082:8082Set up Skydive with Docker Compose
masterUse 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 upRun Skydive using Docker
masterRun Skydive in
allinonemode using a Docker container. This requires--privilegedmode, 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 allinoneUninstall Skydive from Kubernetes
masterTo remove the Skydive deployment, delete the resources defined in
skydive.yaml.kubectl delete -f skydive.yamlInstall Graffiti
masterTo use Graffiti as a dependency in your Go project, install it using
go get.go get github.com/skydive-project/skydive/graffitiInstall Skydive on Kubernetes
masterTo install Skydive on a Kubernetes cluster, apply the provided
skydive.yamlmanifest usingkubectl.kubectl apply -f skydive.yamlRoll out configuration changes using the Skydive CLI script
masterYou 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
-cflag pointing to your Skydive configuration and specify the secret resource name.$ ./skydive.sh -c <skydive-config-yaml> secret default/mysql-passQuick start with Skydive All-in-one mode
masterThe fastest way to run Skydive is using the
allinonemode via a standalone binary. This mode combines the necessary components into a single process.Set the
SKYDIVE_ETCD_DATA_DIRandSKYDIVE_ANALYZER_LISTENenvironment variables before running the command. After starting, access the Web UI athttp://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 allinoneAccess the Skydive UI on OpenShift
masterFollow these steps to access the Skydive web interface:
- Find the UI endpoint: Retrieve the host from the
skydive-uiroute:oc get route skydive-ui -o jsonpath='http://{.spec.host}' - Navigate: Point your browser to the retrieved URL.
- Logout: If already logged in, click the small person icon in the top right to logout.
- Configure Analyzer: Specify the analyzer endpoint by retrieving its route:
oc get route skydive-analyzer -o jsonpath='http://{.spec.host}' - Sign in: Use the following credentials:
- Username:
admin - Password:
password
- Username:
oc get route skydive-ui -o jsonpath='http://{.spec.host}' oc get route skydive-analyzer -o jsonpath='http://{.spec.host}'- Find the UI endpoint: Retrieve the host from the
Deploy Skydive on Kubernetes using Helm
masterTo deploy Skydive in a Kubernetes cluster, use Helm. You will need the
helm-gitplugin to install directly from the Git repository. The deployment involves installing both theskydive-analyzerand theskydive-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:8082Deploy Skydive on OpenShift
masterTo deploy Skydive on OpenShift, you must have
cluster-adminprivileges. 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
skydivewith an empty node selector:oc adm new-project --node-selector='' skydive oc project skydive2. 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 default3. Deploy Skydive components
Deploy the analyzer and agents using the OpenShift template. Ensure you set the
VERSIONvariable to your target version (e.g.,v0.20.1ormaster).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 -