diff options
| author | Michal Nasiadka <mnasiadka@gmail.com> | 2020-02-13 11:10:24 +0100 |
|---|---|---|
| committer | Michal Nasiadka <mnasiadka@gmail.com> | 2020-02-14 08:52:23 +0000 |
| commit | abce4d5398d44b46161de2bf21914e776d16d7e7 (patch) | |
| tree | 6da2ab63dcd6ecf52680b2924b814add45e80832 /docker/ceph/ceph-mon | |
| parent | 063a46a7de4471504535499ca2a972a79e4ce5e5 (diff) | |
| download | kolla-abce4d5398d44b46161de2bf21914e776d16d7e7.tar.gz kolla-abce4d5398d44b46161de2bf21914e776d16d7e7.zip | |
Remove kolla Ceph container images
This change removes ceph* Dockerfiles and relevant kolla python
code bits.
Kolla-Ansible part has been removed, and K-A was the only consumer.
Change-Id: I9568261fdbbe4b9156d0e07c414ec911ca2e8557
Diffstat (limited to 'docker/ceph/ceph-mon')
| -rw-r--r-- | docker/ceph/ceph-mon/Dockerfile.j2 | 12 | ||||
| -rw-r--r-- | docker/ceph/ceph-mon/extend_start.sh | 54 | ||||
| -rw-r--r-- | docker/ceph/ceph-mon/fetch_ceph_keys.py | 70 |
3 files changed, 0 insertions, 136 deletions
diff --git a/docker/ceph/ceph-mon/Dockerfile.j2 b/docker/ceph/ceph-mon/Dockerfile.j2 deleted file mode 100644 index 1bcfa988b..000000000 --- a/docker/ceph/ceph-mon/Dockerfile.j2 +++ /dev/null @@ -1,12 +0,0 @@ -FROM {{ namespace }}/{{ image_prefix }}ceph-base:{{ tag }} -LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}" - -{% block ceph_mon_header %}{% endblock %} - -COPY fetch_ceph_keys.py /usr/bin/ - -COPY extend_start.sh /usr/local/bin/kolla_extend_start -RUN chmod 755 /usr/local/bin/kolla_extend_start /usr/bin/fetch_ceph_keys.py - -{% block ceph_mon_footer %}{% endblock %} -{% block footer %}{% endblock %} diff --git a/docker/ceph/ceph-mon/extend_start.sh b/docker/ceph/ceph-mon/extend_start.sh deleted file mode 100644 index 188349788..000000000 --- a/docker/ceph/ceph-mon/extend_start.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/bash - -# Setup common paths -KEYRING_ADMIN="/etc/ceph/ceph.client.admin.keyring" -KEYRING_MON="/etc/ceph/ceph.client.mon.keyring" -KEYRING_RGW="/etc/ceph/ceph.client.radosgw.keyring" -MONMAP="/etc/ceph/ceph.monmap" -MON_DIR="/var/lib/ceph/mon/ceph-${HOSTNAME}" - -if [[ ! -d "/var/log/kolla/ceph" ]]; then - mkdir -p /var/log/kolla/ceph -fi -if [[ $(stat -c %a /var/log/kolla/ceph) != "755" ]]; then - chmod 755 /var/log/kolla/ceph -fi - -# 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 - # Lookup our fsid from the ceph.conf - FSID=$(awk '/^fsid/ {print $3; exit}' /etc/ceph/ceph.conf) - - # Generating initial keyrings and monmap - ceph-authtool --create-keyring "${KEYRING_MON}" --gen-key -n mon. --cap mon 'allow *' - ceph-authtool --create-keyring "${KEYRING_ADMIN}" --gen-key -n client.admin --cap mon 'allow *' --cap osd 'allow *' --cap mds 'allow *' --cap mgr 'allow *' - ceph-authtool --create-keyring "${KEYRING_RGW}" --gen-key -n client.radosgw.gateway --cap osd 'allow rwx' --cap mon 'allow rwx' - ceph-authtool "${KEYRING_MON}" --import-keyring "${KEYRING_ADMIN}" - ceph-authtool "${KEYRING_MON}" --import-keyring "${KEYRING_RGW}" - monmaptool --create --add "${HOSTNAME}" "${MON_IP}" --fsid "${FSID}" "${MONMAP}" - - exit 0 -fi - -# This section runs on every mon that does not have a keyring already. -if [[ ! -e "${MON_DIR}/keyring" ]]; then - KEYRING_TMP="/tmp/ceph.mon.keyring" - - # Generate keyring for current monitor - ceph-authtool --create-keyring "${KEYRING_TMP}" --import-keyring "${KEYRING_ADMIN}" - ceph-authtool "${KEYRING_TMP}" --import-keyring "${KEYRING_MON}" - mkdir -p "${MON_DIR}" - - mon_stat=$(ceph mon stat --connect-timeout 1 || true) - mon_check=$(echo $mon_stat | awk '/mons/{print $0}' | wc -l) - if [[ ${mon_check} -eq 0 ]]; then - ceph-mon --mkfs -i "${HOSTNAME}" --keyring "${KEYRING_TMP}" - else - MONMAP_TMP="/tmp/ceph.${HOSTNAME}.monmap" - ceph mon getmap -o "${MONMAP_TMP}" - ceph-mon --mkfs -i "${HOSTNAME}" --monmap "${MONMAP_TMP}" --keyring "${KEYRING_TMP}" - rm "${MONMAP_TMP}" - fi - rm "${KEYRING_TMP}" -fi diff --git a/docker/ceph/ceph-mon/fetch_ceph_keys.py b/docker/ceph/ceph-mon/fetch_ceph_keys.py deleted file mode 100644 index 31af87eed..000000000 --- a/docker/ceph/ceph-mon/fetch_ceph_keys.py +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/python - -# Copyright 2015 Sam Yaple -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# This is a stripped down version of an ansible module I wrote in Yaodu to -# achieve the same goals we have for Kolla. I have relicensed it for Kolla -# https://github.com/SamYaple/yaodu/blob/master/ansible/library/bslurp - -# Basically this module will fetch the admin and mon keyrings as well as the -# monmap file. It then hashes the content, compresses them, and finally it -# converts them to base64 to be safely transported around with ansible - -import base64 -import hashlib -import json -import os -import sys -import zlib - - -def json_exit(msg=None, failed=False, changed=False): - if type(msg) is not dict: - msg = {'msg': str(msg)} - msg.update({'failed': failed, 'changed': changed}) - print(json.dumps(msg)) - sys.exit() - - -def read_file(filename): - filename_path = os.path.join('/etc/ceph', filename) - - if not os.path.exists(filename_path): - json_exit("file not found: {}".format(filename_path), failed=True) - if not os.access(filename_path, os.R_OK): - json_exit("file not readable: {}".format(filename_path), failed=True) - - with open(filename_path, 'rb') as f: - raw_data = f.read() - - # TODO(mnasiadka): Remove sha1 in U - return {'content': (base64.b64encode(zlib.compress(raw_data))).decode(), - 'sha1': hashlib.sha1(raw_data).hexdigest(), - 'sha256': hashlib.sha256(raw_data).hexdigest(), - 'filename': filename} - - -def main(): - admin_keyring = 'ceph.client.admin.keyring' - mon_keyring = 'ceph.client.mon.keyring' - rgw_keyring = 'ceph.client.radosgw.keyring' - monmap = 'ceph.monmap' - - files = [admin_keyring, mon_keyring, rgw_keyring, monmap] - json_exit({filename: read_file(filename) for filename in files}) - - -if __name__ == '__main__': - main() |
