Add Gnocchi service to kolla
Co-Authored-By: Swapnil Kulkarni <me@coolsvap.net" Change-Id: I81e5e6bfde3323e6917e3d61e3db760e2fec2019 Implements: blueprint gnocchi-containers
This commit is contained in:
parent
6d4a55060e
commit
870ec615d6
@ -46,6 +46,7 @@ services:
|
|||||||
* Horizon
|
* Horizon
|
||||||
* Zaqar
|
* Zaqar
|
||||||
* Magnum
|
* Magnum
|
||||||
|
* Gnocchi
|
||||||
|
|
||||||
```
|
```
|
||||||
$ sudo docker search kollaglue
|
$ sudo docker search kollaglue
|
||||||
|
15
compose/gnocchi.yml
Normal file
15
compose/gnocchi.yml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
gnocchiapi:
|
||||||
|
image: kollaglue/centos-rdo-gnocchi-api:latest
|
||||||
|
name: gnocchiapi
|
||||||
|
restart: always
|
||||||
|
env_file:
|
||||||
|
- openstack.env
|
||||||
|
net: "host"
|
||||||
|
|
||||||
|
gnocchistatsd:
|
||||||
|
image: kollaglue/centos-rdo-gnocchi-statsd:latest
|
||||||
|
name: gnocchistatsd
|
||||||
|
restart: always
|
||||||
|
env_file:
|
||||||
|
- openstack.env
|
||||||
|
net: "host"
|
10
docker/centos/binary/gnocchi/gnocchi-api/Dockerfile
Normal file
10
docker/centos/binary/gnocchi/gnocchi-api/Dockerfile
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%gnocchi-base:%%KOLLA_TAG%%
|
||||||
|
MAINTAINER Kolla Project (https://launchpad.net/kolla)
|
||||||
|
|
||||||
|
RUN yum install -y openstack-gnocchi-api \
|
||||||
|
openstack-gnocchi-carbonara \
|
||||||
|
openstack-gnocchi-indexer-sqlalchemy \
|
||||||
|
&& yum clean all
|
||||||
|
|
||||||
|
COPY ./start.sh /start.sh
|
||||||
|
CMD ["/start.sh"]
|
1
docker/centos/binary/gnocchi/gnocchi-api/build
Symbolic link
1
docker/centos/binary/gnocchi/gnocchi-api/build
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../../../../tools/build-docker-image
|
1
docker/centos/binary/gnocchi/gnocchi-api/config-external.sh
Symbolic link
1
docker/centos/binary/gnocchi/gnocchi-api/config-external.sh
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../../../common/gnocchi/gnocchi-api/config-external.sh
|
1
docker/centos/binary/gnocchi/gnocchi-api/config-internal.sh
Symbolic link
1
docker/centos/binary/gnocchi/gnocchi-api/config-internal.sh
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../../../common/gnocchi/gnocchi-api/config-internal.sh
|
1
docker/centos/binary/gnocchi/gnocchi-api/start.sh
Symbolic link
1
docker/centos/binary/gnocchi/gnocchi-api/start.sh
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../../../common/gnocchi/gnocchi-api/start.sh
|
4
docker/centos/binary/gnocchi/gnocchi-base/Dockerfile
Normal file
4
docker/centos/binary/gnocchi/gnocchi-base/Dockerfile
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%base:%%KOLLA_TAG%%
|
||||||
|
MAINTAINER Kolla Project (https://launchpad.net/kolla)
|
||||||
|
|
||||||
|
COPY config-gnocchi.sh /opt/kolla/config-gnocchi.sh
|
1
docker/centos/binary/gnocchi/gnocchi-base/build
Symbolic link
1
docker/centos/binary/gnocchi/gnocchi-base/build
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../../../../tools/build-docker-image
|
1
docker/centos/binary/gnocchi/gnocchi-base/config-gnocchi.sh
Symbolic link
1
docker/centos/binary/gnocchi/gnocchi-base/config-gnocchi.sh
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../../../common/gnocchi/gnocchi-base/config-gnocchi.sh
|
7
docker/centos/binary/gnocchi/gnocchi-statsd/Dockerfile
Normal file
7
docker/centos/binary/gnocchi/gnocchi-statsd/Dockerfile
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%gnocchi-base:%%KOLLA_TAG%%
|
||||||
|
MAINTAINER Kolla Project (https://launchpad.net/kolla)
|
||||||
|
|
||||||
|
RUN yum install -y openstack-gnocchi-statsd && yum clean all
|
||||||
|
|
||||||
|
COPY ./start.sh /start.sh
|
||||||
|
CMD ["/start.sh"]
|
1
docker/centos/binary/gnocchi/gnocchi-statsd/build
Symbolic link
1
docker/centos/binary/gnocchi/gnocchi-statsd/build
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../../../../tools/build-docker-image
|
1
docker/centos/binary/gnocchi/gnocchi-statsd/config-external.sh
Symbolic link
1
docker/centos/binary/gnocchi/gnocchi-statsd/config-external.sh
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../../../common/gnocchi/gnocchi-statsd/config-external.sh
|
1
docker/centos/binary/gnocchi/gnocchi-statsd/config-internal.sh
Symbolic link
1
docker/centos/binary/gnocchi/gnocchi-statsd/config-internal.sh
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../../../common/gnocchi/gnocchi-statsd/config-internal.sh
|
1
docker/centos/binary/gnocchi/gnocchi-statsd/start.sh
Symbolic link
1
docker/centos/binary/gnocchi/gnocchi-statsd/start.sh
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../../../common/gnocchi/gnocchi-statsd/start.sh
|
10
docker/common/gnocchi/gnocchi-api/config-external.sh
Executable file
10
docker/common/gnocchi/gnocchi-api/config-external.sh
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
SOURCE="/opt/kolla/gnocchi-api/gnocchi-api.conf"
|
||||||
|
TARGET="/etc/gnocchi/gnocchi-api.conf"
|
||||||
|
OWNER="gnocchi"
|
||||||
|
|
||||||
|
if [[ -f "$SOURCE" ]]; then
|
||||||
|
cp $SOURCE $TARGET
|
||||||
|
chown ${OWNER}: $TARGET
|
||||||
|
chmod 0644 $TARGET
|
||||||
|
fi
|
52
docker/common/gnocchi/gnocchi-api/config-internal.sh
Executable file
52
docker/common/gnocchi/gnocchi-api/config-internal.sh
Executable file
@ -0,0 +1,52 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
. /opt/kolla/kolla-common.sh
|
||||||
|
. /opt/kolla/config-gnocchi.sh
|
||||||
|
|
||||||
|
check_required_vars KEYSTONE_ADMIN_TOKEN \
|
||||||
|
KEYSTONE_AUTH_PROTOCOL \
|
||||||
|
KEYSTONE_ADMIN_SERVICE_HOST \
|
||||||
|
KEYSTONE_ADMIN_SERVICE_PORT \
|
||||||
|
ADMIN_TENANT_NAME \
|
||||||
|
GNOCCHI_DB_NAME \
|
||||||
|
GNOCCHI_DB_USER \
|
||||||
|
GNOCCHI_DB_PASSWORD \
|
||||||
|
GNOCCHI_SERVICE_PROTOCOL \
|
||||||
|
GNOCCHI_SERVICE_PORT \
|
||||||
|
GNOCCHI_ARCHIVE_POLICY \
|
||||||
|
GNOCCHI_STORAGE_BACKEND \
|
||||||
|
GNOCCHI_KEYSTONE_USER \
|
||||||
|
GNOCCHI_ADMIN_PASSWORD \
|
||||||
|
GNOCCHI_API_SERVICE_HOST
|
||||||
|
|
||||||
|
fail_unless_os_service_running keystone
|
||||||
|
fail_unless_db
|
||||||
|
|
||||||
|
mysql -h ${MARIADB_SERVICE_HOST} -u root -p${DB_ROOT_PASSWORD} mysql <<EOF
|
||||||
|
CREATE DATABASE IF NOT EXISTS ${GNOCCHI_DB_NAME} DEFAULT CHARACTER SET utf8;
|
||||||
|
GRANT ALL PRIVILEGES ON ${GNOCCHI_DB_NAME}.* TO
|
||||||
|
'${GNOCCHI_DB_USER}'@'%' IDENTIFIED BY '${GNOCCHI_DB_PASSWORD}'
|
||||||
|
|
||||||
|
EOF
|
||||||
|
|
||||||
|
|
||||||
|
export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}"
|
||||||
|
export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_SERVICE_HOST}:${KEYSTONE_ADMIN_SERVICE_PORT}/v2.0"
|
||||||
|
|
||||||
|
|
||||||
|
crux user-create -n ${GNOCCHI_KEYSTONE_USER} \
|
||||||
|
-p ${GNOCCHI_ADMIN_PASSWORD} \
|
||||||
|
-t ${ADMIN_TENANT_NAME} \
|
||||||
|
-r service
|
||||||
|
|
||||||
|
crux service-create -n ${GNOCCHI_KEYSTONE_USER} -t "metric" \
|
||||||
|
-d "OpenStack Metric Service"
|
||||||
|
|
||||||
|
crux endpoint-create i--remove-all -n ${GNOCCHI_KEYSTONE_USER} -t metric \
|
||||||
|
-I "${GNOCCHI_SERVICE_PROTOCOL}://${GNOCCHI_API_SERVICE_HOST}:${GNOCCHI_SERVICE_PORT}" \
|
||||||
|
-P "${GNOCCHI_SERVICE_PROTOCOL}://${GNOCCHI_API_SERVICE_HOST}:${GNOCCHI_SERVICE_PORT}" \
|
||||||
|
-A "${GNOCCHI_SERVICE_PROTOCOL}://${GNOCCHI_API_SERVICE_HOST}:${GNOCCHI_SERVICE_PORT}"
|
||||||
|
|
||||||
|
exec /usr/bin/gnocchi-api
|
21
docker/common/gnocchi/gnocchi-api/start.sh
Executable file
21
docker/common/gnocchi/gnocchi-api/start.sh
Executable file
@ -0,0 +1,21 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -o errexit
|
||||||
|
|
||||||
|
CMD="/usr/bin/gnocchi-api"
|
||||||
|
ARGS=""
|
||||||
|
|
||||||
|
# Loading common functions.
|
||||||
|
source /opt/kolla/kolla-common.sh
|
||||||
|
|
||||||
|
# Config-internal script exec out of this function, it does not return here.
|
||||||
|
set_configs
|
||||||
|
|
||||||
|
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
|
||||||
|
# of the KOLLA_BOOTSTRAP variable being set, including empty.
|
||||||
|
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
|
||||||
|
su -s /bin/sh -c "gnocchi-manage db_sync" gnocchi
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec $CMD $ARGS
|
||||||
|
|
23
docker/common/gnocchi/gnocchi-base/config-gnocchi.sh
Executable file
23
docker/common/gnocchi/gnocchi-base/config-gnocchi.sh
Executable file
@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
. /opt/kolla/kolla-common.sh
|
||||||
|
|
||||||
|
check_required_vars KEYSTONE_ADMIN_TOKEN KEYSTONE_ADMIN_SERVICE_HOST \
|
||||||
|
KEYSTONE_ADMIN_SERVICE_PORT KEYSTONE_PUBLIC_SERVICE_HOST \
|
||||||
|
GNOCCHI_STORAGE_BACKEND GNOCCHI_DATA_DIR GNOCCHI_SERVICE_PORT
|
||||||
|
dump_vars
|
||||||
|
|
||||||
|
cat > /openrc <<EOF
|
||||||
|
export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}"
|
||||||
|
export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_SERVICE_HOST}:${KEYSTONE_ADMIN_SERVICE_PORT}/v2.0"
|
||||||
|
EOF
|
||||||
|
|
||||||
|
|
||||||
|
cfg=/etc/gnocchi/gnocchi.conf
|
||||||
|
crudini --set $cfg \
|
||||||
|
storage driver "$GNOCCHI_STORAGE_BACKEND"
|
||||||
|
crudini --set $cfg \
|
||||||
|
storage file_basepath "$GNOCCHI_DATA_DIR"
|
||||||
|
crudini --set $cfg \
|
||||||
|
indexer url "mysql://$GNOCCHI_DB_USER:$GNOCCHI_DB_PASSWORD@$MARIADB_SERVICE_HOST/$GNOCCHI_DB_NAME?charset=utf8"
|
10
docker/common/gnocchi/gnocchi-statsd/config-external.sh
Executable file
10
docker/common/gnocchi/gnocchi-statsd/config-external.sh
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
SOURCE="/opt/kolla/gnocchi-api/gnocchi-api.conf"
|
||||||
|
TARGET="/etc/gnocchi/gnocchi-api.conf"
|
||||||
|
OWNER="gnocchi"
|
||||||
|
|
||||||
|
if [[ -f "$SOURCE" ]]; then
|
||||||
|
cp $SOURCE $TARGET
|
||||||
|
chown ${OWNER}: $TARGET
|
||||||
|
chmod 0644 $TARGET
|
||||||
|
fi
|
8
docker/common/gnocchi/gnocchi-statsd/config-internal.sh
Executable file
8
docker/common/gnocchi/gnocchi-statsd/config-internal.sh
Executable file
@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
. /opt/kolla/kolla-common.sh
|
||||||
|
. /opt/kolla/config-gnocchi.sh
|
||||||
|
|
||||||
|
exec /usr/bin/gnocchi-statsd
|
14
docker/common/gnocchi/gnocchi-statsd/start.sh
Executable file
14
docker/common/gnocchi/gnocchi-statsd/start.sh
Executable file
@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -o errexit
|
||||||
|
|
||||||
|
CMD="/usr/bin/gnocchi-statsd"
|
||||||
|
ARGS=""
|
||||||
|
|
||||||
|
# Loading common functions.
|
||||||
|
source /opt/kolla/kolla-common.sh
|
||||||
|
|
||||||
|
# Config-internal script exec out of this function, it does not return here.
|
||||||
|
set_configs
|
||||||
|
|
||||||
|
exec $CMD $ARGS
|
||||||
|
|
@ -68,6 +68,12 @@ all containers. This allows a simple method of ensuring every type of node
|
|||||||
GLANCE_KEYSTONE_PASSWORD=<password> - Keystone DB password
|
GLANCE_KEYSTONE_PASSWORD=<password> - Keystone DB password
|
||||||
GLANCE_KEYSTONE_USER=<keystone> - Glance Keystone User
|
GLANCE_KEYSTONE_USER=<keystone> - Glance Keystone User
|
||||||
GLANCE_REGISTRY_SERVICE_HOST=<glance IP> Glance registry service host
|
GLANCE_REGISTRY_SERVICE_HOST=<glance IP> Glance registry service host
|
||||||
|
GNOCCHI_ADMIN_PASSWORD=<password> - admin password for gnocchi user
|
||||||
|
GNOCCHI_API_SERVICE_HOST=<IP> - address where gnocchi API is running
|
||||||
|
GNOCCHI_KEYSTONE_PASSWORD=<gnocchi> - Gnocchi keystone password
|
||||||
|
GNOCCHI_KEYSTONE_USER=<gnocchi> - Gnocchi Keystone User
|
||||||
|
GNOCCHI_SERVICE_PORT=<8041> - Port where gnocchi operates
|
||||||
|
GNOCCHI_STORAGE_BACKEND=<file> - Storage backend for gnocchi
|
||||||
KEYSTONE_ADMIN_PASSWORD=<password>
|
KEYSTONE_ADMIN_PASSWORD=<password>
|
||||||
KEYSTONE_ADMIN_SERVICE_HOST=<IP> - IP Address of Keystone Host
|
KEYSTONE_ADMIN_SERVICE_HOST=<IP> - IP Address of Keystone Host
|
||||||
KEYSTONE_ADMIN_SERVICE_PORT=<35357> - Port where Keystone admin endpoint operates.
|
KEYSTONE_ADMIN_SERVICE_PORT=<35357> - Port where Keystone admin endpoint operates.
|
||||||
|
@ -229,6 +229,38 @@ In order for each service to function, there is a minimum set of required variab
|
|||||||
GLANCE_DB_USER
|
GLANCE_DB_USER
|
||||||
MARIADB_SERVICE_HOST
|
MARIADB_SERVICE_HOST
|
||||||
|
|
||||||
|
# Gnocchi-api
|
||||||
|
|
||||||
|
ADMIN_TENANT_NAME
|
||||||
|
GNOCCHI_ADMIN_PASSWORD
|
||||||
|
GNOCCHI_API_SERVICE_HOST
|
||||||
|
GNOCCHI_ARCHIVE_POLICY
|
||||||
|
GNOCCHI_DB_NAME
|
||||||
|
GNOCCHI_DB_PASSWORD
|
||||||
|
GNOCCHI_DB_USER
|
||||||
|
GNOCCHI_KEYSTONE_USER
|
||||||
|
GNOCCHI_SERVICE_PORT
|
||||||
|
GNOCCHI_SERVICE_PROTOCOL
|
||||||
|
GNOCCHI_STORAGE_BACKEND
|
||||||
|
KEYSTONE_ADMIN_SERVICE_HOST
|
||||||
|
KEYSTONE_ADMIN_SERVICE_PORT
|
||||||
|
KEYSTONE_ADMIN_TOKEN
|
||||||
|
KEYSTONE_AUTH_PROTOCOL
|
||||||
|
|
||||||
|
# Gnocchi-base
|
||||||
|
|
||||||
|
GNOCCHI_DATA_DIR
|
||||||
|
GNOCCHI_SERVICE_PORT
|
||||||
|
GNOCCHI_STORAGE_BACKEND
|
||||||
|
KEYSTONE_ADMIN_SERVICE_HOST
|
||||||
|
KEYSTONE_ADMIN_SERVICE_PORT
|
||||||
|
KEYSTONE_ADMIN_TOKEN
|
||||||
|
KEYSTONE_PUBLIC_SERVICE_HOST
|
||||||
|
|
||||||
|
# Gnocchi-statsd
|
||||||
|
|
||||||
|
None
|
||||||
|
|
||||||
# Haproxy
|
# Haproxy
|
||||||
|
|
||||||
None
|
None
|
||||||
|
12
tools/genenv
12
tools/genenv
@ -118,6 +118,18 @@ GLANCE_KEYSTONE_PASSWORD=glance
|
|||||||
GLANCE_API_SERVICE_HOST=$HOST_IP
|
GLANCE_API_SERVICE_HOST=$HOST_IP
|
||||||
GLANCE_REGISTRY_SERVICE_HOST=$HOST_IP
|
GLANCE_REGISTRY_SERVICE_HOST=$HOST_IP
|
||||||
|
|
||||||
|
# Gnocchi
|
||||||
|
GNOCCHI_DB_PASSWORD=gnocchi
|
||||||
|
GNOCCHI_DB_NAME=gnocchi
|
||||||
|
GNOCCHI_DB_USER=gnocchi
|
||||||
|
GNOCCHI_SERVICE_PROTOCOL=http
|
||||||
|
GNOCCHI_SERVICE_PORT=8041
|
||||||
|
GNOCCHI_STORAGE_BACKEND=file
|
||||||
|
GNOCCHI_KEYSTONE_USER=gnocchi
|
||||||
|
GNOCCHI_KEYSTONE_PASSWORD=gnocchi
|
||||||
|
GNOCCHI_ADMIN_PASSWORD=gnocchi
|
||||||
|
GNOCCHI_API_SERVICE_HOST=$HOST_IP
|
||||||
|
|
||||||
# Nova
|
# Nova
|
||||||
NOVA_DB_PASSWORD=nova
|
NOVA_DB_PASSWORD=nova
|
||||||
NOVA_DB_NAME=nova
|
NOVA_DB_NAME=nova
|
||||||
|
@ -46,6 +46,7 @@ function process_all {
|
|||||||
process cinder-backup
|
process cinder-backup
|
||||||
process cinder-volume
|
process cinder-volume
|
||||||
process ceilometer
|
process ceilometer
|
||||||
|
process gnocchi
|
||||||
}
|
}
|
||||||
|
|
||||||
function check_selinux {
|
function check_selinux {
|
||||||
|
Loading…
Reference in New Issue
Block a user