From 3372083721ad5ca16821ad74793d0c9feee00d69 Mon Sep 17 00:00:00 2001 From: okozachenko Date: Fri, 24 Jul 2020 20:52:58 +0300 Subject: [PATCH] Add memcached to magnum Change-Id: I42f5fa0ab378cc8c65ee7ecab1e6234c7319370a --- devstack/lib/magnum | 2 +- openstack_operator/magnum.py | 1 + .../templates/magnum/memcached.yml.j2 | 32 +++++++++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 openstack_operator/templates/magnum/memcached.yml.j2 diff --git a/devstack/lib/magnum b/devstack/lib/magnum index c50fb62b..4bed96b4 100644 --- a/devstack/lib/magnum +++ b/devstack/lib/magnum @@ -172,7 +172,7 @@ function create_magnum_conf { iniset $MAGNUM_CONF keystone_authtoken www_authenticate_uri $KEYSTONE_SERVICE_URI_V3 iniset $MAGNUM_CONF keystone_authtoken auth_url $KEYSTONE_AUTH_URI_V3 iniset $MAGNUM_CONF keystone_authtoken auth_version v3 - + iniset $MAGNUM_CONF keystone_authtoken memcached_servers "mcrouter-memcached-magnum:11211" if is_fedora || is_suse; then # magnum defaults to /usr/local/bin, but fedora and suse pip like to # install things in /usr/bin diff --git a/openstack_operator/magnum.py b/openstack_operator/magnum.py index d18358e5..5c241a7e 100644 --- a/openstack_operator/magnum.py +++ b/openstack_operator/magnum.py @@ -39,6 +39,7 @@ def create_or_resume(name, spec, **_): utils.create_or_update('magnum/service.yml.j2', name=name) + utils.create_or_update('magnum/memcached.yml.j2', spec=spec) # deploy rabbitmq if not utils.ensure_secret("openstack", "magnum-rabbitmq"): utils.create_or_update('magnum/secret-rabbitmq.yml.j2', diff --git a/openstack_operator/templates/magnum/memcached.yml.j2 b/openstack_operator/templates/magnum/memcached.yml.j2 new file mode 100644 index 00000000..1415b975 --- /dev/null +++ b/openstack_operator/templates/magnum/memcached.yml.j2 @@ -0,0 +1,32 @@ +--- +# 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: Memcached +metadata: + name: magnum + namespace: openstack + labels: + {{ labels("magnum") | indent(4) }} +spec: + megabytes: 128 +{% if 'nodeSelector' in spec %} + nodeSelector: + {{ spec.nodeSelector | to_yaml | indent(4) }} +{% endif %} +{% if 'tolerations' in spec %} + tolerations: + {{ spec.tolerations | to_yaml | indent(4) }} +{% endif %}