Skip to content
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: allow multiple kepler deployments using kepler-internal #309

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,16 @@ build: manifests generate fmt vet ## Build manager binary.
go build -o bin/manager ./cmd/manager/...

OPENSHIFT ?= true
RUN_ARGS ?=

.PHONY: run
run: install fmt vet ## Run a controller from your host against openshift cluster
go run ./cmd/manager/... \
--kepler.image=$(KEPLER_IMG) --kepler.image.libbpf=$(KEPLER_IMG_LIBBPF) \
--zap-devel --zap-log-level=8 --openshift=$(OPENSHIFT) 2>&1 | tee tmp/operator.log
--kepler.image=$(KEPLER_IMG) --kepler.image.libbpf=$(KEPLER_IMG_LIBBPF) \
--zap-devel --zap-log-level=8 \
--openshift=$(OPENSHIFT) \
$(RUN_ARGS) \
2>&1 | tee tmp/operator.log

# docker_tag accepts an image:tag and a list of additional tags comma-separated
# it tags the image with the additional tags
Expand Down
24 changes: 21 additions & 3 deletions bundle/manifests/kepler-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,13 @@ metadata:
capabilities: Basic Install
categories: Monitoring
containerImage: quay.io/sustainable_computing_io/kepler-operator:0.9.2
createdAt: "2023-11-01T12:15:43Z"
createdAt: "2023-11-30T08:58:07Z"
description: 'Deploys and Manages Kepler on Kubernetes '
operators.operatorframework.io/builder: operator-sdk-v1.27.0
operators.operatorframework.io/internal-objects: |-
[
"keplerinternals.kepler.system.sustainable.computing.io"
]
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
repository: https://github.com/sustainable-computing-io/kepler-operator
name: kepler-operator.v0.9.2
Expand All @@ -38,13 +42,27 @@ spec:
apiservicedefinitions: {}
customresourcedefinitions:
owned:
- description: KeplerInternal is the Schema for internal/unsupported API
displayName: KeplerInternal
kind: KeplerInternal
name: keplerinternals.kepler.system.sustainable.computing.io
statusDescriptors:
- description: conditions represent the latest available observations of the
kepler-exporter
displayName: Conditions
path: exporter.conditions
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:conditions
version: v1alpha1
- description: Kepler is the Schema for the keplers API
displayName: Kepler
kind: Kepler
name: keplers.kepler.system.sustainable.computing.io
statusDescriptors:
- displayName: Conditions
path: conditions
- description: conditions represent the latest available observations of the
kepler-exporter
displayName: Conditions
path: exporter.conditions
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:conditions
version: v1alpha1
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,275 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.12.1
creationTimestamp: null
name: keplerinternals.kepler.system.sustainable.computing.io
spec:
group: kepler.system.sustainable.computing.io
names:
kind: KeplerInternal
listKind: KeplerInternalList
plural: keplerinternals
singular: keplerinternal
scope: Cluster
versions:
- additionalPrinterColumns:
- jsonPath: .spec.exporter.deployment.port
name: Port
type: integer
- jsonPath: .status.exporter.desiredNumberScheduled
name: Desired
type: integer
- jsonPath: .status.exporter.currentNumberScheduled
name: Current
type: integer
- jsonPath: .status.updatedNumberScheduled
name: Up-to-date
type: integer
- jsonPath: .status.exporter.numberReady
name: Ready
type: integer
- jsonPath: .status.exporter.numberAvailable
name: Available
type: integer
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
- jsonPath: .spec.exporter.deployment.image
name: Image
type: string
- jsonPath: .spec.exporter.deployment.nodeSelector
name: Node-Selector
priority: 10
type: string
- jsonPath: .spec.exporter.deployment.tolerations
name: Tolerations
priority: 10
type: string
name: v1alpha1
schema:
openAPIV3Schema:
description: KeplerInternal is the Schema for the keplers internal API
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: KeplerInternalSpec defines the desired state of KeplerInternal
properties:
exporter:
properties:
deployment:
properties:
image:
description: Image of kepler-exporter to be deployed
minLength: 3
type: string
namespace:
description: Namespace where kepler-exporter will be deployed
minLength: 1
type: string
nodeSelector:
additionalProperties:
type: string
default:
kubernetes.io/os: linux
description: Defines which Nodes the Pod is scheduled on
type: object
port:
default: 9103
format: int32
maximum: 65535
minimum: 1
type: integer
tolerations:
default:
- effect: ""
key: ""
operator: Exists
value: ""
description: If specified, define Pod's tolerations
items:
description: The pod this Toleration is attached to tolerates
any taint that matches the triple <key,value,effect> using
the matching operator <operator>.
properties:
effect:
description: Effect indicates the taint effect to match.
Empty means match all taint effects. When specified,
allowed values are NoSchedule, PreferNoSchedule and
NoExecute.
type: string
key:
description: Key is the taint key that the toleration
applies to. Empty means match all taint keys. If the
key is empty, operator must be Exists; this combination
means to match all values and all keys.
type: string
operator:
description: Operator represents a key's relationship
to the value. Valid operators are Exists and Equal.
Defaults to Equal. Exists is equivalent to wildcard
for value, so that a pod can tolerate all taints of
a particular category.
type: string
tolerationSeconds:
description: TolerationSeconds represents the period
of time the toleration (which must be of effect NoExecute,
otherwise this field is ignored) tolerates the taint.
By default, it is not set, which means tolerate the
taint forever (do not evict). Zero and negative values
will be treated as 0 (evict immediately) by the system.
format: int64
type: integer
value:
description: Value is the taint value the toleration
matches to. If the operator is Exists, the value should
be empty, otherwise just a regular string.
type: string
type: object
type: array
required:
- image
- namespace
type: object
required:
- deployment
type: object
openshift:
properties:
dashboard:
properties:
enabled:
default: false
type: boolean
type: object
enabled:
default: true
type: boolean
required:
- enabled
type: object
required:
- exporter
type: object
status:
description: KeplerInternalStatus represents status of KeplerInternal
properties:
exporter:
description: ExporterStatus defines the observed state of Kepler Exporter
properties:
conditions:
description: conditions represent the latest available observations
of the kepler-exporter
items:
properties:
lastTransitionTime:
description: lastTransitionTime is the last time the condition
transitioned from one status to another. This should be
when the underlying condition changed. If that is not
known, then using the time when the API field changed
is acceptable.
format: date-time
type: string
message:
description: message is a human readable message indicating
details about the transition. This may be an empty string.
maxLength: 32768
type: string
observedGeneration:
description: observedGeneration represents the .metadata.generation
that the condition was set based upon. For instance, if
.metadata.generation is currently 12, but the .status.conditions[x].observedGeneration
is 9, the condition is out of date with respect to the
current state of the instance.
format: int64
minimum: 0
type: integer
reason:
description: reason contains a programmatic identifier indicating
the reason for the condition's last transition.
type: string
status:
description: status of the condition, one of True, False,
Unknown.
type: string
type:
description: Type of Kepler Condition - Reconciled, Available
...
type: string
required:
- lastTransitionTime
- message
- reason
- status
- type
type: object
type: array
x-kubernetes-list-type: atomic
currentNumberScheduled:
description: The number of nodes that are running at least 1 kepler
pod and are supposed to run the kepler pod.
format: int32
type: integer
desiredNumberScheduled:
description: The total number of nodes that should be running
the kepler pod (including nodes correctly running the kepler
pod).
format: int32
type: integer
numberAvailable:
description: The number of nodes that should be running the kepler
pod and have one or more of the kepler pod running and available
format: int32
type: integer
numberMisscheduled:
description: The number of nodes that are running the kepler pod,
but are not supposed to run the kepler pod.
format: int32
type: integer
numberReady:
description: numberReady is the number of nodes that should be
running the kepler pod and have one or more of the kepler pod
running with a Ready Condition.
format: int32
type: integer
numberUnavailable:
description: The number of nodes that should be running the kepler
pod and have none of the kepler pod running and available
format: int32
type: integer
updatedNumberScheduled:
description: The total number of nodes that are running updated
kepler pod
format: int32
type: integer
required:
- conditions
- currentNumberScheduled
- desiredNumberScheduled
- numberMisscheduled
- numberReady
type: object
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: null
storedVersions: null
Loading
Loading