Skip to content

Commit

Permalink
[src] - ocean gke - add scope field
Browse files Browse the repository at this point in the history
  • Loading branch information
AvishagK committed Dec 19, 2024
1 parent f2d8721 commit feb170d
Show file tree
Hide file tree
Showing 12 changed files with 106 additions and 56 deletions.
4 changes: 2 additions & 2 deletions api/services/ocean/gke/paths/cluster-roll.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ put:
example: STOPPED
responses:
200:
$ref: "../responses/update-clusterRoll.yaml"
$ref: "../responses/roll/update-clusterRoll.yaml"
400:
description: "Bad Request"

Expand All @@ -51,6 +51,6 @@ get:
- $ref: "../parameters/clusterRollId.yaml"
responses:
200:
$ref: "../responses/initiate-clusterRoll.yaml"
$ref: "../responses/roll/initiate-clusterRoll.yaml"
400:
description: "Bad Request"
85 changes: 32 additions & 53 deletions api/services/ocean/gke/paths/clusters-roll.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,61 +19,40 @@ post:
content:
application/json:
schema:
type: object
properties:
roll:
type: object
description: >
Settings for roll operation
oneOf:
- type: object
title: 'Roll'
properties:
batchSizePercentage:
type: integer
description: >
Value in % to set the size of the batches in the roll. Valid values are 0-100
example: 20
comment:
description: >
Add a breif description or comment about the roll. The comment should be limited to 256 chars.
type: string
example: "This is why I deployed my cluster."
respectPdb:
type: boolean
example: true
default: false
description: >
During the roll, if the parameter is set to true we honor PDB during the instance replacement.
batchMinHealthyPercentage:
type: integer
description: >
Indicates the threshold of minimum healthy instances in single batch. If the amount of healthy instances in single batch is under the threshold, the cluster roll will fail. If exists, the parameter value will be in range of 1-100. In case of null as value, the default value in the backend will be 50%. Value of param should represent the number in percentage (%) of the batch.
example: 100
default: 50
launchSpecIds:
type: array
description: >
List of virtual node group identifiers to be rolled.
Each identifier is a string. Can be null.
Cannot be used together with instanceName.
items:
type: string
example:
- ols-76694a7d
- ols-56694a76
instanceNames:
type: array
description: >
List of instance names to be rolled.
Each name is a string.
instanceNames can be null.
Cannot be used together with launchSpecIds.
items:
type: string
example:
- i-0003a99ffb566f039
- i-0567a99ffb566f765
roll:
allOf:
- $ref: "../schemas/roll/roll-batchSizePercentage.yaml"
- $ref: "../schemas/roll/roll-comment.yaml"
- $ref: "../schemas/roll/roll-respectPdb.yaml"
- $ref: "../schemas/roll/roll-batchMinHealthyPercentage.yaml"
- type: object
title: 'Roll with instance ids'
properties:
roll:
allOf:
- $ref: "../schemas/roll/roll-batchSizePercentage.yaml"
- $ref: "../schemas/roll/roll-comment.yaml"
- $ref: "../schemas/roll/roll-respectPdb.yaml"
- $ref: "../schemas/roll/roll-batchMinHealthyPercentage.yaml"
- $ref: "../schemas/roll/roll-instanceIds.yaml"
- type: object
title: 'Roll with Virtual Node Group ids'
properties:
roll:
allOf:
- $ref: "../schemas/roll/roll-batchSizePercentage.yaml"
- $ref: "../schemas/roll/roll-comment.yaml"
- $ref: "../schemas/roll/roll-respectPdb.yaml"
- $ref: "../schemas/roll/roll-batchMinHealthyPercentage.yaml"
- $ref: "../schemas/roll/roll-launchSpecIds.yaml"
- $ref: "../schemas/roll/roll-disableLaunchSpecAutoScaling.yaml"
responses:
200:
$ref: "../responses/initiate-clusterRoll.yaml"
$ref: "../responses/roll/initiate-clusterRoll.yaml"
400:
description: "Bad Request"

Expand All @@ -89,6 +68,6 @@ get:
- $ref: "../parameters/oceanId.yaml"
responses:
200:
$ref: "../responses/clusterRollGetAllResponse.yaml"
$ref: "../responses/roll/clusterRollGetAllResponse.yaml"
400:
description: "Bad Request"
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ content:
id:
type: string
example: scr-5aaf854e
scope:
type: string
enum: [ Cluster, Vngs, Vng, Instances, Instance ]
example: Cluster
status:
type: string
example: IN_PROGRESS
Expand Down Expand Up @@ -89,4 +93,4 @@ content:
example: 2019-03-24T15:46:09.000Z
updatedAt:
type: string
example: 2019-03-24T15:46:09.000Z
example: 2019-03-24T15:46:09.000Z
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ content:
oceanId:
type: string
example: o-12e31234
scope:
type: string
enum: [ Cluster, Vngs, Vng, Instances, Instance ]
example: Cluster
status:
type: string
example: IN_PROGRESS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ content:
numOfBatches:
type: integer
example: 5
scope:
type: string
enum: [ Cluster, Vngs, Vng, Instances, Instance ]
example: Cluster
progress:
type: object
properties:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
type: object
properties:
batchMinHealthyPercentage:
type: integer
description: >
Indicates the threshold of minimum healthy instances in single batch. If the amount of healthy instances in single batch is under the threshold, the cluster roll will fail. If exists, the parameter value will be in range of 1-100. In case of null as value, the default value in the backend will be 50%. Value of param should represent the number in percentage (%) of the batch.
example: 100
default: 50
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
type: object
properties:
batchSizePercentage:
type: integer
description: >
Value as a percent to set the size of a batch in a roll. Valid values are 0-100.
example: 20
7 changes: 7 additions & 0 deletions api/services/ocean/gke/schemas/roll/roll-comment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
type: object
properties:
comment:
type: string
description: >
Add a comment description for the roll. The comment is limited to 256 chars.
example: "This is why I deployed my cluster."
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
type: object
properties:
disableLaunchSpecAutoScaling:
type: boolean
description: >
When set to True and virtual node group identifiers are defined to roll, the specified Virtual Node Group(s) will be blocked from scaling up. (Replacements will scale up in other Virtual Node Groups that match the displaced pods instead.) This is meant for different use cases of 'migrating' nodes from one Virtual Node Group to another.
example: true
11 changes: 11 additions & 0 deletions api/services/ocean/gke/schemas/roll/roll-instanceIds.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
type: object
properties:
instanceIds:
type: array
description: >
List of instance identifiers to be rolled. Each identifier is a string. InstanceIds can be null, and cannot be used together with launchSpecIds.
items:
type: string
example:
- i-0003a99ffb566f039
- i-0567a99ffb566f765
11 changes: 11 additions & 0 deletions api/services/ocean/gke/schemas/roll/roll-launchSpecIds.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
type: object
properties:
launchSpecIds:
type: array
description: >
List of virtual node group identifiers to be rolled. Each identifier is a string. LaunchSpecIds can be null, and cannot be used together with instanceIds.
items:
type: string
example:
- ols-76694a7d
- ols-56694a76
8 changes: 8 additions & 0 deletions api/services/ocean/gke/schemas/roll/roll-respectPdb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
type: object
properties:
respectPdb:
type: boolean
description: >
During the roll, if the parameter is set to true we honor PDB during the instance replacement.
example: true
default: false

0 comments on commit feb170d

Please sign in to comment.