-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add kepler-internal CRD #306
feat: add kepler-internal CRD #306
Conversation
05a0493
to
1addde7
Compare
Kepler container is container[0] and not 1 which was a change introduced in ae09380 Signed-off-by: Sunil Thaha <[email protected]>
97c807f
to
276e80f
Compare
This commit adds a `KeplerInternal` CRD which is a internal API of Kepler Operator. Kepler CRD is now a facade for `KeplerInternal` Creating a `Kepler` now creates a corresponding `keplerinternal` CR with appropriate spec initialised. The KeplerInternal Controller responds creation of `kepler-internal` by deploying kepler. This separation allows for providing stable API - Kepler or other higher level api (such as `powermon.openshift.io - PowerMonitoring`) which provides a limited set of stable functionalities to users. NOTE: KeplerInternal API can break at any point in time, so its usage is highly discouraged other than for testing experimental features. Signed-off-by: Sunil Thaha <[email protected]>
7fa8d1e
to
b72ca9e
Compare
Signed-off-by: Sunil Thaha <[email protected]>
b72ca9e
to
cee1bb3
Compare
@vprashar2929 could you please give this a go on openshift as well? |
Lets wait for @vprashar2929 to run the tests before merging this 👼 |
bundle/manifests/kepler.system.sustainable.computing.io_keplerinternals.yaml
Show resolved
Hide resolved
When kepler deployed using
|
Like the PR mentions, |
config/crd/bases/kepler.system.sustainable.computing.io_keplerinternals.yaml
Show resolved
Hide resolved
metadata: | ||
type: object | ||
spec: | ||
description: KeplerInternalSpec defines the desired state of Kepler |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
desired state of KeplerInternal
properties: | ||
deployment: | ||
properties: | ||
image: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add description? since users can set the image in KeplerInternal which is not allowed in Kepler
- description: KeplerInternal is the Schema for internal/unsupported API | ||
displayName: KeplerInternal | ||
kind: KeplerInternal | ||
name: keplerinternals.kepler.system.sustainable.computing.io | ||
version: v1alpha1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add statusDescriptors
for KeplerInternal
same as that of Kepler
?
type: object | ||
type: object | ||
type: object | ||
status: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: the status
field today is KeplerStatus, for deployment of exporter pods via daemonset.
In the future when model-server is added, a new type ExporterStatus
is to be added and all exporter status fields moved there? somewhere need to differentiate exporter status from future added status.
type: object | ||
type: object | ||
status: | ||
description: KeplerStatus defines the observed state of Kepler |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: the type for status is getting reused here, but description says observed state of Kepler
if kepler == nil { | ||
// no kepler found , so stop here | ||
logger.V(6).Info("Kepler Nil") | ||
return ctrl.Result{}, nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: rename variable to ki
. should the log say KeplerInternal Nil
return ctrl.Result{}, nil | ||
} | ||
|
||
logger.V(6).Info("Running sub reconcilers", "kepler", kepler.Spec) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
running kepler internal ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment for other logs in this file, should it say kepler
or keplerinternal
?
@@ -0,0 +1,61 @@ | |||
package controllers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add license comment header
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
@@ -0,0 +1,403 @@ | |||
package controllers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add license comment header
This commit adds a
KeplerInternal
CRD which is a internal API of Kepler Operator. Kepler CRD is now a facade forKeplerInternal
Creating aKepler
now creates a correspondingkeplerinternal
CR with appropriate spec initialised. The KeplerInternal Controller responds creation ofkepler-internal
by deploying kepler.This separation allows for providing stable API - Kepler or other higher level api (such as
powermon.openshift.io - PowerMonitoring
) which provides a limited set of stable functionalities to users.In this PR, I have added the provision to set
export.deployment.Image
in thekeplerinternal
API.NOTE:* KeplerInternal API can break at any point in time, so its usage is highly discouraged other than for testing experimental features.