Implement zaqar container
The current implementation has been configured to use sqlite instead of mongodb, since that container service is not yet available. Also, there are no Icehouse RPMs available, so the Juno RPMs are fetched and manually installed. Implements: blueprint kube-zaqar-container Change-Id: Ie875ab43ad3db92ae2712492ee151fbad0fec3cc
This commit is contained in:
parent
b57caa7b67
commit
24dca1e124
17
docker/zaqar/Dockerfile
Normal file
17
docker/zaqar/Dockerfile
Normal file
@ -0,0 +1,17 @@
|
||||
FROM kollaglue/fedora-rdo-base
|
||||
MAINTAINER Kolla Project (https://launchpad.net/kolla)
|
||||
|
||||
RUN curl -O https://repos.fedorapeople.org/repos/openstack/openstack-juno/fedora-21/openstack-zaqar-2014.2-1.fc22.noarch.rpm
|
||||
RUN curl -O https://repos.fedorapeople.org/repos/openstack/openstack-juno/fedora-21/python-oslo-utils-0.3.0-1.fc22.noarch.rpm
|
||||
RUN curl -O https://repos.fedorapeople.org/repos/openstack/openstack-juno/fedora-21/python-keystonemiddleware-1.2.0-1.fc22.noarch.rpm
|
||||
RUN yum -y localinstall python-oslo-utils-0.3.0-1.fc22.noarch.rpm \
|
||||
python-keystonemiddleware-1.2.0-1.fc22.noarch.rpm \
|
||||
openstack-zaqar-2014.2-1.fc22.noarch.rpm \
|
||||
; yum clean all
|
||||
|
||||
EXPOSE 8888
|
||||
|
||||
ADD ./start.sh /start.sh
|
||||
ADD ./check.sh /check.sh
|
||||
|
||||
CMD ["/start.sh"]
|
1
docker/zaqar/build
Symbolic link
1
docker/zaqar/build
Symbolic link
@ -0,0 +1 @@
|
||||
../../tools/build-docker-image
|
10
docker/zaqar/check.sh
Executable file
10
docker/zaqar/check.sh
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
status=$(curl -s -w "%{http_code}" -o /dev/null http://localhost:8888/v1/queues)
|
||||
|
||||
if [[ $status -ne 200 && $status -ne 204 ]]; then
|
||||
echo "ERROR($status): queue list failed"
|
||||
exit $status
|
||||
fi
|
||||
|
||||
exit 0
|
68
docker/zaqar/start.sh
Executable file
68
docker/zaqar/start.sh
Executable file
@ -0,0 +1,68 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
. /opt/kolla/kolla-common.sh
|
||||
|
||||
: ${ADMIN_TENANT_NAME:=admin}
|
||||
|
||||
: ${ZAQAR_DB_NAME:=zaqar}
|
||||
: ${ZAQAR_DB_USER:=zaqar}
|
||||
|
||||
: ${ZAQAR_KEYSTONE_USER:=zaqar}
|
||||
|
||||
: ${KEYSTONE_AUTH_PROTOCOL:=http}
|
||||
|
||||
check_required_vars ZAQAR_DB_PASSWORD ZAQAR_KEYSTONE_PASSWORD \
|
||||
KEYSTONE_ADMIN_TOKEN
|
||||
dump_vars
|
||||
|
||||
#check_for_mongodb
|
||||
check_for_keystone
|
||||
|
||||
cat > /openrc <<EOF
|
||||
export OS_AUTH_URL="http://${KEYSTONE_PUBLIC_SERVICE_HOST}:5000/v2.0"
|
||||
export OS_USERNAME="${ZAQAR_KEYSTONE_USER}"
|
||||
export OS_PASSWORD="${ZAQAR_KEYSTONE_PASSWORD}"
|
||||
export OS_TENANT_NAME="${ADMIN_TENANT_NAME}"
|
||||
EOF
|
||||
|
||||
cfg=/etc/zaqar/zaqar.conf
|
||||
|
||||
crudini --set $cfg DEFAULT log_file \
|
||||
""
|
||||
crudini --set $cfg DEFAULT use_stderr \
|
||||
true
|
||||
|
||||
crudini --set $cfg drivers storage \
|
||||
sqlite
|
||||
|
||||
crudini --set $cfg keystone_authtoken admin_password \
|
||||
"${ZAQAR_KEYSTONE_PASSWORD}"
|
||||
crudini --set $cfg keystone_authtoken admin_user \
|
||||
"${ZAQAR_KEYSTONE_USER}"
|
||||
crudini --set $cfg keystone_authtoken admin_tenant_name \
|
||||
"${ADMIN_TENANT_NAME}"
|
||||
crudini --set $cfg keystone_authtoken auth_uri \
|
||||
"${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_PUBLIC_SERVICE_HOST}:5000/v2.0"
|
||||
crudini --set $cfg keystone_authtoken auth_protocol \
|
||||
"${KEYSTONE_AUTH_PROTOCOL}"
|
||||
crudini --set $cfg keystone_authtoken auth_host \
|
||||
"${KEYSTONE_PUBLIC_SERVICE_HOST}"
|
||||
crudini --set $cfg keystone_authtoken auth_port \
|
||||
5000
|
||||
|
||||
|
||||
export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}"
|
||||
export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_SERVICE_HOST}:35357/v2.0"
|
||||
crux user-create -n ${ZAQAR_KEYSTONE_USER} \
|
||||
-p ${ZAQAR_KEYSTONE_PASSWORD} \
|
||||
-t ${ADMIN_TENANT_NAME} \
|
||||
-r admin
|
||||
|
||||
crux endpoint-create --remove-all -n ${ZAQAR_KEYSTONE_USER} -t messaging \
|
||||
-I "${KEYSTONE_AUTH_PROTOCOL}://${ZAQAR_SERVER_SERVICE_HOST}:8888" \
|
||||
-P "${KEYSTONE_AUTH_PROTOCOL}://${PUBLIC_IP}:8888" \
|
||||
-A "${KEYSTONE_AUTH_PROTOCOL}://${ZAQAR_SERVER_SERVICE_HOST}:8888"
|
||||
|
||||
exec /usr/bin/zaqar-server
|
19
k8s/pod/zaqar-pod.yaml
Normal file
19
k8s/pod/zaqar-pod.yaml
Normal file
@ -0,0 +1,19 @@
|
||||
desiredState:
|
||||
manifest:
|
||||
containers:
|
||||
- env:
|
||||
- name: ZAQAR_DB_PASSWORD
|
||||
value: password
|
||||
- name: ZAQAR_KEYSTONE_PASSWORD
|
||||
value: password
|
||||
- name: KEYSTONE_ADMIN_TOKEN
|
||||
value: ADMINTOKEN
|
||||
image: kollaglue/fedora-rdo-zaqar
|
||||
name: zaqar-server
|
||||
ports:
|
||||
- containerPort: 8004
|
||||
id: zaqar-1
|
||||
version: v1beta1
|
||||
id: zaqar
|
||||
labels:
|
||||
name: zaqar
|
7
k8s/service/zaqar-server-service.yaml
Normal file
7
k8s/service/zaqar-server-service.yaml
Normal file
@ -0,0 +1,7 @@
|
||||
apiVersion: v1beta1
|
||||
containerPort: 8888
|
||||
id: zaqar-server
|
||||
kind: Service
|
||||
port: 8888
|
||||
selector:
|
||||
name: zaqar
|
@ -11,6 +11,7 @@ nova-controller
|
||||
neutron-controller
|
||||
heat
|
||||
ceilometer-controller
|
||||
zaqar
|
||||
'
|
||||
|
||||
for pod in $pods; do
|
||||
|
@ -16,6 +16,7 @@ nova-metadata-api
|
||||
rabbitmq
|
||||
neutron-server
|
||||
heat-api
|
||||
zaqar-server
|
||||
'
|
||||
|
||||
for svc in $services; do
|
||||
|
Loading…
Reference in New Issue
Block a user