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 26, 2024
1 parent 247d3e0 commit 9b02645
Show file tree
Hide file tree
Showing 13 changed files with 2,938 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 @@ -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. This is NOT intended to be used for cluster upgrades to different versions.",
"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,211 @@
}
}
},
"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, daemon-reload, none, special reload/restart requires a corresponding service target specified in the reload/restart field. All other fields cannot have a these fields",
"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 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.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 corresponding type and value",
"type": "array",
"items": {
"default": {},
"$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicyAction"
},
"x-kubernetes-list-type": "atomic"
},
"path": {
"description": "path represents the filepath",
"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 the corresponding type and value",
"type": "array",
"items": {
"default": {},
"$ref": "#/definitions/com.github.openshift.api.operator.v1.NodeDisruptionPolicyAction"
},
"x-kubernetes-list-type": "atomic"
}
}
},
"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",
"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.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 corresponding type and value",
"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",
"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 @@ -29988,6 +30203,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 @@ -30010,6 +30235,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
Loading

0 comments on commit 9b02645

Please sign in to comment.