aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Peeler <jpeeler@redhat.com>2014-11-19 12:21:30 -0500
committerJeff Peeler <jpeeler@redhat.com>2014-11-19 17:03:16 -0500
commit24dca1e12485ad9ed28a90d1fb878505d920732f (patch)
tree50855211505c47399b27303deaa983810184e030
parentb57caa7b67ed1747c7046afa41d1cbbee5802b69 (diff)
downloadkolla-24dca1e12485ad9ed28a90d1fb878505d920732f.tar.gz
kolla-24dca1e12485ad9ed28a90d1fb878505d920732f.zip
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
-rw-r--r--docker/zaqar/Dockerfile17
l---------docker/zaqar/build1
-rwxr-xr-xdocker/zaqar/check.sh10
-rwxr-xr-xdocker/zaqar/start.sh68
-rw-r--r--k8s/pod/zaqar-pod.yaml19
-rw-r--r--k8s/service/zaqar-server-service.yaml7
-rwxr-xr-xtools/start-all-pods1
-rwxr-xr-xtools/start-all-services1
8 files changed, 124 insertions, 0 deletions
diff --git a/docker/zaqar/Dockerfile b/docker/zaqar/Dockerfile
new file mode 100644
index 000000000..fa37fa07b
--- /dev/null
+++ b/docker/zaqar/Dockerfile
@@ -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"]
diff --git a/docker/zaqar/build b/docker/zaqar/build
new file mode 120000
index 000000000..d2accf7d3
--- /dev/null
+++ b/docker/zaqar/build
@@ -0,0 +1 @@
+../../tools/build-docker-image \ No newline at end of file
diff --git a/docker/zaqar/check.sh b/docker/zaqar/check.sh
new file mode 100755
index 000000000..4b3cdbb46
--- /dev/null
+++ b/docker/zaqar/check.sh
@@ -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
diff --git a/docker/zaqar/start.sh b/docker/zaqar/start.sh
new file mode 100755
index 000000000..7ed89a40a
--- /dev/null
+++ b/docker/zaqar/start.sh
@@ -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
diff --git a/k8s/pod/zaqar-pod.yaml b/k8s/pod/zaqar-pod.yaml
new file mode 100644
index 000000000..b2564d52d
--- /dev/null
+++ b/k8s/pod/zaqar-pod.yaml
@@ -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
diff --git a/k8s/service/zaqar-server-service.yaml b/k8s/service/zaqar-server-service.yaml
new file mode 100644
index 000000000..bbb351f22
--- /dev/null
+++ b/k8s/service/zaqar-server-service.yaml
@@ -0,0 +1,7 @@
+apiVersion: v1beta1
+containerPort: 8888
+id: zaqar-server
+kind: Service
+port: 8888
+selector:
+ name: zaqar
diff --git a/tools/start-all-pods b/tools/start-all-pods
index e2ee16c53..3659bd37c 100755
--- a/tools/start-all-pods
+++ b/tools/start-all-pods
@@ -11,6 +11,7 @@ nova-controller
neutron-controller
heat
ceilometer-controller
+zaqar
'
for pod in $pods; do
diff --git a/tools/start-all-services b/tools/start-all-services
index 51520ec66..e20ba92a9 100755
--- a/tools/start-all-services
+++ b/tools/start-all-services
@@ -16,6 +16,7 @@ nova-metadata-api
rabbitmq
neutron-server
heat-api
+zaqar-server
'
for svc in $services; do