Commit 409d1c7e authored by Daniel Perez's avatar Daniel Perez
Browse files

Merge branch 'slb/dperez50/adding-hpa' into 'master'

ci: adding hpa

See merge request !163
parents 646b3ef2 7c02e159
Pipeline #57026 passed with stages
in 15 minutes and 37 seconds
......@@ -5,6 +5,8 @@ variables:
PORT: 80
REPLICA: 1
UTEST_RUNTIME_IMAGE: seistore-svc-runtime
SDMS_MIN_REPLICAS: 1
SDMS_MAX_REPLICAS: 5
#aws variables
AWS_SERVICE: seismic-store
......
......@@ -511,7 +511,7 @@ The following software have components provided under the terms of this license:
- execa (from https://www.npmjs.com/package/execa)
- express (from https://www.npmjs.com/package/express)
- extend (from https://www.npmjs.com/package/extend)
- extsprintf (from https://github.com/davepacheco/node-extsprintf)
- extsprintf (from https://www.npmjs.com/package/extsprintf)
- fast-deep-equal (from https://www.npmjs.com/package/fast-deep-equal)
- fast-json-stable-stringify (from https://www.npmjs.com/package/fast-json-stable-stringify)
- fast-safe-stringify (from https://www.npmjs.com/package/fast-safe-stringify)
......@@ -708,7 +708,7 @@ The following software have components provided under the terms of this license:
- performance-now (from https://www.npmjs.com/package/performance-now)
- priorityqueuejs (from https://www.npmjs.com/package/priorityqueuejs)
- process (from https://www.npmjs.com/package/process)
- process-nextick-args (from https://github.com/calvinmetcalf/process-nextick-args)
- process-nextick-args (from https://www.npmjs.com/package/process-nextick-args)
- promise.prototype.finally (from https://www.npmjs.com/package/promise.prototype.finally)
- protobufjs (from https://www.npmjs.com/package/protobufjs)
- proxy-addr (from https://www.npmjs.com/package/proxy-addr)
......@@ -815,7 +815,7 @@ The following software have components provided under the terms of this license:
- universalify (from https://www.npmjs.com/package/universalify)
- unpipe (from https://github.com/stream-utils/unpipe)
- untildify (from https://www.npmjs.com/package/untildify)
- url (from https://github.com/defunctzombie/node-url#readme)
- url (from https://www.npmjs.com/package/url)
- url-join (from https://www.npmjs.com/package/url-join)
- urllib3 (from https://urllib3.readthedocs.io/)
- util-deprecate (from https://github.com/TooTallNate/util-deprecate)
......@@ -827,7 +827,7 @@ The following software have components provided under the terms of this license:
- uuid (from https://www.npmjs.com/package/uuid)
- uuid (from https://www.npmjs.com/package/uuid)
- vary (from https://www.npmjs.com/package/vary)
- verror (from https://github.com/davepacheco/node-verror)
- verror (from https://www.npmjs.com/package/verror)
- which (from https://github.com/isaacs/node-which#readme)
- which-module (from https://www.npmjs.com/package/which-module)
- wide-align (from https://www.npmjs.com/package/wide-align)
......@@ -930,3 +930,6 @@ The following software have components provided under the terms of this license:
- jmespath (from https://www.npmjs.com/package/jmespath)
- json-schema (from http://github.com/kriszyp/json-schema)
- querystring (from https://www.npmjs.com/package/querystring)
- sax (from https://www.npmjs.com/package/sax)
......@@ -2,6 +2,8 @@ global:
replicaCount: #{REPLICA_COUNT}#
namespace: osdu
podidentity: osdu-identity
minReplicaCount: #{SDMS_MIN_REPLICAS}#
maxReplicaCount: #{SDMS_MAX_REPLICAS}#
configEnv:
cloudProvider: #{PROVIDER_NAME}#
......
apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
name: {{ .Release.Name }}
namespace: osdu
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ .Release.Name }}
minReplicas: {{ .Values.global.minReplicaCount }}
maxReplicas: {{ .Values.global.maxReplicaCount }}
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 50
behavior:
scaleDown:
stabilizationWindowSeconds: 300
# Either remove 20% of current pods or 2 pods (whichever is lower) every 15 seconds until the the HPA stabilizes
selectPolicy: Min
policies:
- type: Percent
value: 20
periodSeconds: 15
- type: Pods
value: 2
periodSeconds: 15
scaleUp:
stabilizationWindowSeconds: 0
# Either add 100% of current pods or 4 pods (whichever is higher) every 1 second until the the HPA stabilizes
selectPolicy: Max
policies:
- type: Percent
value: 85
periodSeconds: 1
- type: Pods
value: 4
periodSeconds: 1
\ No newline at end of file
......@@ -39,6 +39,8 @@ azure_deploy:
- sed -i 's/#{REDIS_HOST}#/'$REDIS_INSTANCE_ADDRESS'/' ${CHART_PATH}/values.yaml
- sed -i 's/#{REDIS_PORT}#/'$REDIS_INSTANCE_PORT'/' ${CHART_PATH}/values.yaml
- sed -i 's/#{REPLICA_COUNT}#/'$REPLICA'/' ${CHART_PATH}/values.yaml
- sed -i 's/#{SDMS_MIN_REPLICAS}#/'$SDMS_MIN_REPLICAS'/' ${CHART_PATH}/values.yaml
- sed -i 's/#{SDMS_MAX_REPLICAS}#/'$SDMS_MAX_REPLICAS'/' ${CHART_PATH}/values.yaml
# Install helm chart
- helm upgrade $SERVICE_NAME ${CHART_PATH} --install --dry-run --values $CHART_PATH/values.yaml
- helm upgrade $SERVICE_NAME ${CHART_PATH} --install --values $CHART_PATH/values.yaml
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment