From 046158b1494938a61f8a9b98d8b0bba88295f2df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Trellu?= Date: Tue, 2 Jul 2019 18:55:59 -0400 Subject: [PATCH] Add HAcluster containers Theses images contains High Availability solution such as Corosync, Pacemaker, Pacemaker Remote and PCS. Change-Id: I86fd145d2998f68b08a16082414b86904971549a Implements: blueprint pacemaker-container --- README.rst | 2 ++ docker/base/Dockerfile.j2 | 1 + docker/base/crmsh.repo | 7 +++++++ docker/hacluster/hacluster-base/Dockerfile.j2 | 12 ++++++++++++ docker/hacluster/hacluster-base/extend_start.sh | 8 ++++++++ docker/hacluster/hacluster-corosync/Dockerfile.j2 | 11 +++++++++++ .../hacluster-pacemaker-remote/Dockerfile.j2 | 11 +++++++++++ docker/hacluster/hacluster-pacemaker/Dockerfile.j2 | 11 +++++++++++ docker/hacluster/hacluster-pcs/Dockerfile.j2 | 11 +++++++++++ kolla/common/config.py | 1 + .../notes/add-hacluster-role-d10bc3918395ccdf.yaml | 9 +++++++++ 11 files changed, 84 insertions(+) create mode 100644 docker/base/crmsh.repo create mode 100644 docker/hacluster/hacluster-base/Dockerfile.j2 create mode 100644 docker/hacluster/hacluster-base/extend_start.sh create mode 100644 docker/hacluster/hacluster-corosync/Dockerfile.j2 create mode 100644 docker/hacluster/hacluster-pacemaker-remote/Dockerfile.j2 create mode 100644 docker/hacluster/hacluster-pacemaker/Dockerfile.j2 create mode 100644 docker/hacluster/hacluster-pcs/Dockerfile.j2 create mode 100644 releasenotes/notes/add-hacluster-role-d10bc3918395ccdf.yaml diff --git a/README.rst b/README.rst index 52daa1a76f..661ada5dea 100644 --- a/README.rst +++ b/README.rst @@ -130,6 +130,8 @@ Kolla provides images to deploy the following infrastructure components: - `Collectd `__, `InfluxDB `__, and `Grafana `__ for performance monitoring. +- `Corosync `__ and + `Pacemaker `__ for HAcluster. - `Elasticsearch `__ and `Kibana `__ to search, analyze, and visualize log messages. diff --git a/docker/base/Dockerfile.j2 b/docker/base/Dockerfile.j2 index b93e378f97..5a1821d0f4 100644 --- a/docker/base/Dockerfile.j2 +++ b/docker/base/Dockerfile.j2 @@ -75,6 +75,7 @@ COPY yum.conf /etc/yum.conf {% if base_arch == 'x86_64' %} {% set base_yum_repo_files = [ + 'crmsh.repo', 'elasticsearch.repo', 'grafana.repo', 'influxdb.repo', diff --git a/docker/base/crmsh.repo b/docker/base/crmsh.repo new file mode 100644 index 0000000000..1c3396f750 --- /dev/null +++ b/docker/base/crmsh.repo @@ -0,0 +1,7 @@ +[network_ha-clustering_Stable] +name=Stable High Availability/Clustering packages (CentOS_CentOS-7) +type=rpm-md +baseurl=http://download.opensuse.org/repositories/network:/ha-clustering:/Stable/CentOS_CentOS-7/ +gpgcheck=1 +gpgkey=http://download.opensuse.org/repositories/network:/ha-clustering:/Stable/CentOS_CentOS-7/repodata/repomd.xml.key +enabled=1 diff --git a/docker/hacluster/hacluster-base/Dockerfile.j2 b/docker/hacluster/hacluster-base/Dockerfile.j2 new file mode 100644 index 0000000000..7997e12294 --- /dev/null +++ b/docker/hacluster/hacluster-base/Dockerfile.j2 @@ -0,0 +1,12 @@ +FROM {{ namespace }}/{{ image_prefix }}base:{{ tag }} +LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}" + +{% block hacluster_base_header %}{% endblock %} + +{% import "macros.j2" as macros with context %} + +COPY extend_start.sh /usr/local/bin/kolla_extend_start + +RUN chmod 755 /usr/local/bin/kolla_extend_start + +{% block hacluster_base_footer %}{% endblock %} diff --git a/docker/hacluster/hacluster-base/extend_start.sh b/docker/hacluster/hacluster-base/extend_start.sh new file mode 100644 index 0000000000..c0e9301d02 --- /dev/null +++ b/docker/hacluster/hacluster-base/extend_start.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +if [[ ! -d "/var/log/kolla/hacluster" ]]; then + mkdir -p /var/log/kolla/hacluster +fi +if [[ $(stat -c %a /var/log/kolla/hacluster) != "755" ]]; then + chmod 755 /var/log/kolla/hacluster +fi diff --git a/docker/hacluster/hacluster-corosync/Dockerfile.j2 b/docker/hacluster/hacluster-corosync/Dockerfile.j2 new file mode 100644 index 0000000000..08f3f678f4 --- /dev/null +++ b/docker/hacluster/hacluster-corosync/Dockerfile.j2 @@ -0,0 +1,11 @@ +FROM {{ namespace }}/{{ image_prefix }}hacluster-base:{{ tag }} +LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}" + +{% block hacluster_corosync_header %}{% endblock %} + +{% import "macros.j2" as macros with context %} + +{% set hacluster_corosync_packages = ['corosync'] %} +{{ macros.install_packages(hacluster_corosync_packages | customizable("packages")) }} + +{% block hacluster_corosync_footer %}{% endblock %} diff --git a/docker/hacluster/hacluster-pacemaker-remote/Dockerfile.j2 b/docker/hacluster/hacluster-pacemaker-remote/Dockerfile.j2 new file mode 100644 index 0000000000..2a6570ffe6 --- /dev/null +++ b/docker/hacluster/hacluster-pacemaker-remote/Dockerfile.j2 @@ -0,0 +1,11 @@ +FROM {{ namespace }}/{{ image_prefix }}hacluster-base:{{ tag }} +LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}" + +{% block hacluster_pacemaker_remote_header %}{% endblock %} + +{% import "macros.j2" as macros with context %} + +{% set hacluster_pacemaker_remote_packages = ['pacemaker-remote'] %} +{{ macros.install_packages(hacluster_pacemaker_remote_packages | customizable("packages")) }} + +{% block hacluster_pacemaker_remote_footer %}{% endblock %} diff --git a/docker/hacluster/hacluster-pacemaker/Dockerfile.j2 b/docker/hacluster/hacluster-pacemaker/Dockerfile.j2 new file mode 100644 index 0000000000..a11163a3cb --- /dev/null +++ b/docker/hacluster/hacluster-pacemaker/Dockerfile.j2 @@ -0,0 +1,11 @@ +FROM {{ namespace }}/{{ image_prefix }}hacluster-base:{{ tag }} +LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}" + +{% block hacluster_pacemaker_header %}{% endblock %} + +{% import "macros.j2" as macros with context %} + +{% set hacluster_pacemaker_packages = ['pacemaker'] %} +{{ macros.install_packages(hacluster_pacemaker_packages | customizable("packages")) }} + +{% block hacluster_pacemaker_footer %}{% endblock %} diff --git a/docker/hacluster/hacluster-pcs/Dockerfile.j2 b/docker/hacluster/hacluster-pcs/Dockerfile.j2 new file mode 100644 index 0000000000..0b760ca253 --- /dev/null +++ b/docker/hacluster/hacluster-pcs/Dockerfile.j2 @@ -0,0 +1,11 @@ +FROM {{ namespace }}/{{ image_prefix }}hacluster-base:{{ tag }} +LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}" + +{% block hacluster_pcs_header %}{% endblock %} + +{% import "macros.j2" as macros with context %} + +{% set hacluster_pcs_packages = ['pcs','crmsh'] %} +{{ macros.install_packages(hacluster_pcs_packages | customizable("packages")) }} + +{% block hacluster_pcs_footer %}{% endblock %} diff --git a/kolla/common/config.py b/kolla/common/config.py index fdb4655e87..a4f52a9499 100755 --- a/kolla/common/config.py +++ b/kolla/common/config.py @@ -57,6 +57,7 @@ _PROFILE_OPTS = [ 'etcd', 'fluentd', 'haproxy', + 'hacluster', 'keepalived', 'kibana', 'kolla-toolbox', diff --git a/releasenotes/notes/add-hacluster-role-d10bc3918395ccdf.yaml b/releasenotes/notes/add-hacluster-role-d10bc3918395ccdf.yaml new file mode 100644 index 0000000000..2c19f852b5 --- /dev/null +++ b/releasenotes/notes/add-hacluster-role-d10bc3918395ccdf.yaml @@ -0,0 +1,9 @@ +--- +features: + - | + Add HAcluster Docker images. These images contain High Availability + solution such as Corosync, Pacemaker, Pacemaker Remote and PCS. + + HAcluster will not handle any OpenStack control plane resources, it + will be used as third party for OpenStack Masakari for example to handle + the instances failover if a Nova compute crash.