From a4cc23f5f60c31c6673b4cda65c2568b2b95b7fa Mon Sep 17 00:00:00 2001 From: Daniel Scholl <daniel.scholl@microsoft.com> Date: Tue, 10 Nov 2020 16:01:46 -0500 Subject: [PATCH] Updated Helm chart --- devops/azure/chart/templates/deployment.yaml | 10 ++++++ devops/azure/chart/templates/hpa.yaml | 34 +++++++++++++++++++ .../src/main/resources/application.properties | 4 ++- 3 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 devops/azure/chart/templates/hpa.yaml diff --git a/devops/azure/chart/templates/deployment.yaml b/devops/azure/chart/templates/deployment.yaml index f625bb35f..788491ed0 100644 --- a/devops/azure/chart/templates/deployment.yaml +++ b/devops/azure/chart/templates/deployment.yaml @@ -41,6 +41,11 @@ spec: imagePullPolicy: Always ports: - containerPort: 80 + resources: + requests: + cpu: "100m" + limits: + cpu: "500m" readinessProbe: httpGet: path: /api/indexer/v2/swagger-ui.html @@ -88,6 +93,11 @@ spec: secretKeyRef: name: central-logging key: appinsights + - name: REDIS_DATABASE + valueFrom: + configMapKeyRef: + name: redis-configmap + key: indexer-service - name: cosmosdb_database value: osdu-db - name: servicebus_topic_name diff --git a/devops/azure/chart/templates/hpa.yaml b/devops/azure/chart/templates/hpa.yaml new file mode 100644 index 000000000..d9d00bfc6 --- /dev/null +++ b/devops/azure/chart/templates/hpa.yaml @@ -0,0 +1,34 @@ +# Source: indexer-service/templates/hpa.yaml +# Copyright © Microsoft Corporation +# +# 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/v2beta2 +kind: HorizontalPodAutoscaler +metadata: + name: {{ .Chart.Name }} + namespace: osdu +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ .Chart.Name }} + minReplicas: {{ .Values.global.replicaCount }} + maxReplicas: 5 + metrics: + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: 75 diff --git a/provider/indexer-azure/src/main/resources/application.properties b/provider/indexer-azure/src/main/resources/application.properties index f6cb597db..ad3d128f3 100644 --- a/provider/indexer-azure/src/main/resources/application.properties +++ b/provider/indexer-azure/src/main/resources/application.properties @@ -13,9 +13,11 @@ # limitations under the License. LOG_PREFIX=indexer +LOG_LEVEL=DEBUG + server.servlet.contextPath=/api/indexer/v2/ REGION=centralus -logging.level.org.opendes.osdu=DEBUG +logging.level.org.opendes.osdu=${LOG_LEVEL} JAVA_OPTS=-Dserver.port=80 DEFAULT_DATA_COUNTRY=US -- GitLab