Skip to content

Commit

Permalink
Support evented pleg feature in the Openshift
Browse files Browse the repository at this point in the history
1. Incase of Evented PLEG, CRI-O sends the container events to the Kubelet so that the pod cache can be updated based on the received events.
KEP Reference: https://github.com/kubernetes/enhancements/blob/master/keps/sig-node/3386-kubelet-evented-pleg/README.md
2. This feature can be enabled in OCP by adding a new field in the node config custom resource
that can be monitored by the MCO and update both the required Kubelet and CRI-O configurations
Enhancement PR: openshift/enhancements#1368

Signed-off-by: Sai Ramesh Vanka <svanka@redhat.com>
  • Loading branch information
sairameshv committed May 29, 2023
1 parent 91a8d2b commit 7661898
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 0 deletions.
Expand Up @@ -6,6 +6,7 @@ metadata:
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
include.release.openshift.io/single-node-developer: "true"
release.openshift.io/feature-set: Default
name: nodes.config.openshift.io
spec:
group: config.openshift.io
Expand Down
@@ -0,0 +1,67 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
api-approved.openshift.io: https://github.com/openshift/api/pull/1107
include.release.openshift.io/ibm-cloud-managed: "true"
include.release.openshift.io/self-managed-high-availability: "true"
include.release.openshift.io/single-node-developer: "true"
release.openshift.io/feature-set: TechPreviewNoUpgrade
name: nodes.config.openshift.io
spec:
group: config.openshift.io
names:
kind: Node
listKind: NodeList
plural: nodes
singular: node
scope: Cluster
versions:
- name: v1
schema:
openAPIV3Schema:
description: "Node holds cluster-wide information about node specific features. \n Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer)."
type: object
required:
- spec
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: spec holds user settable values for configuration
type: object
properties:
cgroupMode:
description: CgroupMode determines the cgroups version on the node
type: string
enum:
- v1
- v2
- ""
eventedPleg:
description: EventedPleg enables event based PLEG between the kubelet and the CRI-O
type: string
enum:
- Enabled
- Disabled
- ""
workerLatencyProfile:
description: WorkerLatencyProfile determins the how fast the kubelet is updating the status and corresponding reaction of the cluster
type: string
enum:
- Default
- MediumUpdateAverageReaction
- LowUpdateSlowReaction
status:
description: status holds observed values.
type: object
served: true
storage: true
subresources:
status: {}
16 changes: 16 additions & 0 deletions config/v1/types_node.go
Expand Up @@ -42,6 +42,11 @@ type NodeSpec struct {
// the status and corresponding reaction of the cluster
// +optional
WorkerLatencyProfile WorkerLatencyProfileType `json:"workerLatencyProfile,omitempty"`

// EventedPleg enables event based PLEG between the kubelet and the CRI-O
// +openshift:enable:FeatureSets=TechPreviewNoUpgrade
// +optional
EventedPleg EventedPLEG `json:"eventedPleg,omitempty"`
}

type NodeStatus struct{}
Expand Down Expand Up @@ -70,6 +75,17 @@ const (
DefaultUpdateDefaultReaction WorkerLatencyProfileType = "Default"
)

// +kubebuilder:validation:Enum=Enabled;Disabled;""
type EventedPLEG string

const (
// Enabled enables the event based pleg between the kubelet and the cri-o
Enabled EventedPLEG = "Enabled"

// Disabled disables the event based pleg between the kubelet and the cri-o
Disabled EventedPLEG = "Disabled"
)

const (
// DefaultNodeStatusUpdateFrequency refers to the "--node-status-update-frequency" of the kubelet in case of DefaultUpdateDefaultReaction WorkerLatencyProfile type
DefaultNodeStatusUpdateFrequency = 10 * time.Second
Expand Down
1 change: 1 addition & 0 deletions config/v1/zz_generated.swagger_doc_generated.go

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

7 changes: 7 additions & 0 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.

4 changes: 4 additions & 0 deletions openapi/openapi.json
Expand Up @@ -7849,6 +7849,10 @@
"description": "CgroupMode determines the cgroups version on the node",
"type": "string"
},
"eventedPleg": {
"description": "EventedPleg enables event based PLEG between the kubelet and the CRI-O",
"type": "string"
},
"workerLatencyProfile": {
"description": "WorkerLatencyProfile determins the how fast the kubelet is updating the status and corresponding reaction of the cluster",
"type": "string"
Expand Down

0 comments on commit 7661898

Please sign in to comment.