With the advent of the IBM announcement of IBM® Cloud Foundry being deprecated, this repository needs a new main contributor/maintainer. IBM announcement here: https://cloud.ibm.com/docs/cloud-foundry-public?topic=cloud-foundry-public-deprecation
The Administration Web UI provides metrics and operations data for Cloud Foundry NG. It gathers data from the varz providers and doppler_logging_endpoint for the various Cloud Foundry components as well as from the Cloud Controller and UAA REST APIs.
See the Using the Administration UI section for more information on using it and for sample screen shots.
In order to run the Administration UI on a release prior to cf-release v245, use the cf-release-pre-v245 branch.
CF releases for v245 and later continue to use the master branch.
This is due to the CCDB changes for applications in cf-release v245.
In order to execute, the Administration UI needs to be able to access the following resources:
Installation of the Administration UI and its prerequisites requires access to the Internet to access GitHub.com, RubyGems.org, Ubuntu software repositories, etc.
The last version of Ubuntu this has been tested upon is Ubuntu 18.04.5 64 bit.
# Update your package listing
sudo apt-get update
# Install prerequisite libraries
sudo apt-get install -f -y --no-install-recommends git-core build-essential libreadline-dev libssl-dev libsqlite3-dev openssl libpq-dev libmysqlclient-dev
Ruby is required to run the Administration UI. The last version used for development and testing is Ruby 3.1.2.
Here is a sample installation of ruby using rbenv:
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.profile
echo 'eval "$(rbenv init -)"' >> ~/.profile
. ~/.profile
rbenv install 3.1.2
rbenv global 3.1.2
git clone https://github.com/cloudfoundry-incubator/admin-ui.git
cd admin-ui
bundle install
The following steps are the same if you are using the default bosh-lite install of Cloud Foundry or AWS install using BOSH AWS Bootstrap.
# Target your bosh-lite UAA and get the 'admin' token
uaac target --skip-ssl-validation https://uaa.bosh-lite.com
uaac token client get admin -s admin-secret
# Add 'scim.write' if not already there and re-get token
uaac client update admin --authorities "`uaac client get admin | \
awk '/:/{e=0}/authorities:/{e=1;if(e==1){$1="";print}}'` scim.write"
uaac token client get admin -s admin-secret
# Create a new group and add the 'admin' user to it
uaac group add admin_ui.admin
uaac member add admin_ui.admin admin
# Create the new UAA admin_ui_client
uaac client add admin_ui_client \
--authorities clients.write,cloud_controller.admin,cloud_controller.read,cloud_controller.write,doppler.firehose,openid,scim.read,scim.write,sps.write,uaa.admin,uaa.resource \
--authorized_grant_types authorization_code,client_credentials,refresh_token \
--autoapprove true \
--redirect_uri http://<admin ui host>:8070/login \
--scope admin_ui.admin,admin_ui.user,openid \
-s admin_ui_secret
Note:
If you are using the default bosh-lite install, then running the above commands and setting the bosh-lite-specific configuration values in config/default.yml (ccdb_uri
password, cloud_controller_ssl_verify_none
, mbus
password and uaadb_uri
password) should enable you to use the default
configuration values for the Administration UI and you can skip down to the
Using the Administration UI section.
If you have installed Cloud Foundry on AWS using the AWS Bosh Bootstrap, then you will have to modify the Administration UI before moving forward.
Default configuration found in config/default.yml
Values that must be changed for your environment are marked in bold.
bind_address
0.0.0.0
ccdb_uri
<protocol>://<db-user>:<db-user-password>@<host>:<port>/<db-name>
postgres://ccadmin:admin@10.244.0.30:5524/ccdb
mysql2://ccadmin:admin@10.244.0.30:3306/ccdb
mysql2
protocol instead of mysql
. Only PostgreSQL and MySQL have been tested to work with the Administration UI.
Gemfile
and executing bundle update
.
cloud_controller_discovery_interval
300
cloud_controller_ssl_verify_none
true
false
cloud_controller_uri
component_connection_retries
2
cookie_key
mykey
cookie_secret
mysecret
cookie_secure
true
data_file
data/data.json
db_uri
sqlite://data/store.db
sqlite:///tmp/store.db
indicates the database file 'store.db' is located in the '/tmp' directory.
display_encrypted_values
true
false
doppler_data_file
data/doppler_data.json
doppler_logging_endpoint_override
doppler_reconnect_delay
300
doppler_rollup_interval
30
doppler_ssl_verify_none
true
false
event_days
7
http_debug
false
as this is considered a security exposure.
Records within the log_file will be of log type ANY
.
true
false
log_file
admin_ui.log
log_file_page_size
51200
log_file_sftp_keys
[/some_directory/some_key.pem]
log_files
['/var/vcap/sys/log/cloud_controller_ng/cloud_controller_ng.log']
['/var/vcap/sys/log/cloud_controller_ng/*.log']
['/var/vcap/sys/log/**/*.log']
['sftp://someuser:somepassword@10.10.10.10/path/file.log']
['sftp://someuser@10.10.10.10/path/*.log']
['sftp://someuser:somepassword@10.10.10.10/path/**/*.log']
mbus
nats://nats:c1oudc0w@10.10.10.10:4222
monitored_components
[NATS, CloudController, DEA, HealthManager, Router]
[-Provisioner]
[ALL]
nats_discovery_interval
30
nats_discovery_timeout
vcap.component.discover
.
10
nats_tls
ca_file
verify_peer
has a value of true
.
./ca.pem
cert_chain_file
./cert.pem
private_key_file
./key.pem
verify_peer
ca_file
configuration is required.
true
port
8070
receiver_emails
[ ]
[bar@10.10.10.10, baz@10.10.10.10]
secured_client_connection
true
sender_email
server
10.10.10.10
port
25
domain
localhost
account
system@10.10.10.10
secret
authtype
plain
, login
, cram_md5
.
login
ssl
openssl genrsa -des3 -out /tmp/admin_ui_server.key -3 -passout pass:private_key_pass_phrase 2048This command creates a private key at 2048 bit length which is then encrypted with passphrase 'pass:private_key_pass_phrase' by way of DES3. * Generate certificate request
openssl req -new -key /tmp/admin_ui_server.key -out /tmp/admin_ui_server.csr -passin pass:private_key_pass_phraseThis command yields a certificate request file by supplying the private key and passphrase involved in the previous step. * Generate certificate
openssl x509 -req -days 365 -passin pass:private_key_pass -in /tmp/admin_ui_server.csr -signkey /tmp/admin_ui_server.key -out /tmp/admin_ui_server.crtThis command generates a certificate that is good for the next 365 days. At this point, you no longer need to keep the certificate request (dot csr file).
certificate_file_path
certificate/server.cert
max_session_idle_length
1800
for 30 minutes.
private_key_file_path
system@10.10.10.10
private_key_pass_phrase
my_secret
stats_file
data/stats.json
stats_refresh_time
300
. This results in stats collection starting at 5 AM.
stats_refresh_schedules
* * * * * - - - - - | | | | | | | | | +----- day of week (0 - 6)(Sunday=0) | | | +------- month (1 - 12) | | +--------- day of month (1 - 31) | +----------- hour (0 - 23) +------------- minute (0 - 59) where * denotes an expression using legal values shown inside the parenthesis for the column.* Fields are separated by spaces. * Fields can be expressed by a wild card * symbol which means every occurrence of the fields.
['0 * * * *']
means the collection starts once every hour at the beginning of the hour.
* Field value can be expressed in form of a range, which consists of two legal values connected by a hyphen (-).
['0 0 * * 1-5']
means the collection starts at midnight 12:00AM, Monday to Friday.
* Field value can also be a sequence of legal values separated by comma. Sequence doesn't need to be monotonic.
['0 1,11,12,13 * * *']
means the collection process starts at 1:00AM, 11:00AM, 12:00PM and 1:00PM every day.
* Mixed uses of sequence and ranges are permitted. ['0 1,11-13 * * *']
[ '0 1 * * *', '0 12-13 * * 1-5' ]
means the collection starts at 1:00AM everyday; on Monday to Friday, the collection process will also start at 12:00PM and 1:00PM.
This property supports the following predefined schedules
Predefined Schedule Description ----------------------------------------------------------------------------- ['@hourly'] runs at the beginning of every hour ['@daily'] runs at the 12:00AM everyday ['@midnight'] runs at the 12:00AM everyday ['@weekly'] runs at the 12:00AM every Sunday ['@monthly'] runs at the 12:00AM on first day of the month ['@yearly'] runs at the 12:00AM on every Jan 1st ['@annually'] runs at the 12:00AM on every Jan 1st. It is the same as @yearly.* When stats_refresh_schedules and stats_refresh_time are both present in the default.yml file, admin-ui will error out with an error message which reads Two mutually exclusive properties, stats_refresh_time and stats_refresh_schedules, are present in the configuration file. Please remove one of the two properties.
stats_refresh_schedules: ['0 5 * * *']
. This value translates to a schedule that starts daily at 5:00AM. stats_retries
5
stats_retry_interval
300
table_height
100%
table_page_size
25
uaa_client
id
admin_ui_client
secret
admin_ui_secret
uaac client add admin_ui_client \ --authorities clients.write,cloud_controller.admin,cloud_controller.read,cloud_controller.write,doppler.firehose,openid,scim.read,scim.write,sps.write,uaa.admin,uaa.resource \ --authorized_grant_types authorization_code,client_credentials,refresh_token \ --autoapprove true \ --redirect_uri http://<admin ui host>:8070/login \ --scope admin_ui.admin,admin_ui.user,openid \ -s admin_ui_secret
uaa_groups_admin
[admin_ui.admin, cloud_controller.admin]
uaac group add admin_ui.admin
uaac member add admin_ui.admin your_user_name
uaa_groups_user
[admin_ui.user]
uaac group add admin_ui.user
uaac member add admin_ui.user your_user_name
uaadb_uri
<protocol>://<db-user>:<db-user-password>@<host>:<port>/<db-name>
postgres://uaaadmin:admin@10.244.0.30:5524/uaadb
mysql2://uaaadmin:admin@10.244.0.30:3306/uaadb
mysql2
protocol instead of mysql
. Only PostgreSQL and MySQL have been tested to work with the Administration UI.
Gemfile
and executing bundle update
.
varz_discovery_interval
30
Prior releases of Admin-UI store stats data in a file as indicated by the stats_file configuration property. This data is now stored in a database. Data migration is referring to the transfer of stats information from file to database.
Data migration takes place automatically at the start of admin-UI daemon process when the following conditions are all met:
When Admin-UI completes the data migration to database, it will rename the original stats file by appending '.bak' file extension. For example, 'stats.json' becomes 'stats.json.bak'.
Data migration is run only once on a given database instance. If for some reason you wish to rerun data migration, you must operate on a different database instance.
At the start of its daemon process, Admin-UI always checks its database schema migration directory and attempts to bring its database schema up to date. So it's not required to run schema migration manually. This migration takes place before data migration.
The database schema migration directory is located at 'db/migrations'. This directory contains files responsible for both populating database schema and subsequently migrating the schema. Migration files are built on the Sequel migration framework, and hence adhere to its file naming convention. i.e.
<timestamp>_<title>.rb
The schema migration Admin-UI initiated always follows the chronological order as indicated by time stamps embedded in the migration file names.
More details about Sequel migration framework and ways to perform manual schema migration can be found at the following URLs:
You can provide an option to reference the configuration file when you execute the administration UI or you can let it default to config/default.yml
ruby bin/admin [-c <configuration file>]
You can remotely check if the Administration UI is running by accessing the /health path and checking for a status code of 200. This path does not require authorization. Currently no response body is returned.
http://<admin ui host>:8070/health
To access the Administration UI, go to:
http://<admin ui host>:8070
You will be prompted for the credentials. Once there, by default, you will be taken to the DEA tab:
From there you will see the list of DEAs running in the environment, along with some basic statistics. Selecting one from the list will bring up another table below the DEA table showing even more details about the DEA you selected:
One important thing to note is that some of the items in the secondary
table are hyperlinks. Clicking on that link will take you to the appropriate
tab with a query already filled in, allowing you to see just the data
related to what you clicked on. For example, in the table above if you
clicked on the Apps
link, meaning the 2
,
you'll be taken to the Apps
tab and the query will be
filled in such that you will only see the apps running on this DEA,
as shown here:
Notice the Search
entry field is pre-populated with a string
and the table is filtered to show just those rows that contain that string
in any column.
Also, note that each row in the table has a checkbox. While not all tables will have those, by selecting a set of rows an action can be performed on them. For example, in this case, by selecting one or more apps you can then use the buttons on the right side of the main table:
to start, stop, restart, etc. those apps.
All of the tabs will follow the same interaction pattern as described above.
There are however a few other tabs that worth calling out.
The Logs
tab will display the contents of the log files that the
Administration UI has access to - these need to be local to the application:
On this tab, once a particular log file is selected, you can examine its contents in the text area. Use the buttons to iterate through the file one page at a time, or use horizontal scroll bar at the top of the text area to quickly move to one section of the file.
The Stats
tab:
can be used to view basic history data about the environment. Normally,
a snapshot of the statistics are taken once a day, but you can force a new
set of data points to be taken by using the Create Stats
button.