-
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
POWERMON-235: Add support for Redfish #364
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,6 +45,11 @@ const ( | |
overviewDashboardName = "power-monitoring-overview" | ||
nsInfoDashboardName = "power-monitoring-by-ns" | ||
DashboardNs = "openshift-config-managed" | ||
REDFISH_ARGS = "-redfish-cred-file-path=/etc/redfish/redfish.csv" | ||
REDFISH_CSV = "redfish.csv" | ||
REDFISH_ANNOTATION = "kepler.system.sustainable.computing.io/redfish-secret-ref" | ||
Comment on lines
+48
to
+50
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could you please change this to follow the convention? |
||
|
||
IdxKeplerContainer = 0 | ||
) | ||
|
||
var ( | ||
|
@@ -132,6 +137,19 @@ func NewDaemonSet(detail components.Detail, k *v1alpha1.KeplerInternal) *appsv1. | |
} | ||
} | ||
|
||
func MountRedfishSecretToDaemonSet(ds *appsv1.DaemonSet, secret *corev1.Secret) { | ||
spec := ds.Spec.Template.Spec | ||
spec.Containers[IdxKeplerContainer].Command = append(spec.Containers[IdxKeplerContainer].Command, REDFISH_ARGS) | ||
spec.Containers[IdxKeplerContainer].VolumeMounts = append(spec.Containers[IdxKeplerContainer].VolumeMounts, | ||
corev1.VolumeMount{Name: "redfish-cred", MountPath: "/etc/redfish", ReadOnly: true}) | ||
spec.Volumes = append(spec.Volumes, | ||
k8s.VolumeFromSecret("redfish-cred", secret.ObjectMeta.Name)) | ||
ds.Spec.Template.Spec = spec | ||
ds.Spec.Template.Annotations = map[string]string{ | ||
REDFISH_ANNOTATION: secret.ResourceVersion, | ||
} | ||
Comment on lines
+148
to
+150
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it may be sufficient to just annotate the ds instead of the template. Lets handle this in a different PR. |
||
} | ||
|
||
func openshiftDashboardObjectMeta(name string) metav1.ObjectMeta { | ||
return metav1.ObjectMeta{ | ||
Name: name, | ||
|
@@ -377,6 +395,7 @@ func NewSCC(d components.Detail, ki *v1alpha1.KeplerInternal) *secv1.SecurityCon | |
Users: []string{ki.FQServiceAccountName()}, | ||
Volumes: []secv1.FSType{ | ||
secv1.FSType("configMap"), | ||
secv1.FSType("secret"), | ||
secv1.FSType("projected"), | ||
secv1.FSType("emptyDir"), | ||
secv1.FSType("hostPath")}, | ||
|
@@ -596,7 +615,6 @@ func newExporterContainer(kiName, dsName string, deployment v1alpha1.InternalExp | |
"-enable-gpu=$(ENABLE_GPU)", | ||
"-v=$(KEPLER_LOG_LEVEL)", | ||
"-kernel-source-dir=/usr/share/kepler/kernel_sources", | ||
"-redfish-cred-file-path=/etc/redfish/redfish.csv", | ||
}, | ||
Ports: []corev1.ContainerPort{{ | ||
ContainerPort: int32(deployment.Port), | ||
|
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.
we don't create secrets do we ?