Qkview API

Overview

The Service Proxy for Kubernetes (SPK) Cluster Wide Controller (CWC) has been enhanced to support the qkview API to run the qkview command.

The purpose of QKView collection is to facilitate collection and packaging of diagnostic information from running containers within an mBIP deployment.

This document guides you through understanding and running the qkview API from CWC.

Qkview REST APIs

The sections below describe the Qkview REST APIs. Use the Procedure section to see how the Qkview API can be used to run jobs.

POST Request

Use the POST request to create new job IDs. You can request from the CWC to run a qkview job on a container by POSTing a request using /qkview API.

_images/spk_info.png Note: You can create only single job running at a time.

POST request CWC API Endpoint

https://f5-spk-cwc.common:30881/qkview?namespace=""

POST request Body

{
 filename: <name_of_tar_file_that_gets_generated_from_qkview>
}

Command examples

The commands below are run in the same directory as the cert-gen directory created when setting up the SPK CWC.

QKVIEW

curl -H "Accept: application/json" \
-H "Content-type: application/json"\
-X POST  https://f5-spk-cwc.common:30881/qkview?namespace="" \
--cert api-server-secrets/ssl/client/certs/client_certificate.pem \
--key api-server-secrets/ssl/client/secrets/client_key.pem \
--cacert api-server-secrets/ssl/ca/certs/ca_certificate.pem \
--data-raw '{"filename": "/bin/test.json"}'

GET Requests

Use the qkview GET API to retrieve the required Job ID response and to get the tar file downloaded to our system.

GET API Request for getting the Job ID Response

Can query to get the Job ID response to the completed job as shown below:

curl https://f5-spk-cwc.common:30881/qkview?jobId=<JOB_ID> \
--cert client_certificate.pem \
--key client_key.pem \
--cacert ca_certificate.pem

Can query even without Job ID as a query parameter, then it takes latest jobId into consideration.

curl https://f5-spk-cwc.common:30881/qkview \
--cert client_certificate.pem \
--key client_key.pem \
--cacert ca_certificate.pem

DELETE Requests

Use the qkview DELETE API to delete all jobIds or the particular jobId from persistent volume.

DELETE API Request for getting the Job ID Response

Can delete the Job ID or all Job Ids from persistent volume:

curl https://f5-spk-cwc.common:30881/qkview?jobId=<JOB_ID> \
-X DELETE  \
--cert client_certificate.pem \
--key client_key.pem \
--cacert ca_certificate.pem

Can query even without Job ID as a query parameter, then it takes latest jobId into consideration.

curl https://f5-spk-cwc.common:30881/qkview \
-X DELETE \
--cert client_certificate.pem \
--key client_key.pem \
--cacert ca_certificate.pem

Requirements

Ensure you have:

Procedure

Use this procedure to ping a remote host from the qkview sidecar using the CWC qkview API.

  1. Change into the directory with the SPK Software files.

  2. As described in the SPK Licensing guide, create a new directory for the CWC REST API certificates:

    mkdir cwc_api
    
  3. Copy each of the certificates into the new directory:

    cp api-server-secrets/ssl/client/certs/client_certificate.pem cwc_api
    
    cp api-server-secrets/ssl/ca/certs/ca_certificate.pem cwc_api
    
    cp api-server-secrets/ssl/client/secrets/client_key.pem cwc_api
    
  4. Obtain the name of namespace that has atleast 1 pod running in the Project:

    In this example, the CWC is in the common namespace, and the TMM Pod(s) are in the spk-ingress namespace.

    curl -s https://f5-spk-cwc.common:30881/qkview?namespace="spk-ingress"\
    --cert cwc_api/client_certificate.pem  \
    --key cwc_api/client_key.pem \
    --cacert cwc_api/ca_certificate.pem
    

    In this example, the job ID is 4625993b-31e2-4570-8b41-2c1296026c16.

    JobID: 4625993b-31e2-4570-8b41-2c1296026c16
    
  5. Use the job ID to get the tar file:

    curl https://f5-spk-cwc.common:30881/qkview?jobId="4625993b-31e2-4570-8b41-2c1296026c16" \
    --cert cwc_api/client_certificate.pem  \
    --key cwc_api/client_key.pem \
    --cacert cwc_api/ca_certificate.pem --output qkview180501.tar.gz\
    

Please make sure that you can see 100% in the output.

Feedback

Provide feedback to improve this document by emailing spkdocs@f5.com.