From dafbaf05edce9199953688bc076e75e59fee5aeb Mon Sep 17 00:00:00 2001 From: Daneyon Hansen Date: Fri, 27 Feb 2015 03:02:48 +0000 Subject: [PATCH] Implements: blueprint container-set-api-control Adds Keystone Container-Set support Previously, Keystone containers were configured for use in a Kubernetes environment. This patch removed k8s dependencies and adds container set functionality. Change-Id: I131ce205857110bbee49fe81a4a005f9e273ce09 --- docker/keystone/Dockerfile | 17 ++--- docker/keystone/start.sh | 145 ++++++++++++++++++++++++++++++------- 2 files changed, 126 insertions(+), 36 deletions(-) diff --git a/docker/keystone/Dockerfile b/docker/keystone/Dockerfile index e4ad8941a5..3be9ae3cc7 100644 --- a/docker/keystone/Dockerfile +++ b/docker/keystone/Dockerfile @@ -2,14 +2,13 @@ FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%base MAINTAINER Kolla Project (https://launchpad.net/kolla) #Install required packages -RUN yum install -y openstack-keystone \ - openstack-utils \ - mariadb \ - ; yum clean all +RUN yum -y install openstack-keystone \ + python-keystoneclient \ + ; yum clean all -ADD ./start.sh /start.sh -ADD ./check.sh /check.sh +# Add start-up and check scripts +ADD ./start.sh /opt/kolla/start.sh +ADD ./check.sh /opt/kolla/check.sh -EXPOSE 5000 35357 - -CMD ["/start.sh"] +# Run the Keystone start script +CMD ["/opt/kolla/start.sh"] diff --git a/docker/keystone/start.sh b/docker/keystone/start.sh index 087cecc36b..ab3427256c 100755 --- a/docker/keystone/start.sh +++ b/docker/keystone/start.sh @@ -2,77 +2,168 @@ set -e -: ${KEYSTONE_ADMIN_PASSWORD:=kolla} -: ${ADMIN_TENANT_NAME:=admin} - +# Run Kolla common script +echo "Running the kolla-common script" . /opt/kolla/kolla-common.sh + +# Credentials, token, etc.. +: ${KEYSTONE_USER:=keystone} +: ${KEYSTONE_ADMIN_PASSWORD:=password} +: ${ADMIN_TENANT_NAME:=admin} +: ${KEYSTONE_ADMIN_TOKEN:=changeme} +# DB Settings +: ${INIT_DB:=true} +: ${KEYSTONE_DB_NAME:=keystone} +: ${KEYSTONE_DB_USER:=keystone} +: ${DB_ROOT_PASSWORD:=password} +: ${MARIADB_SERVICE_HOST:=$PUBLIC_IP} +: ${KEYSTONE_DB_PASSWORD:=password} +# Service Addresses/Ports/Version +: ${KEYSTONE_PUBLIC_SERVICE_HOST:=$PUBLIC_IP} +: ${KEYSTONE_ADMIN_SERVICE_HOST:=$PUBLIC_IP} +: ${KEYSTONE_PUBLIC_SERVICE_PORT:=5000} +: ${KEYSTONE_ADMIN_SERVICE_PORT:=35357} +: ${KEYSTONE_API_VERSION:=2.0} +# Logging +: ${LOG_FILE:=/var/log/keystone/keystone.log} +: ${VERBOSE_LOGGING:=true} +: ${DEBUG_LOGGING:=false} +: ${USE_STDERR:=false} +# Token provider, driver, etc.. +: ${TOKEN_PROVIDER:=uuid} +: ${TOKEN_DRIVER:=sql} + +## Check DB connectivity and required variables +echo "Checking connectivity to the DB" check_for_db +echo "Checking for required variables" check_required_vars KEYSTONE_ADMIN_TOKEN KEYSTONE_DB_PASSWORD \ KEYSTONE_ADMIN_PASSWORD ADMIN_TENANT_NAME \ KEYSTONE_PUBLIC_SERVICE_HOST KEYSTONE_ADMIN_SERVICE_HOST \ PUBLIC_IP dump_vars +# Setup the Keystone DB +echo "Setting up Keystone DB" mysql -h ${MARIADB_SERVICE_HOST} -u root -p"${DB_ROOT_PASSWORD}" mysql < /openrc <