Skip to content

Commit

Permalink
Add tech preview node disruption config
Browse files Browse the repository at this point in the history
  • Loading branch information
yuqi-zhang committed Feb 28, 2024
1 parent 217662e commit b59260a
Show file tree
Hide file tree
Showing 13 changed files with 3,093 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
442 changes: 440 additions & 2 deletions openapi/generated_openapi/zz_generated.openapi.go

Large diffs are not rendered by default.

235 changes: 235 additions & 0 deletions openapi/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -28719,6 +28719,11 @@
"type": "string",
"default": ""
},
"nodeDisruptionPolicy": {
"description": "nodeDisruptionPolicy 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. This configuration has no effect on cluster upgrades which will still incur node disruption where required.",
"default": {},
"$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicy"
},
"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 @@ -28776,6 +28781,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 @@ -29211,6 +29221,211 @@
}
}
},
"com.github.openshift.api.operator.v1.NodeDisruptionPolicy": {
"type": "object",
"properties": {
"clusterDefaultPolicies": {
"description": "clusterDefaultPolicies is managed by the Machine Config Operator, and reflects the latest cluster defaults",
"default": {},
"$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicyConfig"
},
"userPolicies": {
"description": "userPolicies define user-provided node disruption policies",
"default": {},
"$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicyConfig"
}
}
},
"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",
"$ref": "#/definitions/com.github.openshift.api.operator.v1.ReloadService"
},
"restart": {
"description": "restart specifies the service to restart, only valid if type is restart",
"$ref": "#/definitions/com.github.openshift.api.operator.v1.RestartService"
},
"type": {
"description": "type represents the commands that will be carried out if this NodeDisruptionPolicyActionType is executed Valid value(s): Reboot, Drain, Reload, Restart, DaemonReload, None, Special reload/restart requires a corresponding service target specified in the reload/restart field. Other values require no further configuration",
"type": "string",
"default": ""
}
},
"x-kubernetes-unions": [
{
"discriminator": "type",
"fields-to-discriminateBy": {
"reload": "Reload",
"restart": "Restart"
}
}
]
},
"com.github.openshift.api.operator.v1.NodeDisruptionPolicyClusterStatus": {
"description": "NodeDisruptionPolicyClusterStatus is the type for the status object, rendered by the controller as a merge of cluster defaults and user provided policies",
"type": "object",
"properties": {
"files": {
"description": "files is a list of MachineConfig file definitions and actions to take to changes on those paths",
"type": "array",
"items": {
"default": {},
"$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicyFile"
},
"x-kubernetes-list-map-keys": [
"path"
],
"x-kubernetes-list-type": "map"
},
"sshkey": {
"description": "sshkey is the overall sshkey MachineConfig definition",
"default": {},
"$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicySSHKey"
},
"units": {
"description": "units is a list MachineConfig unit definitions and actions to take on changes to those services",
"type": "array",
"items": {
"default": {},
"$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicyUnit"
},
"x-kubernetes-list-map-keys": [
"name"
],
"x-kubernetes-list-type": "map"
}
}
},
"com.github.openshift.api.operator.v1.NodeDisruptionPolicyConfig": {
"description": "NodeDisruptionPolicyConfig is the overall spec definition for files/units/sshkeys",
"type": "object",
"properties": {
"files": {
"description": "files is a list of MachineConfig file definitions and actions to take to changes on those paths",
"type": "array",
"items": {
"default": {},
"$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicyFile"
},
"x-kubernetes-list-map-keys": [
"path"
],
"x-kubernetes-list-type": "map"
},
"sshkey": {
"description": "sshkey maps to the ignition.sshkeys field in the MachineConfig object, definition an action for this will apply to all sshkey changes in the cluster",
"default": {},
"$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicySSHKey"
},
"units": {
"description": "units is a list MachineConfig unit definitions and actions to take on changes to those services",
"type": "array",
"items": {
"default": {},
"$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicyUnit"
},
"x-kubernetes-list-map-keys": [
"name"
],
"x-kubernetes-list-type": "map"
}
}
},
"com.github.openshift.api.operator.v1.NodeDisruptionPolicyFile": {
"description": "NodeDisruptionPolicyFile is a file entry and corresponding actions to take",
"type": "object",
"required": [
"path",
"actions"
],
"properties": {
"actions": {
"description": "actions represents the series of commands to be executed on changes to the file at corresponding file path. This is an atomic list, which will be validated by the MachineConfigOperator, with any conflicts reflecting as an error in the status. If validation is successful, the actions will be applied in the order they are set in the list. If there are other incoming changes to other MachineConfig entries in the same update that require a reboot, the reboot will supercede these actions.",
"type": "array",
"items": {
"default": {},
"$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicyAction"
},
"x-kubernetes-list-type": "atomic"
},
"path": {
"description": "path is the file path to a file on disk managed through a MachineConfig. Actions specified will be applied when changes to the file at the path configured in this field.",
"type": "string",
"default": ""
}
}
},
"com.github.openshift.api.operator.v1.NodeDisruptionPolicySSHKey": {
"description": "NodeDisruptionPolicySSHKey is actions to take for any SSHKey change",
"type": "object",
"required": [
"actions"
],
"properties": {
"actions": {
"description": "actions represents the series of commands to be executed on changes to any sshkey changes through MachineConfig objects. This is an atomic list, which will be validated by the MachineConfigOperator, with any conflicts reflecting as an error in the status. If validation is successful, the actions will be applied in the order they are set in the list. If there are other incoming changes to other MachineConfig entries in the same update that require a reboot, the reboot will supercede these actions.",
"type": "array",
"items": {
"default": {},
"$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicyAction"
},
"x-kubernetes-list-type": "atomic"
}
}
},
"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.",
"default": {},
"$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicyClusterStatus"
},
"conditions": {
"description": "conditions represent the current validation status of the NodeDisruptionPolicy in spec",
"type": "array",
"items": {
"default": {},
"$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Condition"
},
"x-kubernetes-list-map-keys": [
"type"
],
"x-kubernetes-list-type": "map",
"x-kubernetes-patch-merge-key": "type",
"x-kubernetes-patch-strategy": "merge"
}
}
},
"com.github.openshift.api.operator.v1.NodeDisruptionPolicyUnit": {
"description": "NodeDisruptionPolicyUnit is a systemd unit name and corresponding actions to take",
"type": "object",
"required": [
"name",
"actions"
],
"properties": {
"actions": {
"description": "actions represents the series of commands to be executed on changes to the unit defined by the unit name. This is an atomic list, which will be validated by the MachineConfigOperator, with any conflicts reflecting as an error in the status. If validation is successful, the actions will be applied in the order they are set in the list. If there are other incoming changes to other MachineConfig entries in the same update that require a reboot, the reboot will supercede these actions.",
"type": "array",
"items": {
"default": {},
"$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicyAction"
},
"x-kubernetes-list-type": "atomic"
},
"name": {
"description": "name represents the service name of a systemd service managed through a MachineConfig Actions specified will be applied for changes to the named service",
"type": "string",
"default": ""
}
}
},
"com.github.openshift.api.operator.v1.NodePlacement": {
"description": "NodePlacement describes node scheduling configuration for an ingress controller.",
"type": "object",
Expand Down Expand Up @@ -29989,6 +30204,16 @@
}
}
},
"com.github.openshift.api.operator.v1.ReloadService": {
"description": "ReloadService allows the user to specify the services to be reloaded",
"type": "object",
"properties": {
"serviceName": {
"description": "serviceName is the full name (e.g. crio.service) of the service to be reloaded",
"type": "string"
}
}
},
"com.github.openshift.api.operator.v1.ResourceAttributesAccessReview": {
"description": "ResourceAttributesAccessReview defines the visibility of the perspective depending on the access review checks. `required` and `missing` can work together esp. in the case where the cluster admin wants to show another perspective to users without specific permissions. Out of `required` and `missing` atleast one property should be non-empty.",
"type": "object",
Expand All @@ -30011,6 +30236,16 @@
}
}
},
"com.github.openshift.api.operator.v1.RestartService": {
"description": "RestartService allows the user to specify the services to be restarted",
"type": "object",
"properties": {
"serviceName": {
"description": "serviceName is the full name (e.g. crio.service) of the service to be restarted",
"type": "string"
}
}
},
"com.github.openshift.api.operator.v1.RouteAdmissionPolicy": {
"description": "RouteAdmissionPolicy is an admission policy for allowing new route claims.",
"type": "object",
Expand Down

0 comments on commit b59260a

Please sign in to comment.