Skip to content

Commit

Permalink
Contrail and OpenStack Cluster Access Doc
Browse files Browse the repository at this point in the history
Use these documents to setup OSH Contrail, OpenStack GUI, Contrail Analytics
and OpenStack Client Access.

Partial-Bug: #1749018

Change-Id: I9ebfac83da422db9df973d4287f858fc62ba4499
  • Loading branch information
qarham committed Feb 13, 2018
1 parent 325cea2 commit 9881230
Show file tree
Hide file tree
Showing 3 changed files with 150 additions and 0 deletions.
51 changes: 51 additions & 0 deletions doc/contrail-api-analytics-access.md
@@ -0,0 +1,51 @@
# How to access Contrail Analytics and Config APIs in OSH Cluster?


OpenStack Helm supports Fernet token for OpenStack Keystone. Please check OSH fernet token support for keystone blueprint URL in reference section for more detail.

### Steps to get the token and use with Analytics API:

* 1st step is getting the token and please use following command to get the token.


```
# openstack token issue
+------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| expires | 2018-02-09T23:21:11+0000 |
| id | gAAAAABafh7XDMVGefTtoY5P0rdLcV2gk4Oi3pc0U5Fq6fLp7ECdhCO1PG4Coam9FeCy-GNivFkWy3wtQ2ElpxpvcX0HzLBRO4JwW6QNPB9SrrRwHsjdokAdPkFoJgzJ1Yx4N7QBVJqKcBuUWIuUf5bvnJzhegWrRp5J9rnJzPYvF9wI4467kVY |
| project_id | 5fa242182853488e87345e873f2c3e25 |
| user_id | b5bc80c7ccb448f6a29d5822d67d9922 |
+------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
````
Once you get the token you can set ENV variable and use it in your CURL as described below. In below example vrouters UVE data is pulled via Contrail Analytics port 8081 using Keystone fernet token.

```
# export TOKEN_ID=gAAAAABafh7XDMVGefTtoY5P0rdLcV2gk4Oi3pc0U5Fq6fLp7ECdhCO1PG4Coam9FeCy-GNivFkWy3wtQ2ElpxpvcX0HzLBRO4JwW6QNPB9SrrRwHsjdokAdPkFoJgzJ1Yx4N7QBVJqKcBuUWIuUf5bvnJzhegWrRp5J9rnJzPYvF9wI4467kVY
# curl -X GET -H "X-Auth-Token: $TOKEN_ID" http://10.13.82.233:8081/analytics/uves/vrouters | python -m json.tool
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 309 100 309 0 0 9043 0 --:--:-- --:--:-- --:--:-- 9363
[
{
"href": "http://10.13.82.233:8081/analytics/uves/vrouter/vntc-server6?flat",
"name": "vntc-server6"
},
{
"href": "http://10.13.82.233:8081/analytics/uves/vrouter/vntc-server5?flat",
"name": "vntc-server5"
},
{
"href": "http://10.13.82.233:8081/analytics/uves/vrouter/vntc-server4?flat",
"name": "vntc-server4"
}
]
```

### Refernces:

* https://blueprints.launchpad.net/openstack-helm/+spec/keystone-fernet-tokens


95 changes: 95 additions & 0 deletions doc/contrail-osh-cluster-access.md
@@ -0,0 +1,95 @@
# How to access OpenContrail OpenStack Helm Cluster?


Once OpenStack & OpenContrail Helm cluster provisioning is completed please follow below steps to access OpenStack & Contrail WebUI and prepare openstack client for CLI

### Installation of OpenStack Client

First step is installation of Openstack client "CLI tool", you can install OpenStack CLI on master Ubuntu host using follwong steps:

```
apt install python-dev python-pip -y
pip install --upgrade pip
pip install python-openstackclient OR
apt-get install python-openstackclient
````
Note: In case facing issue in installing "python-dev" package follow these steps:

```
Add following repo to source "/etc/apt/sources.list"
deb http://archive.ubuntu.com/ubuntu/ xenial-updates main universe multiverse
apt-get update
apt-get install python-dev
```

### Create openstackrc file and test OpenStack Client

* To start using OpenStack CLI you need openstackrc file and you can create one using following step:

```
cat > /root/openstackrc << EOF
export OS_USERNAME=admin
export OS_PASSWORD=password
export OS_TENANT_NAME=admin
export OS_AUTH_URL=http://keystone-api.openstack:35357/v3
# The following lines can be omitted
#export OS_TENANT_ID=tenantIDString
#export OS_REGION_NAME=regionName
export OS_IDENTITY_API_VERSION=3
export OS_USER_DOMAIN_NAME=${OS_USER_DOMAIN_NAME:-"Default"}
export OS_PROJECT_DOMAIN_NAME=${OS_PROJECT_DOMAIN_NAME:-"Default"}
EOF
```

* Test openstack client using following steps:
```
source openstackrc
openstack server list
openstack stack list
openstack --help
```

### Accessing Contrail WebUI

Contrail GUI accessable via port 8143 and you can use following link to access. Please replace IP 10.13.82.233 with the host IP where contrail-webui POD is running. In below example contrail-webui pod is running on 10.13.82.233 host.

* Default username/passsword: admin/password
```
Access Contrail GUI at port 8143
https://10.13.82.233:8143
```


### Accessing OpenStack Horizon

Openstack GUI servcie is exposed via k8s servcie using node port and defulat port used is 31000 and you can check NodePort used for Openstack webui POD via following command. In below output port 31000 is used and you can access GUI using following URL.

* Openstack GUI username/password: admin/password

```
1. kubectl get svc -n openstack | grep horizon-int
horizon-int NodePort 10.99.150.28 <none> 80:31000/TCP 4d
2. http://10.13.82.233:31000/auth/login/?next=/
```

### Acessing Virtual Machine Console via Horizon

* To access VM console you have to add nova novncproxy FQDN in "/etc/hosts" file. Please add host-ip where "osh-ingress" POD is running. In below example ingree pod is running on host with IP 10.13.82.233. Here are instructions for updating "/etc/hosts entries for MAC-OS.

```bash
/private/etc/hosts  
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
10.13.82.233 nova-novncproxy.openstack.svc.cluster.local
```

Tip: If you don't want to make changes in "/etc/hosts" you can repalce "nova-novncproxy.openstack.svc.cluster.local" part in URL with the IP address where OSH Ingress POD is running.

### Refernces:

* https://docs.openstack.org/newton/install-guide-ubuntu/keystone-openrc.html
* https://docs.openstack.org/newton/user-guide/common/cli-install-openstack-command-line-clients.html
* https://docs.openstack.org/openstack-helm/latest/install/ext-dns-fqdn.html

4 changes: 4 additions & 0 deletions doc/faq.md
Expand Up @@ -56,3 +56,7 @@
3. How to enter into pod?

Use command `kubectl exec -it <contrail-pod> -n openstack -- bash`

4. How to access Openstack Horizon and OpenContrail WebUI?

[OpenContrail Cluster Access Doc](contrail-osh-cluster-access.md)

0 comments on commit 9881230

Please sign in to comment.