Add rabbitmq to magnum
Change-Id: Ib1908f371b362aaa092e7391c4faf8cf2e7a4ccc
This commit is contained in:
parent
1e55b9c28b
commit
e4dc3cda9b
@ -133,7 +133,12 @@ function create_magnum_conf {
|
|||||||
rm -f $MAGNUM_CONF
|
rm -f $MAGNUM_CONF
|
||||||
HOSTNAME=`hostname`
|
HOSTNAME=`hostname`
|
||||||
iniset $MAGNUM_CONF DEFAULT debug "$ENABLE_DEBUG_LOG_LEVEL"
|
iniset $MAGNUM_CONF DEFAULT debug "$ENABLE_DEBUG_LOG_LEVEL"
|
||||||
iniset $MAGNUM_CONF DEFAULT transport_url $(get_transport_url)
|
|
||||||
|
# Get rabbitmq password
|
||||||
|
MAGNUM_RABBITMQ_PASSWORD=$(get_data_from_secret magnum-rabbitmq openstack password)
|
||||||
|
MAGNUM_RABBITMQ_USERNAME=$(get_data_from_secret magnum-rabbitmq openstack username)
|
||||||
|
|
||||||
|
iniset $MAGNUM_CONF DEFAULT transport_url "rabbit://$MAGNUM_RABBITMQ_USERNAME:$MAGNUM_RABBITMQ_PASSWORD@rabbitmq-magnum:5672/"
|
||||||
iniset $MAGNUM_CONF DEFAULT host "$HOSTNAME"
|
iniset $MAGNUM_CONF DEFAULT host "$HOSTNAME"
|
||||||
|
|
||||||
iniset $MAGNUM_CONF database connection `database_connection_url magnum`
|
iniset $MAGNUM_CONF database connection `database_connection_url magnum`
|
||||||
|
@ -39,6 +39,12 @@ def create_or_resume(name, spec, **_):
|
|||||||
utils.create_or_update('magnum/service.yml.j2',
|
utils.create_or_update('magnum/service.yml.j2',
|
||||||
name=name)
|
name=name)
|
||||||
|
|
||||||
|
# deploy rabbitmq
|
||||||
|
if not utils.ensure_secret("openstack", "magnum-rabbitmq"):
|
||||||
|
utils.create_or_update('magnum/secret-rabbitmq.yml.j2',
|
||||||
|
password=utils.generate_password())
|
||||||
|
utils.create_or_update('magnum/rabbitmq.yml.j2')
|
||||||
|
|
||||||
if "ingress" in spec:
|
if "ingress" in spec:
|
||||||
utils.create_or_update('magnum/ingress.yml.j2',
|
utils.create_or_update('magnum/ingress.yml.j2',
|
||||||
name=name, spec=spec)
|
name=name, spec=spec)
|
||||||
|
@ -60,14 +60,6 @@ class PodMonitor(NamespacedAPIObject):
|
|||||||
kind = "PodMonitor"
|
kind = "PodMonitor"
|
||||||
|
|
||||||
|
|
||||||
class Rabbitmq(NamespacedAPIObject):
|
|
||||||
"""Rabbitmq Kubernetes object"""
|
|
||||||
|
|
||||||
version = "infrastructure.vexxhost.cloud/v1alpha1"
|
|
||||||
endpoint = "rabbitmqs"
|
|
||||||
kind = "Rabbitmq"
|
|
||||||
|
|
||||||
|
|
||||||
class PrometheusRule(NamespacedAPIObject):
|
class PrometheusRule(NamespacedAPIObject):
|
||||||
"""PrometheusRule Kubernetes object"""
|
"""PrometheusRule Kubernetes object"""
|
||||||
|
|
||||||
@ -76,6 +68,14 @@ class PrometheusRule(NamespacedAPIObject):
|
|||||||
kind = "PrometheusRule"
|
kind = "PrometheusRule"
|
||||||
|
|
||||||
|
|
||||||
|
class Rabbitmq(NamespacedAPIObject):
|
||||||
|
"""Rabbitmq Kubernetes object"""
|
||||||
|
|
||||||
|
version = "infrastructure.vexxhost.cloud/v1alpha1"
|
||||||
|
endpoint = "rabbitmqs"
|
||||||
|
kind = "Rabbitmq"
|
||||||
|
|
||||||
|
|
||||||
MAPPING = {
|
MAPPING = {
|
||||||
"v1": {
|
"v1": {
|
||||||
"ConfigMap": ConfigMap,
|
"ConfigMap": ConfigMap,
|
||||||
@ -101,7 +101,7 @@ MAPPING = {
|
|||||||
"infrastructure.vexxhost.cloud/v1alpha1": {
|
"infrastructure.vexxhost.cloud/v1alpha1": {
|
||||||
"Mcrouter": Mcrouter,
|
"Mcrouter": Mcrouter,
|
||||||
"Memcached": Memcached,
|
"Memcached": Memcached,
|
||||||
"Rabbitmq": Rabbitmq,
|
"Rabbitmq": Rabbitmq
|
||||||
},
|
},
|
||||||
"monitoring.coreos.com/v1": {
|
"monitoring.coreos.com/v1": {
|
||||||
"PodMonitor": PodMonitor,
|
"PodMonitor": PodMonitor,
|
||||||
|
30
openstack_operator/templates/magnum/rabbitmq.yml.j2
Normal file
30
openstack_operator/templates/magnum/rabbitmq.yml.j2
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
---
|
||||||
|
# Copyright 2020 VEXXHOST, Inc.
|
||||||
|
#
|
||||||
|
# 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.
|
||||||
|
|
||||||
|
apiVersion: infrastructure.vexxhost.cloud/v1alpha1
|
||||||
|
kind: Rabbitmq
|
||||||
|
metadata:
|
||||||
|
name: magnum
|
||||||
|
namespace: openstack
|
||||||
|
spec:
|
||||||
|
authSecret: magnum-rabbitmq
|
||||||
|
{% if 'nodeSelector' in spec %}
|
||||||
|
nodeSelector:
|
||||||
|
{{ spec.nodeSelector | to_yaml | indent(4) }}
|
||||||
|
{% endif %}
|
||||||
|
{% if 'tolerations' in spec %}
|
||||||
|
tolerations:
|
||||||
|
{{ spec.tolerations | to_yaml | indent(4) }}
|
||||||
|
{% endif %}
|
@ -0,0 +1,9 @@
|
|||||||
|
|
||||||
|
apiVersion: v1
|
||||||
|
metadata:
|
||||||
|
name: keystone-rabbitmq
|
||||||
|
namespace: openstack
|
||||||
|
stringData:
|
||||||
|
username: magnum
|
||||||
|
password: {{ password }}
|
||||||
|
kind: Secret
|
Loading…
x
Reference in New Issue
Block a user