Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.

Commit

Permalink
Merge pull request #58 from madalazar/master
Browse files Browse the repository at this point in the history
Kubernetes Power Manager v2.3.1 release
  • Loading branch information
pbrownlow7 authored Sep 11, 2023
2 parents 289c3c2 + 46dc2f1 commit 693deef
Show file tree
Hide file tree
Showing 14 changed files with 385 additions and 17 deletions.
12 changes: 9 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,23 @@ build: generate manifests install

# Build the Manager and Node Agent images
images: generate manifests install
docker build -f build/Dockerfile -t intel/power-operator:v2.3.0 .
docker build -f build/Dockerfile.nodeagent -t intel/power-node-agent:v2.3.0 .
docker build -f build/Dockerfile -t intel/power-operator:v2.3.1 .
docker build -f build/Dockerfile.nodeagent -t intel/power-node-agent:v2.3.1 .

# Run against the configured Kubernetes cluster in ~/.kube/config
run: generate fmt vet manifests
go run ./main.go

helm-install: generate manifests install
helm install kubernetes-power-manager-v2.3.0 ./helm/kubernetes-power-manager-v2.3.0
helm install kubernetes-power-manager-v2.3.1 ./helm/kubernetes-power-manager-v2.3.1

helm-uninstall:
helm uninstall kubernetes-power-manager-v2.3.1

helm-install-v2.3.0: generate manifests install
helm install kubernetes-power-manager-v2.3.0 ./helm/kubernetes-power-manager-v2.3.0

helm-uninstall-v2.3.0:
helm uninstall kubernetes-power-manager-v2.3.0

helm-install-v2.2.0: generate manifests install
Expand Down
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -423,8 +423,8 @@ spec:

The Shared PowerProfile must be created by the user and does not require a Base PowerProfile. This allows the user to
have a Shared PowerProfile per Node in their cluster, giving more room for different configurations. The Power
controller determines that a PowerProfile is being designated as ‘Shared’ through the use of the ‘power’ EPP value.

controller determines that a PowerProfile is being designated as ‘Shared’ through the use of the ‘shared’ parameter.
This flag must be enabled when using a shared pool.
#### Example

````yaml
Expand All @@ -436,7 +436,9 @@ spec:
name: "shared-example-node1"
max: 1500
min: 1000
shared: true
epp: "power"
governor: "powersave"
````

````yaml
Expand All @@ -448,7 +450,9 @@ spec:
name: "shared-example-node2"
max: 2000
min: 1500
epp: "power"
shared: true
governor: "powersave"

````

### PowerNode Controller
Expand Down Expand Up @@ -854,16 +858,17 @@ create the PowerProfiles that were requested on each Node.
The example Shared PowerProfile in examples/example-shared-profile.yaml contains the following PowerProfile spec:

````yaml
apiVersion: "power.intel.com/v1"
apiVersion: power.intel.com/v1
kind: PowerProfile
metadata:
name: shared
namespace: intel-power
spec:
name: "shared"
max: 1500
max: 1000
min: 1000
# A shared PowerProfile must have the EPP value of 'power'
epp: "power"
shared: true
governor: "powersave"
````

Expand Down
2 changes: 1 addition & 1 deletion build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ FROM clearlinux@sha256:d3dd73575d2eb9c6ffb635c82b266fa9266591db844ac9f41014c0af4
WORKDIR /
COPY --from=builder /workspace/manager .
COPY build/manifests/ /power-manifests/
USER 1001
USER 10001

ENTRYPOINT ["/manager"]
3 changes: 2 additions & 1 deletion build/Dockerfile.nodeagent
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ COPY go.sum go.sum

RUN go mod download

ENV USER_ID=1001 \
ENV USER_ID=10001 \
USER_NAME=power-node-agent

# Copy the go source
Expand All @@ -28,5 +28,6 @@ WORKDIR /
COPY --from=builder /workspace/nodeagent .
COPY build/bin bin/
RUN bin/user_setup
USER 10001

ENTRYPOINT ["/nodeagent"]
7 changes: 4 additions & 3 deletions build/manifests/power-node-agent-ds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ spec:
spec:
serviceAccountName: intel-power-node-agent
containers:
- image: intel/power-node-agent:v2.3.0
- image: intel/power-node-agent:v2.3.1
imagePullPolicy: IfNotPresent
securityContext:
privileged: true
runAsUser: 0
name: power-node-agent
args: [ "--zap-log-level","3" ]
env:
Expand All @@ -36,7 +37,7 @@ spec:
volumeMounts:
- mountPath: /sys/devices/system/cpu
name: cpusetup
- mountPath: /sys/fs
- mountPath: /sys/fs/cgroup
name: cgroup
readOnly: true
- mountPath: /var/lib/kubelet/pod-resources/
Expand All @@ -48,7 +49,7 @@ spec:
path: /sys/devices/system/cpu
- name: cgroup
hostPath:
path: /sys/fs
path: /sys/fs/cgroup
- name: kubesock
hostPath:
path: /var/lib/kubelet/pod-resources
10 changes: 7 additions & 3 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,15 @@ spec:
- --zap-log-level
- "3"
imagePullPolicy: IfNotPresent
image: intel/power-operator:v2.3.0
image: intel/power-operator:v2.3.1
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop: [ "ALL" ]
runAsNonRoot: true
runAsUser: 10001
seccompProfile:
type: RuntimeDefault
name: manager
resources:
limits:
Expand All @@ -38,12 +42,12 @@ spec:
cpu: 100m
memory: 64Mi
volumeMounts:
- mountPath: /sys/fs
- mountPath: /sys/fs/cgroup
name: cgroup
mountPropagation: HostToContainer
readOnly: true
terminationGracePeriodSeconds: 10
volumes:
- name: cgroup
hostPath:
path: /sys/fs
path: /sys/fs/cgroup
24 changes: 24 additions & 0 deletions helm/kubernetes-power-manager-v2.3.1/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v2
name: kubernetes-power-manager-v2.3.1
description: A Helm chart for Intel's Kubernetes Power Manager v2.3.1

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.0.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "v2.3.1"
62 changes: 62 additions & 0 deletions helm/kubernetes-power-manager-v2.3.1/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "kubernetes-power-manager.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "kubernetes-power-manager.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "kubernetes-power-manager.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "kubernetes-power-manager.labels" -}}
helm.sh/chart: {{ include "kubernetes-power-manager.chart" . }}
{{ include "kubernetes-power-manager.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "kubernetes-power-manager.selectorLabels" -}}
app.kubernetes.io/name: {{ include "kubernetes-power-manager.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "kubernetes-power-manager.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "kubernetes-power-manager.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
47 changes: 47 additions & 0 deletions helm/kubernetes-power-manager-v2.3.1/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Values.operator.name }}
namespace: {{ .Values.operator.namespace }}
labels:
control-plane: {{ .Values.operator.labels.controlplane }}
spec:
selector:
matchLabels:
control-plane: {{ .Values.operator.labels.controlplane }}
replicas: {{ .Values.operator.replicas }}
template:
metadata:
labels:
control-plane: {{ .Values.operator.labels.controlplane }}
spec:
serviceAccountName: {{ .Values.operator.container.serviceaccount.name }}
containers:
- command:
- {{ .Values.operator.container.command }}
args:
- {{ .Values.operator.container.args }}
imagePullPolicy: IfNotPresent
image: {{ .Values.operator.container.image }}
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop: ["ALL"]
name: {{ .Values.operator.container.name }}
resources:
limits:
cpu: {{ .Values.operator.container.cpu.limits }}
memory: {{ .Values.operator.container.memory.limits }}
requests:
cpu: {{ .Values.operator.container.cpu.requests }}
memory: {{ .Values.operator.container.memory.requests }}
volumeMounts:
- mountPath: /sys/fs
name: cgroup
mountPropagation: HostToContainer
readOnly: true
terminationGracePeriodSeconds: 10
volumes:
- name: cgroup
hostPath:
path: /sys/fs
6 changes: 6 additions & 0 deletions helm/kubernetes-power-manager-v2.3.1/templates/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v1
kind: Namespace
metadata:
labels:
control-plane: {{ .Values.namespace.label }}
name: {{ .Values.namespace.name }}
12 changes: 12 additions & 0 deletions helm/kubernetes-power-manager-v2.3.1/templates/power-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: power.intel.com/v1
kind: PowerConfig
metadata:
name: {{ .Values.powerconfig.name }}
namespace: {{ .Values.powerconfig.namespace }}
spec:
powerNodeSelector:
feature.node.kubernetes.io/power-node: "true"
powerProfiles:
- "performance"
- "balance-performance"
- "balance-power"
Loading

0 comments on commit 693deef

Please sign in to comment.