sustainable-computing-io / kepler-operator

Kepler Operator
Apache License 2.0
25 stars 26 forks source link

feat: add kepler-internal CRD #306

Closed sthaha closed 9 months ago

sthaha commented 10 months ago

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.

In this PR, I have added the provision to set export.deployment.Image in the keplerinternal API.

**NOTE:*** KeplerInternal API can break at any point in time, so its usage is highly discouraged other than for testing experimental features.

sthaha commented 9 months ago

@vprashar2929 could you please give this a go on openshift as well?

sthaha commented 9 months ago

Lets wait for @vprashar2929 to run the tests before merging this 👼

vprashar2929 commented 9 months ago

When kepler deployed using Kepler API the instance also visible in KeplerInternal as well

~ ❯ oc get kepler -o wide ; oc get keplerinternals -o wide                                                                                         ⎈ 
NAME     PORT   DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   AGE     NODE-SELECTOR                  TOLERATIONS
kepler   9103   6         6         6       6            6           2m29s   {"kubernetes.io/os":"linux"}   [{"operator":"Exists"}]
NAME     PORT   DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   AGE     IMAGE                                                   NODE-SELECTOR                  TOLERATIONS
kepler   9103   6         6         6       6            6           2m33s   quay.io/sustainable_computing_io/kepler:release-0.6.1   {"kubernetes.io/os":"linux"}   [{"operator":"Exists"}]
sthaha commented 9 months ago

When kepler deployed using Kepler API the instance also visible in KeplerInternal as well

Like the PR mentions, Kepler is now a facade over KeplerInternal, so when user creates Kepler, kepler-controller creates KeplerInternal and then kepler-internal controller creates the daemonset, etc ..

sthaha commented 9 months ago

@vimalk78 @sunya-ch , I am closing this PR in favour of https://github.com/sustainable-computing-io/kepler-operator/pull/309