Skip to content

Commit

Permalink
Add node pool recycling options
Browse files Browse the repository at this point in the history
  • Loading branch information
shyamradhakrishnan committed Jun 22, 2023
1 parent ed6d14c commit c5ab55b
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 152 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,28 +77,6 @@ spec:
description: NodeMetadata defines a list of key/value pairs to add
to each underlying OCI instance in the node pool on launch.
type: object
nodePoolCyclingDetails:
description: NodePoolCyclingDetails defines the node pool recycling
options.
properties:
isNodeCyclingEnabled:
description: IsNodeCyclingEnabled refers if nodes in the nodepool
will be cycled to have new changes.
type: boolean
maximumSurge:
description: MaximumSurge refers to the maximum additional new
compute instances that would be temporarily created and added
to nodepool during the cycling nodepool process. OKE supports
both integer and percentage input. Defaults to 1, Ranges from
0 to Nodepool size or 0% to 100%
type: string
maximumUnavailable:
description: Maximum active nodes that would be terminated from
nodepool during the cycling nodepool process. OKE supports both
integer and percentage input. Defaults to 0, Ranges from 0 to
Nodepool size or 0% to 100%
type: string
type: object
nodePoolNodeConfig:
description: NodePoolNodeConfig defines the configuration of nodes
in the node pool.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,28 +90,6 @@ spec:
to add to each underlying OCI instance in the node pool
on launch.
type: object
nodePoolCyclingDetails:
description: NodePoolCyclingDetails defines the node pool
recycling options.
properties:
isNodeCyclingEnabled:
description: IsNodeCyclingEnabled refers if nodes in the
nodepool will be cycled to have new changes.
type: boolean
maximumSurge:
description: MaximumSurge refers to the maximum additional
new compute instances that would be temporarily created
and added to nodepool during the cycling nodepool process.
OKE supports both integer and percentage input. Defaults
to 1, Ranges from 0 to Nodepool size or 0% to 100%
type: string
maximumUnavailable:
description: Maximum active nodes that would be terminated
from nodepool during the cycling nodepool process. OKE
supports both integer and percentage input. Defaults
to 0, Ranges from 0 to Nodepool size or 0% to 100%
type: string
type: object
nodePoolNodeConfig:
description: NodePoolNodeConfig defines the configuration
of nodes in the node pool.
Expand Down
4 changes: 4 additions & 0 deletions exp/api/v1beta1/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,7 @@ func Convert_v1beta2_NetworkDetails_To_v1beta1_NetworkDetails(in *infrastructure
func Convert_v1beta2_OCIManagedControlPlaneSpec_To_v1beta1_OCIManagedControlPlaneSpec(in *v1beta2.OCIManagedControlPlaneSpec, out *OCIManagedControlPlaneSpec, s conversion.Scope) error {
return autoConvert_v1beta2_OCIManagedControlPlaneSpec_To_v1beta1_OCIManagedControlPlaneSpec(in, out, s)
}

func Convert_v1beta2_OCIManagedMachinePoolSpec_To_v1beta1_OCIManagedMachinePoolSpec(in *v1beta2.OCIManagedMachinePoolSpec, out *OCIManagedMachinePoolSpec, s conversion.Scope) error {
return autoConvert_v1beta2_OCIManagedMachinePoolSpec_To_v1beta1_OCIManagedMachinePoolSpec(in, out, s)
}
1 change: 1 addition & 0 deletions exp/api/v1beta1/ocimanagedmachinepool_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ func (src *OCIManagedMachinePool) ConvertTo(dstRaw conversion.Hub) error {
if ok, err := utilconversion.UnmarshalData(src, restored); err != nil || !ok {
return err
}
dst.Spec.NodePoolCyclingDetails = restored.Spec.NodePoolCyclingDetails

return nil
}
Expand Down
23 changes: 0 additions & 23 deletions exp/api/v1beta1/ocimanagedmachinepool_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ type OCIManagedMachinePoolSpec struct {
// +optional
InitialNodeLabels []KeyValue `json:"initialNodeLabels,omitempty"`

// NodePoolCyclingDetails defines the node pool recycling options.
// +optional
NodePoolCyclingDetails *NodePoolCyclingDetails `json:"nodePoolCyclingDetails,omitempty"`

// ProviderIDList are the identification IDs of machine instances provided by the provider.
// This field must match the provider IDs as seen on the node objects corresponding to a machine pool's machine instances.
// +optional
Expand Down Expand Up @@ -195,25 +191,6 @@ type KeyValue struct {
Value *string `json:"value,omitempty"`
}

// NodePoolCyclingDetails defines the node pool recycling options
type NodePoolCyclingDetails struct {

// IsNodeCyclingEnabled refers if nodes in the nodepool will be cycled to have new changes.
// +optional
IsNodeCyclingEnabled *bool `json:"isNodeCyclingEnabled,omitempty"`

// MaximumSurge refers to the maximum additional new compute instances that would be temporarily created and
// added to nodepool during the cycling nodepool process. OKE supports both integer and percentage input.
// Defaults to 1, Ranges from 0 to Nodepool size or 0% to 100%
// +optional
MaximumSurge *string `json:"maximumSurge,omitempty"`

// Maximum active nodes that would be terminated from nodepool during the cycling nodepool process.
// OKE supports both integer and percentage input. Defaults to 0, Ranges from 0 to Nodepool size or 0% to 100%
// +optional
MaximumUnavailable *string `json:"maximumUnavailable,omitempty"`
}

// OCIManagedMachinePoolStatus defines the observed state of OCIManagedMachinePool
type OCIManagedMachinePoolStatus struct {
// +optional
Expand Down
100 changes: 50 additions & 50 deletions exp/api/v1beta1/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 0 additions & 35 deletions exp/api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c5ab55b

Please sign in to comment.