Add HPA to Horizon

Change-Id: I1ce20cb97ce1f4f6175215c7104c4df71c12d54f
This commit is contained in:
okozachenko 2020-05-12 17:58:55 +03:00
parent 88d3edf72c
commit c6316af68d
4 changed files with 33 additions and 2 deletions

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -17,5 +17,5 @@
- hosts: all
roles:
- role: clear-firewall
- role: install-kubernetes
- role: ensure-kubernetes
- role: ensure-helm