I have installed VMware PKS in a variety of environments and I typically show something that helps Platform Operators running PKS to dive even deeper into the status of PKS components beyond the pks cli. One of the key lifecycle components in PKS is called BOSH. BOSH deploys Kubernetes masters and workers and performs a number of other tasks. So how do you get access to BOSH in the easiest way?
Step 1)
- Login to the Ops Manager VM via ssh: ssh ubuntu@your.opsmanager.com
Step 2)
- Open Ops Manager and click on the BOSH Director tile:
- Click on the “Credentials” Tab and search for “BOSH Commandline Credentials”:
- You will see an output similar like this one:
{"credential":"BOSH_CLIENT=ops_manager BOSH_CLIENT_SECRET=ABCDEFGhijklmnopQRSTUVWxyz BOSH_CA_CERT=/var/tempest/workspaces/default/root_ca_certificate BOSH_ENVIRONMENT=192.168.1.100 bosh "}
- Copy and paste that line and reformat it the following way:
BOSH_CLIENT=ops_manager BOSH_CLIENT_SECRET=ABCDEFGhijklmnopQRSTUVWxyz BOSH_CA_CERT=/var/tempest/workspaces/default/root_ca_certificate BOSH_ENVIRONMENT=192.168.1.100
- Easiest way to get started every time is to make it part of your .bashrc configuration by doing the following:
- edit your .bashrc and append the outputs from above like this:
-
export BOSH_CLIENT=ops_manager export BOSH_CLIENT_SECRET=ABCDEFGhijklmnopQRSTUVWxyz export BOSH_CA_CERT=/var/tempest/workspaces/default/root_ca_certificate export BOSH_ENVIRONMENT=192.168.1.100
- logout and login again (or just run the export commands on the CLI manually once)
- Some example commands on how to interact with BOSH (and a nice cheat sheet at https://github.com/DennyZhang/cheatsheet-bosh-A4):
-
bosh deployments PKS=$(bosh deployments | grep ^pivotal | awk '{print $1;}') bosh -d $PKS vms bosh -d $PKS instances bosh -d $PKS tasks bosh -d $PKS tasks -ar bosh -d $PKS task 724 bosh -d $PKS task 724 --debug CLUSTER=$(bosh deployments | grep ^service-instance | awk '{print $1;}') bosh -d $CLUSTER vms bosh -d $CLUSTER vms --vitals bosh -d $CLUSTER tasks --recent=9 bosh -d $CLUSTER task 2009 --debug bosh -d $CLUSTER ssh master/0 bosh -d $CLUSTER ssh worker/0 bosh -d $CLUSTER logs bosh -d $CLUSTER cloud-check
- Advanced users: you can also install the BOSH CLI on and admin VM and run from there:
- Download from https://github.com/cloudfoundry/bosh-cli/releases
- Copy the certificate from the Ops Manager VM (/var/tempest/workspaces/default/root_ca_certificate) to your admin VM and edit the .bashrc environment variables accordingly