Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nmaas Platform
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nmaas
nmaas Platform
Commits
773ee67b
Commit
773ee67b
authored
3 weeks ago
by
Patryk Kazimierowski
Browse files
Options
Downloads
Patches
Plain Diff
changed service to scale
parent
a2234441
No related branches found
No related tags found
2 merge requests
!273
Release 1.8.0 update
,
!268
Resolve "Add application instance scaling support"
Pipeline
#95373
passed
3 weeks ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/net/geant/nmaas/orchestration/tasks/app/AppScaleTask.java
+7
-5
7 additions, 5 deletions
...net/geant/nmaas/orchestration/tasks/app/AppScaleTask.java
with
7 additions
and
5 deletions
src/main/java/net/geant/nmaas/orchestration/tasks/app/AppScaleTask.java
+
7
−
5
View file @
773ee67b
package
net.geant.nmaas.orchestration.tasks.app
;
import
lombok.RequiredArgsConstructor
;
import
net.geant.nmaas.nmservice.deployment.
containerorchestrators.kubernetes.KServiceOperationsManag
er
;
import
net.geant.nmaas.nmservice.deployment.
NmServiceDeploymentProvid
er
;
import
net.geant.nmaas.orchestration.AppDeploymentRepositoryManager
;
import
net.geant.nmaas.orchestration.entities.AppDeployment
;
import
net.geant.nmaas.orchestration.entities.AppDeploymentState
;
...
...
@@ -14,23 +14,25 @@ import org.springframework.stereotype.Component;
public
class
AppScaleTask
{
private
final
AppDeploymentRepositoryManager
appDeploymentRepositoryManager
;
private
final
KServiceOperationsManager
kserviceOperationsManager
;
private
final
NmServiceDeploymentProvider
serviceDeployment
;
@EventListener
public
void
handleScaleEvent
(
AppScaleActionEvent
event
)
{
AppDeployment
appDeployment
=
appDeploymentRepositoryManager
.
load
(
event
.
getDeploymentId
());
switch
(
event
.
getDirection
())
{
case
DOWN:
appDeployment
.
setState
(
AppDeploymentState
.
SCALED_DOWN
);
appDeploymentRepositoryManager
.
update
(
appDeployment
);
kserviceOperationsManager
.
scaleDeployment
(
event
.
getDeploymentId
(),
0
);
serviceDeployment
.
scaleDown
(
event
.
getDeploymentId
());
break
;
case
UP:
appDeployment
.
setState
(
AppDeploymentState
.
APPLICATION_CONFIGURED
);
appDeploymentRepositoryManager
.
update
(
appDeployment
);
kserviceOperationsManager
.
scaleDeployment
(
event
.
getDeploymentId
(),
1
);
serviceDeployment
.
scaleUp
(
event
.
getDeploymentId
());
break
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment