Initial setup for nova-controller
Partial-blueprint: kube-nova-container Change-Id: Ib48e6318ae458bf03510725a220332d1920cbeae
This commit is contained in:
parent
296b09e0c4
commit
9e420ba27e
8
docker/nova-controller/nova-api/Dockerfile
Normal file
8
docker/nova-controller/nova-api/Dockerfile
Normal 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"]
|
1
docker/nova-controller/nova-api/build
Symbolic link
1
docker/nova-controller/nova-api/build
Symbolic link
@ -0,0 +1 @@
|
||||
../../../tools/build-docker-image
|
41
docker/nova-controller/nova-api/start.sh
Normal file
41
docker/nova-controller/nova-api/start.sh
Normal 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
|
8
docker/nova-controller/nova-conductor/Dockerfile
Normal file
8
docker/nova-controller/nova-conductor/Dockerfile
Normal 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"]
|
1
docker/nova-controller/nova-conductor/build
Symbolic link
1
docker/nova-controller/nova-conductor/build
Symbolic link
@ -0,0 +1 @@
|
||||
../../../tools/build-docker-image
|
41
docker/nova-controller/nova-conductor/start.sh
Normal file
41
docker/nova-controller/nova-conductor/start.sh
Normal 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
|
98
docker/nova-controller/nova-controller.json
Normal file
98
docker/nova-controller/nova-controller.json
Normal 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"
|
||||
}
|
||||
}
|
8
docker/nova-controller/nova-controller/Dockerfile
Normal file
8
docker/nova-controller/nova-controller/Dockerfile
Normal 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
|
1
docker/nova-controller/nova-controller/build
Symbolic link
1
docker/nova-controller/nova-controller/build
Symbolic link
@ -0,0 +1 @@
|
||||
../../../tools/build-docker-image
|
8
docker/nova-controller/nova-scheduler/Dockerfile
Normal file
8
docker/nova-controller/nova-scheduler/Dockerfile
Normal 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"]
|
1
docker/nova-controller/nova-scheduler/build
Symbolic link
1
docker/nova-controller/nova-scheduler/build
Symbolic link
@ -0,0 +1 @@
|
||||
../../../tools/build-docker-image
|
41
docker/nova-controller/nova-scheduler/start.sh
Normal file
41
docker/nova-controller/nova-scheduler/start.sh
Normal 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
|
Loading…
Reference in New Issue
Block a user