Using BOSH Diagnostic Commands in Enterprise PKS

Page last updated:

This topic describes how to access information about your Enterprise Pivotal Container Service (Enterprise PKS) deployment by using the BOSH Command Line Interface (BOSH CLI).

Overview

BOSH diagnostic commands such as bosh ssh and bosh vms enable you to access information about your Enterprise PKS deployment. For example, you can access Enterprise PKS log files after SSHing into the PKS API or a Kubernetes cluster VM:

  1. SSH into the PKS API VM or SSH into a Kubernetes Cluster VM
  2. View Log Files

Log in to the BOSH Director VM

To set a BOSH alias for your Enterprise PKS environment and log in to the BOSH Director VM, follow the steps below:

  1. Gather your credential and IP address information for the BOSH Director and SSH into the Ops Manager VM. For instructions, see Advanced Troubleshooting with the BOSH CLI.
  2. To create a BOSH alias for your Enterprise PKS environment, run the following command:

    bosh alias-env ENVIRONMENT \
    -e BOSH-DIRECTOR-IP \
    --ca-cert /var/tempest/workspaces/default/root_ca_certificate
    Where:

    • ENVIRONMENT is an alias of your choice. For example, pks.
    • BOSH-DIRECTOR-IP is the BOSH Director IP address you located in the first step. For example, 10.0.0.3.

    For example:

    $ bosh alias-env pks -e 10.0.0.3 \
    --ca-cert /var/tempest/workspaces/default/root_ca_certificate

  3. To log in to the BOSH Director using the alias you set, run the following command:

    bosh -e ENVIRONMENT login

    For example:

    $ bosh -e pks login
    Alternatively, you can set the BOSH environment variables on the Ops Manager VM to authenticate with the BOSH Director VM. For more information, see Authenticate with the BOSH Director VM in Advanced Troubleshooting with the BOSH CLI in the Pivotal documentation.

SSH into the PKS API VM

To SSH into the PKS API VM using the BOSH CLI, follow the steps below:

  1. Log in to the BOSH Director. For instructions, see Log in to the BOSH Director VM.

  2. To identify your PKS deployment name, run the following command:

    bosh -e ENVIRONMENT deployments

    Where ENVIRONMENT is your BOSH environment alias.

    For example:

    $ bosh -e pks deployments
    Your PKS deployment name begins with pivotal-container-service and includes a BOSH-generated identifier.

  3. To identify your PKS API VM name, run the following command:

    bosh -e ENVIRONMENT -d DEPLOYMENT vms

    Where:

    • ENVIRONMENT is the BOSH environment alias.
    • DEPLOYMENT is your PKS deployment name.

    For example:

    $ bosh -e pks -d pivotal-container-service/a1b2c333d444e5f66a77 vms

    Your PKS API VM name begins with pivotal-container-service and includes a BOSH-generated identifier.

    Note: The PKS API VM identifier is different from the identifier in your PKS deployment name.

  4. To SSH into the PKS API VM, run the following command:

    bosh -e ENVIRONMENT -d DEPLOYMENT ssh PKS-API-VM

    Where:

    • ENVIRONMENT is the BOSH environment alias.
    • DEPLOYMENT is your PKS deployment name.
    • PKS-API-VM is your PKS API VM name.

    For example:

    $ bosh -e pks \
    -d pivotal-container-service/a1b2c333d444e5f66a77 \
    ssh pivotal-container-service/000a1111-222b-3333-4cc5-de66f7a8899b

SSH into a Kubernetes Cluster VM

Each Kubernetes cluster corresponds to a BOSH deployment. To SSH into a PKS-provisioned Kubernetes cluster VM using the BOSH CLI, follow the steps below:

  1. Log in to the BOSH Director. For instructions, see Log in to the BOSH Director VM.

  2. To identify your Kubernetes cluster deployment name, run the following command:

    bosh -e ENVIRONMENT deployments

    Where ENVIRONMENT is your BOSH environment alias.

    For example:

    $ bosh -e pks deployments
    Kubernetes cluster deployment names begin with service-instance and include a BOSH-generated identifier.

  3. To identify your Kubernetes cluster VM name, run the following command:

    bosh -e ENVIRONMENT -d DEPLOYMENT vms

    Where:

    • ENVIRONMENT is the BOSH environment alias.
    • DEPLOYMENT is your Kubernetes cluster deployment name.

    For example:

    $ bosh -e pks -d service-instance_ae681cd1-7ff4-4661-b12c-49a5b543f16f vms
    Each Kubernetes cluster VM name begins with master or worker and includes a BOSH-generated identifier.

  4. To SSH into your Kubernetes cluster VM, run the following command:

    bosh -e ENVIRONMENT -d DEPLOYMENT ssh CLUSTER-VM

    Where:

    • ENVIRONMENT is the BOSH environment alias.
    • DEPLOYMENT is your Kubernetes cluster deployment name.
    • CLUSTER-VM is your Kubernetes cluster VM name, either master/VM-ID or worker/VM-ID.

    For example:

    $ bosh -e pks -d service-instance_ae681cd1-7ff4-4661-b12c-49a5b543f16f ssh master/000a1111-222b-3333-4cc5-de66f7a8899b

View Log Files

Log files contain error messages and other information you can use to diagnose issues with your Enterprise PKS deployment. To access Enterprise PKS log files, SSH into the PKS API or a Kubernetes cluster VM and then follow the steps below:

  1. To act as super user on your VM, run the following command:

    sudo su

  2. Navigate to the /var/vcap/sys/log log file directory:

    cd /var/vcap/sys/log

  3. Examine the contents of the /var/vcap/sys/log directory. For example, when diagnosing issues with a Kubernetes cluster VM, you may want to review the following log files:

    • On a master VM, examine the kube-apiserver subdirectory.
    • On a worker VM, examine the kubelet subdirectory.

Please send any feedback you have to pks-feedback@pivotal.io.