Merge "Implement containers for heat-engine and heat-api"
This commit is contained in:
commit
7d0f2d41eb
@ -1,14 +1,14 @@
|
|||||||
FROM kollaglue/fedora-rdo-base
|
FROM kollaglue/fedora-rdo-heat-base
|
||||||
MAINTAINER James Labocki <jlabocki@redhat.com>
|
MAINTAINER Jeff Peeler <jpeeler@redhat.com>
|
||||||
|
|
||||||
RUN yum install -y openstack-heat-api \
|
# TODO: configure cfn and cloudwatch
|
||||||
openstack-heat-api-cfn \
|
# TODO: remove python-openstackclient once crux feature is added in start.sh
|
||||||
openstack-heat-common \
|
RUN yum -y install \
|
||||||
openstack-heat-api-cloudwatch \
|
openstack-heat-api \
|
||||||
openstack-utils \
|
python-openstackclient \
|
||||||
python-openstackclient \
|
; yum clean all
|
||||||
&& yum clean all
|
|
||||||
|
|
||||||
ADD ./start.sh /start.sh
|
ADD ./start.sh /start.sh
|
||||||
|
ADD ./check.sh /check.sh
|
||||||
|
|
||||||
CMD ["/start.sh"]
|
CMD ["/start.sh"]
|
||||||
|
16
docker/heat/heat-api/check.sh
Executable file
16
docker/heat/heat-api/check.sh
Executable file
@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
RES=0
|
||||||
|
|
||||||
|
. /openrc
|
||||||
|
if ! keystone token-get > /dev/null; then
|
||||||
|
echo "ERROR: keystone token-get failed" >&2
|
||||||
|
RES=1
|
||||||
|
else
|
||||||
|
if ! heat stack-list > /dev/null; then
|
||||||
|
echo "ERROR: heat stack-list failed" >&2
|
||||||
|
RES=1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit $RES
|
33
docker/heat/heat-api/start.sh
Normal file → Executable file
33
docker/heat/heat-api/start.sh
Normal file → Executable file
@ -1,13 +1,34 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
: ${IP_ADDRESS:=$IP_ADDRESS}
|
. /opt/kolla/kolla-common.sh
|
||||||
|
. /opt/kolla/config-heat.sh
|
||||||
|
|
||||||
if [ -z "$IP_ADDRESS" ]; then
|
check_required_vars KEYSTONE_ADMIN_TOKEN KEYSTONE_ADMIN_SERVICE_HOST \
|
||||||
echo >&2 'error: IP_ADDRESS is not set.'
|
HEAT_KEYSTONE_USER HEAT_KEYSTONE_PASSWORD \
|
||||||
echo >&2 ' Be sure to set IP_ADDRESS so it can be placed in heat configurations'
|
KEYSTONE_AUTH_PROTOCOL ADMIN_TENANT_NAME \
|
||||||
exit 1
|
HEAT_API_SERVICE_HOST PUBLIC_IP
|
||||||
fi
|
|
||||||
|
|
||||||
|
check_for_keystone
|
||||||
|
|
||||||
|
export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}"
|
||||||
|
export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_SERVICE_HOST}:35357/v2.0"
|
||||||
|
crux user-create -n ${HEAT_KEYSTONE_USER} \
|
||||||
|
-p ${HEAT_KEYSTONE_PASSWORD} \
|
||||||
|
-t ${ADMIN_TENANT_NAME} \
|
||||||
|
-r admin
|
||||||
|
|
||||||
|
crux endpoint-create --remove-all -n ${HEAT_KEYSTONE_USER} -t orchestration \
|
||||||
|
-I "${KEYSTONE_AUTH_PROTOCOL}://${HEAT_API_SERVICE_HOST}:8004/v1/%(tenant_id)s" \
|
||||||
|
-P "${KEYSTONE_AUTH_PROTOCOL}://${PUBLIC_IP}:8004/v1/%(tenant_id)s" \
|
||||||
|
-A "${KEYSTONE_AUTH_PROTOCOL}://${HEAT_API_SERVICE_HOST}:8004/v1/%(tenant_id)s"
|
||||||
|
|
||||||
|
#crux endpoint-create --remove-all -n ${HEAT_KEYSTONE_USER} -t cloudformation \
|
||||||
|
# -I "http://${HEAT_CFN_API_SERVICE_HOST}:8000/v1" \
|
||||||
|
# -P "http://${PUBLIC_IP}:8000/v1" \
|
||||||
|
# -A "http://${HEAT_CFN_API_SERVICE_HOST}:8000/v1"
|
||||||
|
|
||||||
|
# will use crux after https://github.com/larsks/crux/issues/1 is implemented
|
||||||
|
openstack role list --os-token="${KEYSTONE_ADMIN_TOKEN}" --os-url $SERVICE_ENDPOINT -f csv | tail -n +2 | awk -F, '{print $2}' | grep heat_stack_user || keystone role-create --name heat_stack_user
|
||||||
|
|
||||||
exec /usr/bin/heat-api
|
exec /usr/bin/heat-api
|
||||||
|
@ -1,10 +1,5 @@
|
|||||||
FROM fedora-rdo-base
|
FROM kollaglue/fedora-rdo-base
|
||||||
MAINTAINER Steven Dake <sdake@redhat.com>
|
MAINTAINER Jeff Peeler <jpeeler@redhat.com>
|
||||||
|
|
||||||
RUN yum -y install \
|
RUN mkdir -p /opt/kolla
|
||||||
openstack-utils \
|
COPY config-heat.sh /opt/kolla/config-heat.sh
|
||||||
openstack-heat && yum clean all
|
|
||||||
|
|
||||||
# These will come after we sort out start time config
|
|
||||||
#RUN mkdir /opt/heat
|
|
||||||
#COPY config-heat.sh /opt/heat/config-heat.sh
|
|
||||||
|
65
docker/heat/heat-base/config-heat.sh
Executable file
65
docker/heat/heat-base/config-heat.sh
Executable file
@ -0,0 +1,65 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
. /opt/kolla/kolla-common.sh
|
||||||
|
|
||||||
|
: ${ADMIN_TENANT_NAME:=admin}
|
||||||
|
: ${HEAT_DB_NAME:=heat}
|
||||||
|
: ${HEAT_DB_USER:=heat}
|
||||||
|
: ${HEAT_KEYSTONE_USER:=heat}
|
||||||
|
: ${KEYSTONE_AUTH_PROTOCOL:=http}
|
||||||
|
: ${PUBLIC_IP:=$HEAT_API_PORT_8004_TCP_ADDR}
|
||||||
|
: ${RABBIT_USER:=guest}
|
||||||
|
: ${RABBIT_PASSWORD:=guest}
|
||||||
|
|
||||||
|
check_required_vars HEAT_DB_PASSWORD HEAT_KEYSTONE_PASSWORD
|
||||||
|
dump_vars
|
||||||
|
|
||||||
|
cat > /openrc <<EOF
|
||||||
|
export OS_AUTH_URL="http://${KEYSTONE_PUBLIC_SERVICE_HOST}:5000/v2.0"
|
||||||
|
export OS_USERNAME="${HEAT_KEYSTONE_USER}"
|
||||||
|
export OS_PASSWORD="${HEAT_KEYSTONE_PASSWORD}"
|
||||||
|
export OS_TENANT_NAME="${ADMIN_TENANT_NAME}"
|
||||||
|
EOF
|
||||||
|
|
||||||
|
crudini --set /etc/heat/heat.conf DEFAULT log_file \
|
||||||
|
""
|
||||||
|
crudini --set /etc/heat/heat.conf DEFAULT use_stderr \
|
||||||
|
true
|
||||||
|
crudini --set /etc/heat/heat.conf DEFAULT rpc_backend \
|
||||||
|
heat.openstack.common.rpc.impl_kombu
|
||||||
|
crudini --set /etc/heat/heat.conf DEFAULT rabbit_host \
|
||||||
|
${RABBITMQ_SERVICE_HOST}
|
||||||
|
crudini --set /etc/heat/heat.conf DEFAULT rabbit_userid \
|
||||||
|
${RABBIT_USER}
|
||||||
|
crudini --set /etc/heat/heat.conf DEFAULT rabbit_password \
|
||||||
|
${RABBIT_PASSWORD}
|
||||||
|
|
||||||
|
crudini --set /etc/heat/heat.conf database connection \
|
||||||
|
mysql://${HEAT_DB_USER}:${HEAT_DB_PASSWORD}@${MARIADB_SERVICE_HOST}/${HEAT_DB_NAME}
|
||||||
|
|
||||||
|
crudini --set /etc/heat/heat.conf keystone_authtoken auth_protocol \
|
||||||
|
"${KEYSTONE_AUTH_PROTOCOL}"
|
||||||
|
crudini --set /etc/heat/heat.conf keystone_authtoken auth_host \
|
||||||
|
"${KEYSTONE_PUBLIC_SERVICE_HOST}"
|
||||||
|
crudini --set /etc/heat/heat.conf keystone_authtoken auth_port \
|
||||||
|
5000
|
||||||
|
crudini --set /etc/heat/heat.conf keystone_authtoken auth_uri \
|
||||||
|
"${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_PUBLIC_SERVICE_HOST}:5000/v2.0"
|
||||||
|
crudini --set /etc/heat/heat.conf keystone_authtoken admin_tenant_name \
|
||||||
|
"${ADMIN_TENANT_NAME}"
|
||||||
|
crudini --set /etc/heat/heat.conf keystone_authtoken admin_user \
|
||||||
|
"${HEAT_KEYSTONE_USER}"
|
||||||
|
crudini --set /etc/heat/heat.conf keystone_authtoken admin_password \
|
||||||
|
"${HEAT_KEYSTONE_PASSWORD}"
|
||||||
|
|
||||||
|
crudini --set /etc/heat/heat.conf ec2authtoken auth_uri \
|
||||||
|
"${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_PUBLIC_SERVICE_HOST}:5000/v2.0"
|
||||||
|
|
||||||
|
# cfn
|
||||||
|
#crudini --set /etc/heat/heat.conf DEFAULT heat_metadata_server_url \
|
||||||
|
# http://${HEAT_CFN_API_SERVICE_HOST}:8000
|
||||||
|
#crudini --set /etc/heat/heat.conf DEFAULT heat_waitcondition_server_url \
|
||||||
|
# http://${HEAT_CFN_API_SERVICE_HOST}:8000/v1/waitcondition
|
||||||
|
|
@ -1,6 +1,9 @@
|
|||||||
FROM fedora-rdo-base
|
FROM kollaglue/fedora-rdo-heat-base
|
||||||
MAINTAINER Steven Dake <sdake@redhat.com>
|
MAINTAINER Jeff Peeler <jpeeler@redhat.com>
|
||||||
|
|
||||||
|
RUN yum -y install \
|
||||||
|
openstack-heat-engine \
|
||||||
|
; yum clean all
|
||||||
|
|
||||||
ADD ./start.sh /start.sh
|
ADD ./start.sh /start.sh
|
||||||
CMD ["/start.sh"]
|
CMD ["/start.sh"]
|
||||||
|
|
||||||
|
42
docker/heat/heat-engine/start.sh
Normal file → Executable file
42
docker/heat/heat-engine/start.sh
Normal file → Executable file
@ -1,40 +1,18 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
: ${GLANCE_DB_USER:=heat}
|
. /opt/kolla/kolla-common.sh
|
||||||
: ${GLANCE_DB_NAME:=heat}
|
. /opt/kolla/config-heat.sh
|
||||||
: ${KEYSTONE_AUTH_PROTOCOL:=http}
|
|
||||||
: ${GLANCE_KEYSTONE_USER:=heat}
|
|
||||||
: ${ADMIN_TENANT_NAME:=admin}
|
|
||||||
|
|
||||||
if ! [ "$KEYSTONE_ADMIN_TOKEN" ]; then
|
check_required_vars MARIADB_SERVICE_HOST DB_ROOT_PASSWORD \
|
||||||
echo "*** Missing KEYSTONE_ADMIN_TOKEN" >&2
|
HEAT_DB_NAME HEAT_DB_USER HEAT_DB_PASSWORD
|
||||||
exit 1
|
check_for_db
|
||||||
fi
|
|
||||||
|
|
||||||
if ! [ "$DB_ROOT_PASSWORD" ]; then
|
mysql -h ${MARIADB_SERVICE_HOST} -u root -p${DB_ROOT_PASSWORD} mysql <<EOF
|
||||||
echo "*** Missing DB_ROOT_PASSWORD" >&2
|
CREATE DATABASE IF NOT EXISTS ${HEAT_DB_NAME} DEFAULT CHARACTER SET utf8;
|
||||||
exit 1
|
GRANT ALL PRIVILEGES ON ${HEAT_DB_NAME}.* TO
|
||||||
fi
|
'${HEAT_DB_USER}'@'%' IDENTIFIED BY '${HEAT_DB_PASSWORD}'
|
||||||
|
|
||||||
if ! [ "$GLANCE_DB_PASSWORD" ]; then
|
|
||||||
GLANCE_DB_PASSWORD=$(openssl rand -hex 15)
|
|
||||||
export GLANCE_DB_PASSWORD
|
|
||||||
fi
|
|
||||||
|
|
||||||
sh /opt/heat/config-heat.sh engine
|
|
||||||
|
|
||||||
mysql -h ${MARIADB_PORT_3306_TCP_ADDR} -u root \
|
|
||||||
-p${DB_ROOT_PASSWORD} mysql <<EOF
|
|
||||||
CREATE DATABASE IF NOT EXISTS ${GLANCE_DB_NAME};
|
|
||||||
GRANT ALL PRIVILEGES ON heat* TO
|
|
||||||
'${GLANCE_DB_USER}'@'%' IDENTIFIED BY '${GLANCE_DB_PASSWORD}'
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}"
|
/usr/bin/heat-manage db_sync
|
||||||
export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_PORT_35357_TCP_ADDR}:35357/v2.0"
|
|
||||||
|
|
||||||
/bin/keystone user-create --name ${GLANCE_KEYSTONE_USER} --pass ${GLANCE_ADMIN_PASSWORD}
|
|
||||||
/bin/keystone role-create --name ${GLANCE_KEYSTONE_USER}
|
|
||||||
/bin/keystone user-role-add --user ${GLANCE_KEYSTONE_USER} --role admin --tenant ${ADMIN_TENANT_NAME}
|
|
||||||
|
|
||||||
exec /usr/bin/heat-engine
|
exec /usr/bin/heat-engine
|
||||||
|
@ -5,26 +5,26 @@ desiredState:
|
|||||||
- name: DB_ROOT_PASSWORD
|
- name: DB_ROOT_PASSWORD
|
||||||
value: password
|
value: password
|
||||||
- name: HEAT_DB_PASSWORD
|
- name: HEAT_DB_PASSWORD
|
||||||
value: heatdbpassword
|
value: password
|
||||||
- name: KEYSTONE_ADMIN_TOKEN
|
- name: HEAT_KEYSTONE_PASSWORD
|
||||||
value: ADMINTOKEN
|
value: password
|
||||||
image: fedora-rdo-heat-engine
|
image: kollaglue/fedora-rdo-heat-engine
|
||||||
name: heat-engine
|
name: heat-engine
|
||||||
ports:
|
|
||||||
- containerPort: 9292
|
|
||||||
- env:
|
- env:
|
||||||
- name: DB_ROOT_PASSWORD
|
- name: DB_ROOT_PASSWORD
|
||||||
value: password
|
value: password
|
||||||
- name: HEAT_DB_PASSWORD
|
- name: HEAT_DB_PASSWORD
|
||||||
value: heatdbpassword
|
value: password
|
||||||
|
- name: HEAT_KEYSTONE_PASSWORD
|
||||||
|
value: password
|
||||||
- name: KEYSTONE_ADMIN_TOKEN
|
- name: KEYSTONE_ADMIN_TOKEN
|
||||||
value: ADMINTOKEN
|
value: ADMINTOKEN
|
||||||
image: fedora-rdo-heat-api
|
image: kollaglue/fedora-rdo-heat-api
|
||||||
name: heat-api
|
name: heat-api
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 9292
|
- containerPort: 8004
|
||||||
id: heat-1
|
id: heat-1
|
||||||
version: v1beta1
|
version: v1beta1
|
||||||
id: heat
|
id: heat
|
||||||
labels:
|
labels:
|
||||||
name: keystone-master
|
name: heat
|
||||||
|
7
k8s/service/heat-api-service.yaml
Normal file
7
k8s/service/heat-api-service.yaml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: v1beta1
|
||||||
|
containerPort: 8004
|
||||||
|
id: heat-api
|
||||||
|
kind: Service
|
||||||
|
port: 8004
|
||||||
|
selector:
|
||||||
|
name: heat
|
Loading…
Reference in New Issue
Block a user