Using BOSH Diagnostic Commands in Enterprise PKS
Page last updated:
Warning: VMware Enterprise PKS v1.7 is no longer supported because it has reached the End of General Support (EOGS) phase as defined by the Support Lifecycle Policy. To stay up to date with the latest software and security updates, upgrade to a supported version.
This topic describes how to access information about your VMware 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:
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:
- 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.
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
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 Ops Manager documentation.
SSH into the PKS API VM
To SSH into the PKS API VM using the BOSH CLI, follow the steps below:
Log in to the BOSH Director. For instructions, see Log in to the BOSH Director VM.
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 withpivotal-container-service
and includes a BOSH-generated identifier.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.
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 the PKS Database VM
To SSH into a PKS Database VM using the BOSH CLI, follow the steps below:
Log in to the BOSH Director. For instructions, see Log in to the BOSH Director VM.
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 withpivotal-container-service
and includes a BOSH-generated identifier.To identify your PKS Database 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 Database VM name begins with
pks-db
and includes a BOSH-generated identifier.To SSH into the PKS Database VM, run the following command:
bosh -e ENVIRONMENT -d DEPLOYMENT ssh PKS-DB-VM
Where:
ENVIRONMENT
is the BOSH environment alias.DEPLOYMENT
is your PKS deployment name.PKS-DB-VM
is the name of the PKS Database VM to SSH into.
For example:
$ bosh -e pks \ -d pivotal-container-service-a1b2c333d444e5f66a77 \ ssh pks-db/000a4444-555b-6666-4cc5-de66f8a9900b
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:
Log in to the BOSH Director. For instructions, see Log in to the BOSH Director VM.
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 withservice-instance
and include a BOSH-generated identifier.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 withmaster
orworker
and includes a BOSH-generated identifier.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, eithermaster/VM-ID
orworker/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 VM, or a Kubernetes cluster VM, and then follow the steps below:
To act as super user on your VM, run the following command:
sudo su
Navigate to the
/var/vcap/sys/log
log file directory:cd /var/vcap/sys/log
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.
- On a master VM, examine the
Please send any feedback you have to pks-feedback@pivotal.io.