This UI will show BOSH deployments, vm's and processes.
413
This UI will show deployments, vm's and processes that Bosh Director has configured.
Prior to deploying the Bosh UI container, some environment variables need to be setup to communicate with the Bosh Director.
These can be created using a command similar to:
export BOSH_CLIENT=ops_manager BOSH_CLIENT_SECRET=xyz BOSH_ENVIRONMENT=172.31.0.2
For ops manager environments the above variable information can be found at https://opsman.corp.local/api/v0/deployed/director/credentials/bosh_commandline_credentials
Next the Bosh Director certificate needs to be accessible for the communication with the Bosh Director. The file can be placed anywhere but in this example it will have it's own directory.
mkdir ~/bosh-ui
With an environment that has ops manager, the following scp command can be used to get the file:
scp [email protected]:$BOSH_CA_CERT ~/bosh-ui/root_ca_certificate
or if you know the file location:
scp [email protected]:/var/tempest/workspaces/default/root_ca_certificate ~/bosh-ui/root_ca_certificate
Make sure that BOSH_CA_CERT variable points to the cert location. If the above directions were followed then issue:
cd ~
export BOSH_CA_CERT="$({ pwd; echo "bosh-ui";} | tr "\n" "/")"
The Bosh UI container can be deployed in various ways, but the two recommended was are:
Docker must be installed and running. Also the machine must have network access to the Bosh Director, which can be verified with ping.
Create the container in detached mode with the mount at the cert location and the port of 8080.
docker run --name bosh-ui --mount type=bind,source=$BOSH_CA_CERT,target=/tmp,readonly -e "BOSH_CLIENT=$BOSH_CLIENT" -e "BOSH_CLIENT_SECRET=$BOSH_CLIENT_SECRET" -e "BOSH_ENVIRONMENT=$BOSH_ENVIRONMENT" -p 8080:10000 -d randysimpson/bosh-ui:latest
The UI is now accessible from a browser using the IP of the machine running the container on port 8080. To find the IP for the machine use ifconfig.
Kubernetes cluster must be up and running and network access to the Bosh Director from inside pods is necessary. This can be verified by using the busybox pod and issuing ping to director IP.
kubectl create -f https://raw.githubusercontent.com/randysimpson/tools/master/k8s/troubleshooting/busybox.yaml
After the pod is running, issue:
kubectl exec -ti busybox -- ping 172.31.0.2
There are 2 options for deploying bosh-ui in Kubernetes:
or
The easiest way to install the bosh ui on an existing Kubernetes cluster that has networking access to the bosh director VM is to download the following script and execute it to install the components.
$ curl -fsSL https://raw.githubusercontent.com/randysimpson/tools/master/bosh-ui/bosh-ui.sh -o bosh-ui.sh
$ sh bosh-ui.sh
Continue with External IP
Create necessary k8s secrets:
kubectl create secret generic bosh-ui-ca-cert \
--from-file=root_ca_certificate=$BOSH_CA_CERT
kubectl create secret generic bosh-ui-env \
--from-literal=BOSH-CLIENT=$BOSH_CLIENT \
--from-literal=BOSH-CLIENT-SECRET=$BOSH_CLIENT_SECRET \
--from-literal=BOSH-ENVIRONMENT=$BOSH_ENVIRONMENT
To launch the deployment, service and ingress use the following:
kubectl create -f https://raw.githubusercontent.com/randysimpson/tools/master/bosh-ui/bosh-ui-deployment.yaml
Then expose the service on your loadbalancer:
kubectl expose deployment bosh-ui-deployment \
--name=bosh-ui-frontend --port=80 \
--target-port=10000 --type=LoadBalancer
Continue with External IP
To find the external IP issue:
kubectl get svc bosh-ui-frontend
Then from a web browser type in the ip address from previous command found in the EXTERNAL-IP column.
docker stop bosh-ui
docker rm bosh-ui
kubectl delete secret/bosh-ui-ca-cert
kubectl delete secret/bosh-ui-env
kubectl delete deployment.apps/bosh-ui-deployment
kubectl delete service/bosh-ui-frontend
Content type
Image
Digest
Size
7.6 MB
Last updated
almost 7 years ago
docker pull randysimpson/bosh-ui