diff --git a/openstack_operator/horizon.py b/openstack_operator/horizon.py index b1191f56..c6a5e9a8 100644 --- a/openstack_operator/horizon.py +++ b/openstack_operator/horizon.py @@ -55,6 +55,8 @@ def create_or_resume(name, spec, **_): name=name, spec=spec) utils.create_or_update('horizon/memcached.yml.j2', name=name, spec=spec) + utils.create_or_update('horizon/horizontalpodautoscaler.yml.j2', + name=name) if "ingress" in spec: utils.create_or_update('horizon/ingress.yml.j2', name=name, spec=spec) diff --git a/openstack_operator/templates/horizon/horizontalpodautoscaler.yml.j2 b/openstack_operator/templates/horizon/horizontalpodautoscaler.yml.j2 new file mode 100644 index 00000000..02936209 --- /dev/null +++ b/openstack_operator/templates/horizon/horizontalpodautoscaler.yml.j2 @@ -0,0 +1,29 @@ +--- +# 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: autoscaling/v1 +kind: HorizontalPodAutoscaler +metadata: + name: keystone-{{ name }} + labels: + {{ labels("horizon", name) | indent(4) }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: horizon-{{ name }} + minReplicas: 3 + maxReplicas: 10 + targetCPUUtilizationPercentage: 90 diff --git a/openstack_operator/templates/mcrouter/deployment.yml.j2 b/openstack_operator/templates/mcrouter/deployment.yml.j2 index 6c45639c..4772fdc6 100644 --- a/openstack_operator/templates/mcrouter/deployment.yml.j2 +++ b/openstack_operator/templates/mcrouter/deployment.yml.j2 @@ -60,7 +60,7 @@ spec: name: config - name: exporter image: vexxhost/mcrouter_exporter:latest - args: ["-mcrouter.address", "localhost:11211", "-mcrouter.timeout", "3s"] + args: ["-mcrouter.address", "127.0.0.1:11211", "-mcrouter.timeout", "3s"] imagePullPolicy: Always ports: - name: metrics diff --git a/playbooks/functional/pre.yaml b/playbooks/functional/pre.yaml index 73fd86fd..b26264ee 100644 --- a/playbooks/functional/pre.yaml +++ b/playbooks/functional/pre.yaml @@ -17,5 +17,5 @@ - hosts: all roles: - role: clear-firewall - - role: install-kubernetes + - role: ensure-kubernetes - role: ensure-helm