Skip to content

Commit

Permalink
Add feature gate and api for MCO Node Disruption Policy
Browse files Browse the repository at this point in the history
  • Loading branch information
yuqi-zhang committed Feb 9, 2024
1 parent 58ae935 commit df6de7b
Show file tree
Hide file tree
Showing 12 changed files with 957 additions and 3 deletions.
10 changes: 10 additions & 0 deletions config/v1/feature_gates.go
Original file line number Diff line number Diff line change
Expand Up @@ -461,4 +461,14 @@ var (
ResponsiblePerson: "fbertina",
OwningProduct: kubernetes,
}

FeatureGateNodeDisruptionPolicy = FeatureGateName("NodeDisruptionPolicy")
nodeDisruptionPolicy = FeatureGateDescription{
FeatureGateAttributes: FeatureGateAttributes{
Name: FeatureGateNodeDisruptionPolicy,
},
OwningJiraComponent: "MachineConfigOperator",
ResponsiblePerson: "jerzhang",
OwningProduct: ocpSpecific,
}
)
1 change: 1 addition & 0 deletions config/v1/types_feature.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ var FeatureSets = map[FeatureSet]*FeatureGateEnabledDisabled{
with(upgradeStatus).
with(translateStreamCloseWebsocketRequests).
with(volumeGroupSnapshot).
with(nodeDisruptionPolicy).
toFeatures(defaultFeatures),
LatencySensitive: newDefaultFeatures().
toFeatures(defaultFeatures),
Expand Down
193 changes: 191 additions & 2 deletions openapi/generated_openapi/zz_generated.openapi.go

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

106 changes: 106 additions & 0 deletions openapi/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -28718,6 +28718,11 @@
"type": "string",
"default": ""
},
"nodeDisruptionPolicySpec": {
"description": "nodeDisruptionPolicySpec allows an admin to set granular node disruption actions for MachineConfig-based updates, such as drains, service reloads, etc. Specifying this will allow for less downtime when doing small configuration updates to the cluster.",
"default": {},
"$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicySpec"
},
"observedConfig": {
"description": "observedConfig holds a sparse config that controller has observed from the cluster state. It exists in spec because it is an input to the level for the operator",
"default": {},
Expand Down Expand Up @@ -28775,6 +28780,11 @@
"description": "latestAvailableRevisionReason describe the detailed reason for the most recent deployment",
"type": "string"
},
"nodeDisruptionPolicyStatus": {
"description": "nodeDisruptionPolicyStatus status reflects what the latest cluster-validated policies are, and will be used by the Machine Config Daemon during future node updates.",
"default": {},
"$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicyStatus"
},
"nodeStatuses": {
"description": "nodeStatuses track the deployment values and errors across individual nodes",
"type": "array",
Expand Down Expand Up @@ -29210,6 +29220,102 @@
}
}
},
"com.github.openshift.api.operator.v1.NodeDisruptionPolicyAction": {
"type": "object",
"required": [
"type"
],
"properties": {
"reload": {
"description": "reload specifies the service to reload, only valid if type is reload",
"type": "string"
},
"type": {
"description": "type represents the commands that will be carried out if this NodeDisruptionPolicyActionType is executed Valid value(s): reboot, drain, reload, daemon-reload, none, special reload requires a corresponding service target specified in the reload field. All other fields cannot have a reload field",
"type": "string",
"default": ""
}
},
"x-kubernetes-unions": [
{
"discriminator": "type",
"fields-to-discriminateBy": {
"reload": "Reload"
}
}
]
},
"com.github.openshift.api.operator.v1.NodeDisruptionPolicyConfig": {
"type": "object",
"required": [
"type",
"actions"
],
"properties": {
"actions": {
"description": "actions represents the series of commands to be executed on changes to the corresponding type and value",
"type": "array",
"items": {
"default": {},
"$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicyAction"
}
},
"type": {
"description": "type represents the type of the object that this policy is in effect for, matching available MachineConfig fields (files, services, kernel arguments, and sshkeys)",
"type": "string",
"default": ""
},
"value": {
"description": "value represents the canoncial name of the object that this policy is in effect for. This could be a file path, a service name, the specific kernel argument, etc.",
"type": "string",
"default": ""
}
}
},
"com.github.openshift.api.operator.v1.NodeDisruptionPolicySpec": {
"type": "object",
"properties": {
"clusterDefaultPolicies": {
"description": "clusterDefaultPolicies is managed by the Machine Config Operator, and reflects the latest cluster defaults",
"type": "array",
"items": {
"default": {},
"$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicyConfig"
}
},
"userPolicies": {
"description": "userPolicies define user-provided node disruption policies",
"type": "array",
"items": {
"default": {},
"$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicyConfig"
}
}
}
},
"com.github.openshift.api.operator.v1.NodeDisruptionPolicyStatus": {
"type": "object",
"properties": {
"clusterPolicies": {
"description": "clusterPolicies is a merge of cluster default and user provided node disruption policies.",
"type": "array",
"items": {
"default": {},
"$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicyConfig"
}
},
"reason": {
"description": "reason is a human readable explanation for the failure of policy validation, if any",
"type": "string",
"default": ""
},
"validation": {
"description": "validation of the provided spec, one of ('Success', 'Failed').",
"type": "string",
"default": ""
}
}
},
"com.github.openshift.api.operator.v1.NodePlacement": {
"description": "NodePlacement describes node scheduling configuration for an ingress controller.",
"type": "object",
Expand Down
Loading

0 comments on commit df6de7b

Please sign in to comment.