-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(service): horizontal scaling (#3178)
- Loading branch information
Showing
15 changed files
with
225 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,4 @@ charts: | |
buildArgs: | ||
CLEAN_INSTALL: "1" | ||
BUILD_CORE_SERVICE: "1" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{{- range $version := .Values.versions }} | ||
--- | ||
{{- if $.Capabilities.APIVersions.Has "autoscaling/v2" }} | ||
apiVersion: autoscaling/v2 | ||
{{- else if $.Capabilities.APIVersions.Has "autoscaling/v2beta2" }} | ||
apiVersion: autoscaling/v2beta2 | ||
{{- else if $.Capabilities.APIVersions.Has "autoscaling/v2beta1" }} | ||
apiVersion: autoscaling/v2beta1 | ||
{{- else }} | ||
{{- fail "ERROR: You must have at least autoscaling/v2beta1 to use HorizontalPodAutoscaler" }} | ||
{{- end }} | ||
kind: HorizontalPodAutoscaler | ||
metadata: | ||
name: {{ include "renku-core.fullname" $ }}-{{ $version.name }} | ||
spec: | ||
scaleTargetRef: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
name: {{ include "renku-core.fullname" $ }}-{{ $version.name }} | ||
minReplicas: {{ $.Values.horizontalPodAutoscaling.minReplicas }} | ||
maxReplicas: {{ $.Values.horizontalPodAutoscaling.maxReplicas }} | ||
metrics: | ||
- type: Resource | ||
resource: | ||
name: memory | ||
target: | ||
type: Utilization | ||
averageUtilization: {{ $.Values.horizontalPodAutoscaling.averageMemoryUtilization }} | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{{- range $version := .Values.versions }} | ||
--- | ||
apiVersion: policy/v1 | ||
kind: PodDisruptionBudget | ||
metadata: | ||
name: {{ include "renku-core.fullname" $ }}-{{ $version.name }} | ||
spec: | ||
minAvailable: 1 | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/deploymentVersion: {{ $version.name }} | ||
{{ end }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright 2022 - Swiss Data Science Center (SDSC) | ||
# A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and | ||
# Eidgenössische Technische Hochschule Zürich (ETHZ). | ||
# | ||
# 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. | ||
"""Renku service version controller.""" | ||
import json | ||
|
||
from renku.ui.service import config | ||
from renku.ui.service.controllers.api.abstract import ServiceCtrl | ||
from renku.ui.service.serializers.versions_list import VersionsListResponseRPC | ||
from renku.ui.service.views import result_response | ||
|
||
|
||
class VersionsListCtrl(ServiceCtrl): | ||
"""Versions list controller.""" | ||
|
||
RESPONSE_SERIALIZER = VersionsListResponseRPC() | ||
|
||
def to_response(self): | ||
"""Serialize to service version response.""" | ||
|
||
with open(config.METADATA_VERSIONS_LIST, "r") as f: | ||
return result_response(self.RESPONSE_SERIALIZER, json.load(f)) |
Oops, something went wrong.