Initial setup for nova-controller

Partial-blueprint: kube-nova-container
Change-Id: Ib48e6318ae458bf03510725a220332d1920cbeae
This commit is contained in:
Ryan Hallisey 2014-10-06 14:13:16 +00:00 committed by Ryan Hallisey
parent 296b09e0c4
commit 9e420ba27e
12 changed files with 257 additions and 0 deletions

View File

@ -0,0 +1,8 @@
FROM kollaglue/fedora-rdo-nova-controller
MAINTAINER Ryan Hallisey <rhallise@redhat.com>
RUN yum -y install \
openstack-nova-api && yum clean all
ADD ./start.sh /start.sh
CMD ["/start.sh"]

View File

@ -0,0 +1 @@
../../../tools/build-docker-image

View File

@ -0,0 +1,41 @@
#!/bin/sh
: ${NOVA_DB_USER:=nova}
: ${NOVA_DB_NAME:=nova}
: ${KEYSTONE_AUTH_PROTOCOL:=http}
: ${NOVA_KEYSTONE_USER:=admin}
: ${NOVA_ADMIN_PASSWORD:=kolla}
: ${ADMIN_TENANT_NAME:=admin}
if ! [ "$KEYSTONE_ADMIN_TOKEN" ]; then
echo "*** Missing KEYSTONE_ADMIN_TOKEN" >&2
exit 1
fi
if ! [ "$DB_ROOT_PASSWORD" ]; then
echo "*** Missing DB_ROOT_PASSWORD" >&2
exit 1
fi
if ! [ "$NOVA_DB_PASSWORD" ]; then
NOVA_DB_PASSWORD=$(openssl rand -hex 15)
export NOVA_DB_PASSWORD
fi
sh /opt/nova/config-nova.sh api
mysql -h ${MARIADBMASTER_PORT_3306_TCP_ADDR} -u root \
-p${DB_ROOT_PASSWORD} mysql <<EOF
CREATE DATABASE IF NOT EXISTS ${NOVA_DB_NAME};
GRANT ALL PRIVILEGES ON nova* TO
'${NOVA_DB_USER}'@'%' IDENTIFIED BY '${NOVA_DB_PASSWORD}'
EOF
export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}"
export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONEMASTER_35357_PORT_35357_TCP_ADDR}:35357/v2.0"
/usr/bin/keystone user-create --name ${NOVA_KEYSTONE_USER} --pass ${NOVA_ADMIN_PASSWORD}
/usr/bin/keystone role-create --name ${NOVA_KEYSTONE_USER}
/usr/bin/keystone user-role-add --user ${NOVA_KEYSTONE_USER} --role admin --tenant ${ADMIN_TENANT_NAME}
exec /usr/bin/nova-api

View File

@ -0,0 +1,8 @@
FROM kollaglue/fedora-rdo-nova-controller
MAINTAINER Ryan Hallisey <rhallisey@redhat.com>
RUN yum -y install \
openstack-nova-conductor && yum clean all
ADD ./start.sh /start.sh
CMD ["/start.sh"]

View File

@ -0,0 +1 @@
../../../tools/build-docker-image

View File

@ -0,0 +1,41 @@
#!/bin/sh
: ${NOVA_DB_USER:=nova}
: ${NOVA_DB_NAME:=nova}
: ${KEYSTONE_AUTH_PROTOCOL:=http}
: ${NOVA_KEYSTONE_USER:=admin}
: ${NOVA_ADMIN_PASSWORD:=kolla}
: ${ADMIN_TENANT_NAME:=admin}
if ! [ "$KEYSTONE_ADMIN_TOKEN" ]; then
echo "*** Missing KEYSTONE_ADMIN_TOKEN" >&2
exit 1
fi
if ! [ "$DB_ROOT_PASSWORD" ]; then
echo "*** Missing DB_ROOT_PASSWORD" >&2
exit 1
fi
if ! [ "$NOVA_DB_PASSWORD" ]; then
NOVA_DB_PASSWORD=$(openssl rand -hex 15)
export NOVA_DB_PASSWORD
fi
sh /opt/nova/config-nova.sh conductor
mysql -h ${MARIADBMASTER_PORT_3306_TCP_ADDR} -u root \
-p${DB_ROOT_PASSWORD} mysql <<EOF
CREATE DATABASE IF NOT EXISTS ${NOVA_DB_NAME};
GRANT ALL PRIVILEGES ON nova* TO
'${NOVA_DB_USER}'@'%' IDENTIFIED BY '${NOVA_DB_PASSWORD}'
EOF
export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}"
export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONEMASTER_35357_PORT_35357_TCP_ADDR}:35357/v2.0"
/usr/bin/keystone user-create --name ${NOVA_KEYSTONE_USER} --pass ${NOVA_ADMIN_PASSWORD}
/usr/bin/keystone role-create --name ${NOVA_KEYSTONE_USER}
/usr/bin/keystone user-role-add --user ${NOVA_KEYSTONE_USER} --role admin --tenant ${ADMIN_TENANT_NAME}
exec /usr/bin/nova-conductor

View File

@ -0,0 +1,98 @@
{
"id": "nova",
"desiredState": {
"manifest": {
"version": "v1beta1",
"id": "nova-1",
"containers": [
{
"name": "nova-controller",
"image": "kollaglue/fedora-rdo-nova-controller",
"ports": [
{"containerPort": 9292}
],
"env": [
{
"name": "DB_ROOT_PASSWORD",
"value": "password"
},
{
"name": "NOVA_DB_PASSWORD",
"value": "novadbpassword"
},
{
"name": "KEYSTONE_ADMIN_TOKEN",
"value": "ADMINTOKEN"
}
]
},
{
"name": "nova-conductor",
"image": "kollaglue/fedora-rdo-nova-conductor",
"ports": [
{"containerPort": 9292}
],
"env": [
{
"name": "DB_ROOT_PASSWORD",
"value": "password"
},
{
"name": "NOVA_DB_PASSWORD",
"value": "novadbpassword"
},
{
"name": "KEYSTONE_ADMIN_TOKEN",
"value": "ADMINTOKEN"
}
]
},
{
"name": "nova-scheduler",
"image": "kollaglue/fedora-rdo-nova-scheduler",
"ports": [
{"containerPort": 9292}
],
"env": [
{
"name": "DB_ROOT_PASSWORD",
"value": "password"
},
{
"name": "NOVA_DB_PASSWORD",
"value": "novadbpassword"
},
{
"name": "KEYSTONE_ADMIN_TOKEN",
"value": "ADMINTOKEN"
}
]
},
{
"name": "nova-api",
"image": "kollaglue/fedora-rdo-nova-api",
"ports": [
{"containerPort": 9292}
],
"env": [
{
"name": "DB_ROOT_PASSWORD",
"value": "password"
},
{
"name": "NOVA_DB_PASSWORD",
"value": "novadbpassword"
},
{
"name": "KEYSTONE_ADMIN_TOKEN",
"value": "ADMINTOKEN"
}
]
}
]
}
},
"labels": {
"name": "nova-controller"
}
}

View File

@ -0,0 +1,8 @@
FROM kollaglue/fedora-rdo-base
MAINTAINER Ryan Hallisey <rhallisey@redhat.com>
RUN yum -y install openstack-nova-common \
install python-keystoneclient \
install python-nova \
install python-oslo-messaging \
install python-websockify && yum clean all

View File

@ -0,0 +1 @@
../../../tools/build-docker-image

View File

@ -0,0 +1,8 @@
FROM kollaglue/fedora-rdo-nova-controller
MAINTAINER Ryan Hallisey <rhallise@redhat.com>
RUN yum -y install \
openstack-nova-scheduler && yum clean all
ADD ./start.sh /start.sh
CMD ["/start.sh"]

View File

@ -0,0 +1 @@
../../../tools/build-docker-image

View File

@ -0,0 +1,41 @@
#!/bin/sh
: ${NOVA_DB_USER:=nova}
: ${NOVA_DB_NAME:=nova}
: ${KEYSTONE_AUTH_PROTOCOL:=http}
: ${NOVA_KEYSTONE_USER:=admin}
: ${NOVA_ADMIN_PASSWORD:=kolla}
: ${ADMIN_TENANT_NAME:=admin}
if ! [ "$KEYSTONE_ADMIN_TOKEN" ]; then
echo "*** Missing KEYSTONE_ADMIN_TOKEN" >&2
exit 1
fi
if ! [ "$DB_ROOT_PASSWORD" ]; then
echo "*** Missing DB_ROOT_PASSWORD" >&2
exit 1
fi
if ! [ "$NOVA_DB_PASSWORD" ]; then
NOVA_DB_PASSWORD=$(openssl rand -hex 15)
export NOVA_DB_PASSWORD
fi
sh /opt/nova/config-nova.sh scheduler
mysql -h ${MARIADBMASTER_PORT_3306_TCP_ADDR} -u root \
-p${DB_ROOT_PASSWORD} mysql <<EOF
CREATE DATABASE IF NOT EXISTS ${NOVA_DB_NAME};
GRANT ALL PRIVILEGES ON nova* TO
'${NOVA_DB_USER}'@'%' IDENTIFIED BY '${NOVA_DB_PASSWORD}'
EOF
export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}"
export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONEMASTER_35357_PORT_35357_TCP_ADDR}:35357/v2.0"
/usr/bin/keystone user-create --name ${NOVA_KEYSTONE_USER} --pass ${NOVA_ADMIN_PASSWORD}
/usr/bin/keystone role-create --name ${NOVA_KEYSTONE_USER}
/usr/bin/keystone user-role-add --user ${NOVA_KEYSTONE_USER} --role admin --tenant ${ADMIN_TENANT_NAME}
exec /usr/bin/nova-scheduler