BOSH release of the pcap Cloud Foundry add-on.
As pcap-release is still in active development, information on this page is subject to change and might be outdated.
The goal of this BOSH release is to provide easy access to network traffic data to both Cloud Foundry application developers and CF landscape operators. To achieve this, pcap-release implements CLI-commands to capture tcpdumps (pcap files) from multiple BOSH VMs or CF app-containers in parallel.
pcap-apiis deployed on its own VM.pcap-agentis co-located on app-containers.pcap-apineeds to register its route via route-registrar, part of the cf-routing-release.cf-CLIpcap-plugin (TBD/WIP) is used to send capture requests to thepcap-api- Requests to
pcap-apineed an authorization header including the OAuth token from UAA. This token is used to gather information about the app from the cloud-controller. - The
pcap-apimakes requests to thepcap-agenton corresponding app-container. - The pcap agent starts a tcpdump using libpcap via the gopacket module and streams the results.
pcap-apiis deployed on its own VM.pcap-agentis co-located on BOSH VMs.pcap-apineeds to register its route via route-registrar, part of the cf-routing-release.pcap-bosh-cli(TBD/WIP) is used to send capture requests to thepcap-api- Requests to
pcap-apineed an authorization header including the OAuth token from UAA. - This token is used to gather information about the target VMs from the BOSH Director
- The
pcap-apimakes requests to thepcap-agenton corresponding BOSH VMs. - The pcap agent starts a tcpdump using libpcap via the gopacket module and streams the results.
- Check if token is valid by requesting app information from CC/BOSH Director
- Get container address for app instances from CC/BOSH VMs from BOSH Director
- Connect to
pcap-agentin app-containers/BOSH VMs - Stream packets back to client
- Capture packets and stream back to
pcap-api
Provided manifests and ops files:
manifests/ops-files/add-pcap-agent.ymlThis adds the PCAP agent as an addon to any BOSH deployment.manifests/pcap-api.ymlThis is an example BOSH manifest to deploy the pcap-api.manifests/ops-files/expose-route-to-pcap-api.ymlThis adds bosh dns as an addon to the pcap-api instance group and configures the route for pcap-api route registration.
cp manifests/vars-template.yml manifests/vars.yml
vim manifests/vars.yml (adjust as needed)bosh interpolate -o manifests/ops-files/expose-route-to-pcap-api.yml -l manifests/vars.yml manifests/pcap-api.yml > manifests/pcap-api-with-exposed-route.ymlbosh -d pcap deploy -l manifests/vars.yml manifests/pcap-api.ymlIf a new manifest file has been generated in Step 2, then execute:
bosh -d pcap deploy manifests/pcap-api-with-exposed-route.ymlbosh interpolate -o manifests/ops-files/add-pcap-agent.yml -l manifests/vars.yml cf-deployment.yml > cf-deployment-pcap.yml
bosh -d cf deploy cf-deployment-pcap.ymlThis assumes your BOSH deployment name of cf-deployment is called cf
tbd
bosh -d pcap scp <bosh instance of pcap api>:/var/vcap/packages/pcap-api/bin/cli/build/pcap-bosh-cli-linux-amd64 pcap-bosh-cli-linux-amd64
mv pcap-bosh-cli-linux-amd64 /usr/local/bin/pcap-bosh
pcap-bosh ...# create a dev release, event if there are changes in the git workspace
bosh create-release --force
# upload the release to the BOSH director
bosh -e bosh upload-release
# adjust the release to a dev release instead of the URL
vim manifests/pcap-api.yml
vim manifests/ops-files/add-pcap-agent.yml
# deploy pcap-agent to the desired deployment(s) (example: diego-cells in cf deployment)
bosh -d cf manifest > cf.yml
bosh interpolate -o manifests/ops-files/add-pcap-agent.yml cf.yml > cf-pcap.yml
bosh -d cf deploy cf-pcap.yml
# deploy pcap-api
cp manifests/vars-template.yml manifests/vars.yml
vim manifests/vars.yml (adjust as needed)
bosh -d pcap deploy -l manifests/vars.yml manifests/pcap-api.ymlLocal test execution is described in detail: