In this article, we will configure the various command-line tools that will be used to interact with the PKS Platform which will then be consumed by either the Operators (managing the PKS infrastructure) and/or the the Developers (consumers of the Kubernetes Clusters).
Below is a quick summary, description and the consumers of the CLIs that we will be installing:
|pks||Used to create/delete and manage K8S Clusters||Operator|
|kubectl||Used to interact with K8S Cluster and deploy applications including scaling up/down||Developer|
|uaac||Used to manage user accounts and authorization for the PKS platform||Operator|
|bosh||Used to manage PKS deployments and provides information about the VMs using its Cloud Provider Interface (CPI) which is vSphere in this case||Operator|
|om||Used to Used to manager and interact with Ops Manager||Operator|
|nsx-cli.sh||Used to clean NSX-T objects after a K8S have been deleted (will be Automated by PKS in future release)||Operator|
Both PKS and Kubectl CLIs are supported on either Windows, MacOS and Linux, you can refer to Part 1 for a link to the binary downloads. The remainder of the tools are primarily used by Operators and to make them accessible for multiple users, you can deploy a centralized management VM. In my lab, I am referring to this VM as the "PKS Client" which is where we will be installing all the CLIs. You can use a variety of supported Operating Systems, but I found Ubuntu to work the best, especially for some of the package dependencies. I did try to use our own PhotonOS, but I was having some trouble figuring out the required packages. If I figure it out, then I will update the article as that may be preferred over Ubuntu if you have never worked with it before.
If you missed any of the previous articles, you can find the complete list here:
- Getting started with VMware Pivotal Container Service (PKS) Part 1: Overview
- Getting started with VMware Pivotal Container Service (PKS) Part 2: PKS Client
- Getting started with VMware Pivotal Container Service (PKS) Part 3: NSX-T
- Getting started with VMware Pivotal Container Service (PKS) Part 4: Ops Manager & BOSH
- Getting started with VMware Pivotal Container Service (PKS) Part 5: PKS Control Plane
- Getting started with VMware Pivotal Container Service (PKS) Part 6: Kubernetes Go!
- Getting started with VMware Pivotal Container Service (PKS) Part 7: Harbor
- Getting started with VMware Pivotal Container Service (PKS) Part 8: Monitoring Tool Overview
- Getting started with VMware Pivotal Container Service (PKS) Part 9: Logging
- Getting started with VMware Pivotal Container Service (PKS) Part 10: Infrastructure Monitoring
- Getting started with VMware Pivotal Container Service (PKS) Part 11: Application Monitoring
- vGhetto Automated Pivotal Container Service (PKS) Lab Deployment
Step 1 - Deploy and install a tiny Ubuntu VM (1vCPU, 2GB memory and default disk size). You can use the latest server version, in my lab I happen to have the 16.04 ISO lying around. Ensure the VM has been configured for internet connectivity (can configure proxy access) which will be used to remotely download installers and package dependencies.
Step 2 - Once the Ubuntu VM is available, SCP both the PKS (pks-linux-amd64-1.0.0.*) and Kubectl (kubectl-linux-amd64.*) CLI to VM. If you have not downloaded the binaries, please refer to Part 1 for more details.
Step 3 - SSH to the Ubuntu VM and run the following commands to make binaries executable and renaming/relocating them to /usr/local/bin:
chmod +x pks-linux-amd64-1.0.0-build.3
chmod +x kubectl-linux-amd64-1.9.2
mv pks-linux-amd64-1.0.0-build.3 /usr/local/bin/pks
mv kubectl-linux-amd64-1.9.2 /usr/local/bin/kubectl
Step 4 - To confirm PKS CLI was properly installed, run the following command to ensure the version is displayed:
Step 5 - To confirm Kubectl CLI was properly installed, run the following command to ensure the version is displayed:
Step 6 - Run the following command to install the required package dependencies and install Cloud Foundry UAAC:
apt -y install ruby ruby-dev gcc build-essential g++
gem install cf-uaac
Step 8 - To confirm uaac was properly installed, run the following command to ensure the version is displayed:
Step 9- Run the following commands to install Ops Manager CLI:
chmod +x om-linux
mv om-linux /usr/local/bin/om
Step 10 - To confirm om was properly installed, run the following command to ensure the version is displayed:
Step 11 - Run the following commands to install Bosh CLI:
chmod +x bosh-cli-2.0.48-linux-amd64
mv bosh-cli-2.0.48-linux-amd64 /usr/local/bin/bosh
Step 12 - To confirm bosh was properly installed, run the following command to ensure the version is displayed:
Step 13 - Run the following commands to install NSX CLI helper script:
apt -y install git httpie jq
tar -xvzf nsx-helper-pkg.tar.gz
chmod +x nsx-cli.sh
At this point, we have successfully configured our PKS Client VM and it is ready to consume the PKS platform once we have it deployed. In Part 3, we will move onto the networking aspects required for PKS and walk through the NSX-T configurations. The article will assume you have already deployed an NSX-T instance with the basic configurations already applied (e.g. Host Prep, Controllers, Edge, Edge Cluster, etc). There are plenty of resources online if you want to walk through an NSX-T deployment, including my Automated NSX-T deployment script which can be found here.
Chanvit Jewriyavech says
Hi William, Thanks for very good articles. I got this error.
[email protected]:~# apt -y install git httpie jq
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package httpie is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'httpie' has no installation candidate
E: Unable to locate package jq
William Lam says
Try updating Ubuntu system by running: apt-get -y update
Hi William, great post !! Thank you.
Were you able to find the required packages for PhotonOS ? Thanks !
Hi William, thanks for the port. I have an issue with installing cf-uaac from "gem install cf-uaac" bacause my CLI vm has no access to internet. Can I get cf-uaac libraries somewhere then install it mannual on the VM?
Thanks William for all those great informations !
If you're stuck with a Red Hat Server 7 for your "PKS Client" (like I am), you'll need to subscribe to the Software Collections channel and then :
yum install gcc gcc-c++ rh-ruby25-ruby rh-ruby25-ruby-devel jq
scl enable rh-ruby25 bash
then you'll be ready to install cf-uaac with the gem installer.
gem install --http-proxy http://: cf-uaac
Could you advise how to subscribe to the Software Collections channel on Redhat? I am going to using a centos 7 machine, but unable to yum install these packages with the standard centos yum repo and epel.