### Install Graffiti Source: https://github.com/skydive-project/skydive/blob/master/graffiti/README.md Use 'go get' to install the Graffiti package. This command fetches and installs the Graffiti library into your Go workspace. ```console go get github.com/skydive-project/skydive/graffiti ``` -------------------------------- ### Start a Graffiti Hub Source: https://github.com/skydive-project/skydive/blob/master/graffiti/README.md Launches a Graffiti hub instance with embedded etcd for configuration. This is a basic command to get a hub running. ```console $ graffiti hub --embedded-etcd ``` -------------------------------- ### Deploy Skydive with Helm Source: https://github.com/skydive-project/skydive/blob/master/README.md Install the helm-git plugin, add the Skydive Helm repository, and then install the Skydive analyzer and agent. Port-forward the analyzer service to access the Web UI. ```bash helm plugin install https://github.com/aslafy-z/helm-git --version 0.10.0 ``` ```bash helm repo add skydive git+https://github.com/skydive-project/skydive@contrib/charts ``` ```bash helm repo update ``` ```bash helm install skydive-analyzer skydive/skydive-analyzer ``` ```bash helm install skydive-agent skydive/skydive-agent ``` ```bash kubectl port-forward service/skydive-analyzer 8082:8082 ``` -------------------------------- ### View Skydive Template Parameters Source: https://github.com/skydive-project/skydive/blob/master/contrib/openshift/README.md Displays the available installation parameters for the Skydive OpenShift template. This helps in customizing the deployment. ```bash $ VERSION=v0.20.1 $ oc process --parameters -f https://raw.githubusercontent.com/skydive-project/skydive/${VERSION}/contrib/openshift/skydive-template.yaml ``` -------------------------------- ### Install Skydive on Kubernetes Source: https://github.com/skydive-project/skydive/blob/master/contrib/kubernetes/README.md Apply the Skydive Kubernetes manifest to install the tool. ```bash kubectl apply -f skydive.yaml ``` -------------------------------- ### Install Skydive Binary Source: https://github.com/skydive-project/skydive/blob/master/README.md Download the latest Skydive binary and make it executable. Ensure it's placed in a directory included in your system's PATH. ```bash 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/ ``` -------------------------------- ### Get Skydive UI Access Info for ClusterIP Service Source: https://github.com/skydive-project/skydive/blob/master/contrib/charts/skydive-analyzer/templates/NOTES.txt Prints service details for ClusterIP services, guiding users on how to access the Skydive UI. ```bash export UI_SERVICE=$(kubectl get --namespace {{ .Release.Namespace }} services {{ template "servicename" . }}) echo -e "To access Skydive UI use details from\n\n$UI_SERVICE" ``` -------------------------------- ### Set up Skydive with Docker Compose Source: https://github.com/skydive-project/skydive/blob/master/README.md Download the Docker Compose configuration file and use it to start Skydive with an Elasticsearch backend for history support. Access the Web UI at http://localhost:8082. ```bash curl -o docker-compose.yml https://raw.githubusercontent.com/skydive-project/skydive/master/contrib/docker/docker-compose.yml ``` ```bash docker-compose up ``` -------------------------------- ### Run Skydive All-in-One Source: https://github.com/skydive-project/skydive/blob/master/README.md Start Skydive in all-in-one mode, which includes the analyzer and agent. Access the Web UI at http://localhost:8082. ```bash SKYDIVE_ETCD_DATA_DIR=/tmp SKYDIVE_ANALYZER_LISTEN=0.0.0.0:8082 sudo -E /usr/local/bin/skydive allinone ``` -------------------------------- ### Use Skydive Client with Docker Source: https://github.com/skydive-project/skydive/blob/master/README.md Run the Skydive command-line client within a Docker container to query network topology. This example performs a Gremlin query to list all vertices. ```bash docker run --net=host -ti skydive/skydive client query "g.V()" ``` -------------------------------- ### Query Nodes by Metadata Source: https://github.com/skydive-project/skydive/blob/master/graffiti/README.md Executes a Gremlin query to find nodes based on their metadata. This example filters nodes that have 'MyValue' set to 456. ```console $ graffiti client query "G.V().Has('MyValue', 456) [ { "ID": "b107a00e-9119-464e-4dc2-4216926c4769", "Metadata": { "MyValue": "456", "Name": "TestNode2" }, "Host": "lezordi", "Origin": "cli.lezordi", "CreatedAt": 1607037657642, "UpdatedAt": 1607037657642, "DeletedAt": null, "Revision": 1 } ] ``` -------------------------------- ### Get Skydive UI URL for LoadBalancer Service Source: https://github.com/skydive-project/skydive/blob/master/contrib/charts/skydive-analyzer/templates/NOTES.txt Exports the UI port and IP address for LoadBalancer services to access the Skydive UI. ```bash export UI_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "servicename" . }}) export UI_IP=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.status.loadBalancer.ingress[0].ip}" services {{ template "servicename" . }}) echo "Skydive UI is running at: http://$UI_IP:$UI_PORT" ``` -------------------------------- ### Get Skydive UI URL for NodePort Service Source: https://github.com/skydive-project/skydive/blob/master/contrib/charts/skydive-analyzer/templates/NOTES.txt Exports the UI port and IP address for NodePort services to access the Skydive UI. ```bash export UI_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "servicename" . }}) export UI_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") echo "Skydive UI is running at: http://$UI_IP:$UI_PORT" ``` -------------------------------- ### Query Edges and Related Nodes Source: https://github.com/skydive-project/skydive/blob/master/graffiti/README.md Performs a Gremlin query to find edges with a specific relation type and then filters the incoming vertices based on metadata. This example finds edges of type 'myrelation' and then selects incoming vertices with 'MyValue' less than 200. ```console $ graffiti client query "G.E().Has('RelationType', 'myrelation').InV('MyValue', LT(200))" [ { "ID": "bf912bde-66be-461b-7b2f-15c9e1a3de53", "Metadata": { "MyValue": "123", "Name": "TestNode" }, "Host": "lezordi", "Origin": "cli.lezordi", "CreatedAt": 1607037595421, "UpdatedAt": 1607037595421, "DeletedAt": null, "Revision": 1 } ] ``` -------------------------------- ### Create Skydive Project Source: https://github.com/skydive-project/skydive/blob/master/contrib/openshift/README.md Creates a new OpenShift project for Skydive and sets it as the current project. Use an empty node selector to ensure Skydive runs on all nodes. ```bash oc adm new-project --node-selector='' skydive oc project skydive ``` -------------------------------- ### Deploy Skydive Analyzer and Agents Source: https://github.com/skydive-project/skydive/blob/master/contrib/openshift/README.md Deploys the Skydive analyzer and agents using the OpenShift template. Adjust the VERSION variable to the desired Skydive version. ```bash # adjust VERSION for the current version - for example: v0.20.1 or master VERSION=master oc process -f https://raw.githubusercontent.com/skydive-project/skydive/${VERSION}/contrib/openshift/skydive-template.yaml | oc apply -f - ``` -------------------------------- ### Create a Node with Metadata Source: https://github.com/skydive-project/skydive/blob/master/graffiti/README.md Injects a new node into the graph using the Graffiti client. Specify node name, type, and metadata. The output shows the created node's details. ```console $ graffiti client node create --node-name TestNode --node-type mytype --metadata MyValue=123 { "ID": "bf912bde-66be-461b-7b2f-15c9e1a3de53", "Metadata": { "MyValue": "123", "Name": "TestNode" }, "Host": "lezordi", "Origin": "cli.lezordi", "CreatedAt": 1607037595421, "UpdatedAt": 1607037595421, "DeletedAt": null, "Revision": 1 } ``` ```console $ graffiti client node create --node-name TestNode2 --node-type mytype --metadata MyValue=456 { "ID": "b107a00e-9119-464e-4dc2-4216926c4769", "Metadata": { "MyValue": "456", "Name": "TestNode2" }, "Host": "lezordi", "Origin": "cli.lezordi", "CreatedAt": 1607037657642, "UpdatedAt": 1607037657642, "DeletedAt": null, "Revision": 1 } ``` -------------------------------- ### Run Skydive with Docker Source: https://github.com/skydive-project/skydive/blob/master/README.md Deploy Skydive using a Docker container in all-in-one mode. Mount necessary volumes for Docker socket and network namespaces. Access the Web UI at http://localhost:8082. ```bash 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 ``` -------------------------------- ### Run Skydive UI with Docker Source: https://github.com/skydive-project/skydive/blob/master/graffiti/README.md Launches the Skydive UI in a Docker container, exposing it on port 8080. Access the UI by navigating to http://localhost:8080 in your browser. ```console $ docker run -p 8080:8080 skydive/skydive-ui ``` -------------------------------- ### Deploy Skydive Flow Exporter Source: https://github.com/skydive-project/skydive/blob/master/contrib/openshift/README.md Deploys the Skydive flow exporter using its OpenShift template. Ensure the VERSION variable is set to the correct Skydive version. ```bash # adjust VERSION for the current version - for example: v0.20.1 or master VERSION=master oc process -f https://raw.githubusercontent.com/skydive-project/skydive/${VERSION}/contrib/openshift/skydive-flow-exporter-template.yaml | oc apply -f - ``` -------------------------------- ### Deploy Skydive with Custom Log Level Source: https://github.com/skydive-project/skydive/blob/master/contrib/openshift/README.md Applies the Skydive OpenShift template with a custom log level, such as DEBUG. This is useful for troubleshooting. ```bash # Installation with loglevel debug: $ oc process --param=SKYDIVE_LOGGING_LEVEL=DEBUG -f https://raw.githubusercontent.com/skydive-project/skydive/${VERSION}/contrib/openshift/skydive-template.yaml | oc apply -f - ``` -------------------------------- ### Deploy Skydive to a Specific Namespace Source: https://github.com/skydive-project/skydive/blob/master/contrib/kubernetes/README.md Deploy Skydive to the `mynamespace` instead of the default namespace by updating the `skydive.yaml` manifest and applying it with the `-n` flag. ```bash cat skydive.yaml | sed -e "s/namespace: default/namespace: mynamespace/" | kubectl apply -n mynamespace -f - ``` -------------------------------- ### Default UI Configuration in JavaScript Source: https://github.com/skydive-project/skydive/blob/master/statics/ui/index.html Defines default settings for the Skydive UI, including bandwidth thresholds and theme. These can be extended by global variables. ```javascript var defaultConfig = { "bandwidth_absolute_active": 1, "bandwidth_absolute_alert": 1000, "bandwidth_absolute_warning": 100, "bandwidth_relative_active": 0.1, "bandwidth_relative_alert": 0.8, "bandwidth_relative_warning": 0.5, "bandwidth_threshold": "relative", "bandwidth_update_rate": 5, "ssh_enabled": false, "theme": "dark", "topology": { "favorites": {}, }, } var globalVars = << .GlobalVars >> uiConfig = $.extend({}, defaultConfig, globalVars["ui"]); var allPermissions = << .Permissions >>; << range $i, $asset := .ExtraAssets >> << if eq $asset.Ext ".css" >> << end >> << if eq $asset.Ext ".js" >> << end >> << end >> ``` -------------------------------- ### Check Skydive Deployment Status Source: https://github.com/skydive-project/skydive/blob/master/contrib/openshift/README.md Provides commands to verify the Skydive deployment by checking the overall status, pods, daemonsets, services, and routes. ```bash # Overall status: oc status # List all pods: oc get pods # List all daemonsets: oc get daemonset # List all services: oc get services # List all routes: oc get routes ``` -------------------------------- ### Access Skydive UI Endpoint Source: https://github.com/skydive-project/skydive/blob/master/contrib/openshift/README.md Retrieves the URL for the Skydive UI and analyzer endpoints. Use these URLs to access the Skydive interface in your browser. ```bash # point your browser to skydive UI end-point oc get route skydive-ui -o jsonpath='http://{.spec.host}' # Specify analyzer endpoint oc get route skydive-analyzer -o jsonpath='http://{.spec.host}' ``` -------------------------------- ### Link Nodes with an Edge Source: https://github.com/skydive-project/skydive/blob/master/graffiti/README.md Creates an edge between two existing nodes using their IDs. Specify parent, child, edge type, and metadata. The output confirms the edge creation. ```console $ graffiti client edge create --parent bf912bde-66be-461b-7b2f-15c9e1a3de53 --child b107a00e-9119-464e-4dc2-4216926c4769 --edge-type myrelation --metadata MyValue=789 { "Parent": "bf912bde-66be-461b-7b2f-15c9e1a3de53", "Child": "b107a00e-9119-464e-4dc2-4216926c4769", "ID": "2fb400a4-671b-4640-73ab-bb025a01ea99", "Metadata": { "MyValue": "789", "RelationType": "myrelation" }, "Host": "lezordi", "Origin": "cli.lezordi", "CreatedAt": 1607037881247, "UpdatedAt": 1607037881247, "DeletedAt": null, "Revision": 1 } ``` -------------------------------- ### Expose Skydive UI Management Port Source: https://github.com/skydive-project/skydive/blob/master/contrib/kubernetes/README.md Forward the Skydive analyzer UI management port (8082) to your local machine for access. ```bash kubectl port-forward service/skydive-analyzer 8082:8082 ``` -------------------------------- ### Kubectl Command for Pod Deletion Source: https://github.com/skydive-project/skydive/blob/master/contrib/kubernetes/samples/README.md These commands are automatically executed by Skydive after it detects a secret change. They serve to delete the affected pods, prompting Kubernetes to re-create them with the updated secret. ```bash kubectl delete pod wordpress- ``` ```bash kubectl delete pod wordpress-mysql- ``` -------------------------------- ### Execute Skydive for Secret Update Source: https://github.com/skydive-project/skydive/blob/master/contrib/kubernetes/samples/README.md Use this command to trigger Skydive to re-create pods associated with a specific Kubernetes secret after its configuration has changed. Ensure you replace `` with your Skydive configuration file path and `default/mysql-pass` with the actual secret name. ```bash ./skydive.sh -c secret default/mysql-pass ``` -------------------------------- ### Grant Skydive Privileges Source: https://github.com/skydive-project/skydive/blob/master/contrib/openshift/README.md Grants necessary privileges to Skydive components. The analyzer and agent run as privileged containers, and the analyzer requires cluster-reader access to gather cluster information. ```bash # analyzer and agent run as privileged container oc adm policy add-scc-to-user privileged -z default # analyzer need cluster-reader access get all informations from the cluster oc adm policy add-cluster-role-to-user cluster-reader -z default ``` -------------------------------- ### Change Skydive Analyzer Listening Port Source: https://github.com/skydive-project/skydive/blob/master/contrib/kubernetes/README.md Modify the Skydive analyzer listening port from 8082 to 18082 by updating the `skydive.yaml` manifest. ```bash cat skydive.yaml | sed -e s/8082/18082/ | kubectl apply -f - ``` -------------------------------- ### Change Etcd Ports for Skydive Source: https://github.com/skydive-project/skydive/blob/master/contrib/kubernetes/README.md Adjust the etcd ports from 12379/12380 to 22379/22380 by modifying the `skydive.yaml` manifest. ```bash cat skydive.yaml | sed -e s/12379/22379/ -e s/12380/22380/ | kubectl apply -f - ``` -------------------------------- ### Change Elasticsearch Port for Skydive Source: https://github.com/skydive-project/skydive/blob/master/contrib/kubernetes/README.md Update the Elasticsearch port from 9200 to 19200 within the `skydive.yaml` manifest. ```bash cat skydive.yaml | sed -e s/9200/19200/ | kubectl apply -f - ``` -------------------------------- ### Uninstall Skydive from Kubernetes Source: https://github.com/skydive-project/skydive/blob/master/contrib/kubernetes/README.md Remove Skydive from your Kubernetes cluster by deleting its manifest. ```bash kubectl delete -f skydive.yaml ``` -------------------------------- ### Change Skydive Agent Listening Port Source: https://github.com/skydive-project/skydive/blob/master/contrib/kubernetes/README.md Modify the Skydive agent listening port from 8081 to 18081 by updating the `skydive.yaml` manifest. ```bash cat skydive.yaml | sed -e s/8081/18081/ | kubectl apply -f - ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.