Horizon container implementation
Horizon requires that Nova, Neutron(Nova Network), Glance, and Keystone are running. Therefore, the container needs to check for the availablity of each service on startup. The config file is not a .ini file, but rather a python file so it requires using sed instead of crudini. Change-Id: I5ed14514881fe9aef688ca08bcb94881ef5b25cb
This commit is contained in:
parent
1520f41a65
commit
fdb5c77a90
@ -44,6 +44,34 @@ check_for_keystone() {
|
||||
echo "keystone is active @ $KEYSTONE_URL"
|
||||
}
|
||||
|
||||
# Exit unless we receive a successful response from the Nova API.
|
||||
check_for_nova() {
|
||||
check_required_vars NOVA_API_SERVICE_HOST
|
||||
|
||||
NOVA_API_URL="http://${NOVA_API_SERVICE_HOST}:8774"
|
||||
|
||||
curl -sf -o /dev/null "$NOVA_API_URL" || {
|
||||
echo "ERROR: nova is not available @ $NOVA_API_URL" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
echo "nova is active @ $NOVA_API_URL"
|
||||
}
|
||||
|
||||
# Exit unless we receive a successful response from the Neutron API.
|
||||
check_for_neutron() {
|
||||
check_required_vars NEUTRON_API_SERVICE_HOST
|
||||
|
||||
NEUTRON_API_URL="http://${NEUTRON_SERVER_SERVICE_HOST}:9696"
|
||||
|
||||
curl -sf -o /dev/null "$NEUTRON_API_URL" || {
|
||||
echo "ERROR: neutron is not available @ $NEUTRON_API_URL" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
echo "neutron is active @ $NEUTRON_API_URL"
|
||||
}
|
||||
|
||||
# Exit unless we receive a successful response from the database server.
|
||||
check_for_db() {
|
||||
check_required_vars MARIADB_SERVICE_HOST DB_ROOT_PASSWORD
|
||||
|
11
docker/horizon/Dockerfile
Normal file
11
docker/horizon/Dockerfile
Normal file
@ -0,0 +1,11 @@
|
||||
FROM kollaglue/fedora-rdo-base
|
||||
MAINTAINER Kolla Project (https://launchpad.net/kolla)
|
||||
|
||||
RUN yum -y install \
|
||||
openstack-dashboard && yum clean all
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
ADD ./start.sh /start.sh
|
||||
|
||||
CMD ["/start.sh"]
|
1
docker/horizon/build
Symbolic link
1
docker/horizon/build
Symbolic link
@ -0,0 +1 @@
|
||||
../../tools/build-docker-image
|
23
docker/horizon/start.sh
Executable file
23
docker/horizon/start.sh
Executable file
@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
: ${HORIZON_KEYSTONE_USER:=horizon}
|
||||
|
||||
. /opt/kolla/kolla-common.sh
|
||||
|
||||
check_required_vars HORIZON_KEYSTONE_USER
|
||||
|
||||
check_for_keystone
|
||||
check_for_glance
|
||||
check_for_nova
|
||||
check_for_neutron
|
||||
|
||||
cfg=/etc/openstack-dashboard/local_settings
|
||||
|
||||
sed -ri 's/#ALLOWED_HOSTS = \['\''horizon.example.com'\'', '\''localhost'\''\]/ALLOWED_HOSTS = \['\''*'\'', \]/' /etc/openstack-dashboard/local_settings
|
||||
|
||||
sed -ri 's/OPENSTACK_KEYSTONE_URL = \"http:\/\/%s:5000\/v2.0\" % OPENSTACK_HOST/OPENSTACK_KEYSTONE_URL = \"http:\/\/'"$KEYSTONE_PUBLIC_SERVICE_HOST"':5000\/v2.0\"/' /etc/openstack-dashboard/local_settings
|
||||
|
||||
sed -ri 's/OPENSTACK_HOST = \"127.0.0.1\"/OPENSTACK_HOST = \"'"$KEYSTONE_PUBLIC_SERVICE_HOST"'\" /' /etc/openstack-dashboard/local_settings
|
||||
|
||||
/bin/keystone role-create --name ${HORIZON_KEYSTONE_USER}
|
13
k8s/pod/horizon-pod.yaml
Normal file
13
k8s/pod/horizon-pod.yaml
Normal file
@ -0,0 +1,13 @@
|
||||
desiredState:
|
||||
manifest:
|
||||
containers:
|
||||
- env:
|
||||
image: kollaglue/fedora-rdo-horizon
|
||||
name: horizon
|
||||
ports:
|
||||
- containerPort: 80
|
||||
id: horizon-1
|
||||
version: v1beta1
|
||||
id: horizon
|
||||
labels:
|
||||
name: horizon
|
7
k8s/service/horizon-service.yaml
Normal file
7
k8s/service/horizon-service.yaml
Normal file
@ -0,0 +1,7 @@
|
||||
apiVersion: v1beta1
|
||||
containerPort: 80
|
||||
id: horizon
|
||||
kind: Service
|
||||
port: 80
|
||||
selector:
|
||||
name: horizon
|
@ -14,6 +14,7 @@ heat
|
||||
mongodb
|
||||
ceilometer-controller
|
||||
zaqar
|
||||
horizon
|
||||
'
|
||||
|
||||
for pod in $pods; do
|
||||
|
@ -18,6 +18,7 @@ rabbitmq
|
||||
neutron-server
|
||||
heat-api
|
||||
zaqar-server
|
||||
horizon
|
||||
'
|
||||
|
||||
for svc in $services; do
|
||||
|
Loading…
x
Reference in New Issue
Block a user