Skip to content

Commit bbdd56a

Browse files
authored
feat(build): publish FIPS-enabled images and add global.fips helm option (#1882)
Signed-off-by: gshaibi <gshaibi@nvidia.com>
1 parent 6a5c96e commit bbdd56a

13 files changed

Lines changed: 199 additions & 16 deletions

File tree

.github/workflows/push-artifacts.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,41 @@ jobs:
6464
- name: Push Helm Chart
6565
run: |
6666
helm push ./charts/kai-scheduler-$PACKAGE_VERSION.tgz oci://${{ env.DOCKER_REGISTRY }}
67+
68+
build-and-push-fips:
69+
name: Build & Push FIPS
70+
if: startsWith(github.ref, 'refs/tags/')
71+
runs-on: ubuntu-latest
72+
steps:
73+
- name: Checkout code
74+
uses: actions/checkout@v7
75+
76+
- name: Extract package version from tag
77+
run: |
78+
PACKAGE_VERSION=${GITHUB_REF_NAME}
79+
echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV
80+
echo $PACKAGE_VERSION
81+
82+
- name: Set up Go
83+
uses: actions/setup-go@v6
84+
with:
85+
go-version: '1.26.3'
86+
87+
- name: Log in to GitHub Container Registry
88+
uses: docker/login-action@v4
89+
with:
90+
registry: ghcr.io
91+
username: ${{ github.actor }}
92+
password: ${{ secrets.GITHUB_TOKEN }}
93+
94+
- name: Set up Docker Buildx
95+
uses: docker/setup-buildx-action@v4
96+
97+
- name: Docker build & push FIPS images
98+
run: make build FIPS=1 DOCKER_BUILD_PLATFORM=linux/amd64,linux/arm64 DOCKER_REPO_BASE=${{ env.DOCKER_REGISTRY }} VERSION=$PACKAGE_VERSION DOCKER_BUILDX_ADDITIONAL_ARGS=--push
99+
100+
- name: Verify binaries are FIPS-enabled
101+
run: |
102+
for f in bin/*-amd64 bin/*-arm64; do
103+
go version -m "$f" | grep -q 'GOFIPS140=v1.0.0' || { echo "$f is not FIPS-enabled"; exit 1; }
104+
done

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
66

77
## [Unreleased]
88

9+
### Added
10+
- Publish FIPS-enabled image variants (`<version>-fips`) for every release, built with the Go toolchain's native FIPS 140-3 mode (`GOFIPS140`), and added a `global.fips` Helm value (default `false`) that appends `-fips` to every resolved image tag ([guide](docs/fips/README.md)). [#1867](https://github.com/kai-scheduler/KAI-Scheduler/issues/1867)
11+
912
### Fixed
1013
- Scoped the operator's informer cache for Pods, Leases and EndpointSlices to the KAI namespace and stripped managed fields from cached objects. Since v0.15.0 the operator cached every such object in the cluster, so its memory grew with cluster size and exceeded the default 256Mi limit on large clusters. [#1780](https://github.com/kai-scheduler/KAI-Scheduler/issues/1780)
1114
- Block NaN value for fraction in the pod admission [#1798](https://github.com/kai-scheduler/KAI-Scheduler/issues/1798) [davidLif](https://github.com/davidLif)
@@ -22,6 +25,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
2225
## [v0.16.1] - 2026-06-28
2326

2427
### Added
28+
- Added `global.resourceReservation.createNamespace` Helm value (default `true`) to allow disabling creation of the resource-reservation namespace, for embedding KAI in a parent chart that creates the namespace itself.
29+
- Added `global.resourceReservation.createServiceAccount` Helm value (default `true`) to allow disabling creation of the resource-reservation ServiceAccount, for embedding KAI in a parent chart that creates the ServiceAccount itself.
2530
- Added `defaultPriorityClasses.enabled` Helm value (default `true`) for installations that manage KAI PriorityClasses externally.
2631

2732
### Changed

build/makefile/base.mk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ CRD_UPGRADER_DOCKERFILE_PATH=./deployments/crd-upgrader/Dockerfile
1414
DOCKER_TAG?=0.0.0
1515
VERSION?=${DOCKER_TAG}
1616

17+
FIPS?=0
18+
ifeq ($(FIPS), 1)
19+
override VERSION := ${VERSION}-fips
20+
endif
21+
1722
DOCKER_REPO_BASE?=registry/local/kai-scheduler
1823
DOCKER_REPO_FULL?=${DOCKER_REPO_BASE}/${SERVICE_NAME}
1924
DOCKER_IMAGE_NAME?=${DOCKER_REPO_FULL}:${VERSION}

build/makefile/golang.mk

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ GOLANGCI_LINT_VERSION=v2.11.3
2828
## Tool Versions
2929
CGO_ENABLED?=1
3030

31+
## FIPS
32+
GOFIPS140_VERSION?=v1.0.0
33+
3134
## Version Variables
3235
BUILD_DATE := $(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
3336
GIT_COMMIT := $(shell git rev-parse HEAD 2>/dev/null || echo "unknown")
@@ -43,6 +46,9 @@ LDFLAGS := -X '$(VERSION_PKG).buildDate=$(BUILD_DATE)' \
4346

4447
### GO
4548
DOCKER_GO_BASE_COMMAND=${DOCKER_COMMAND} -e CGO_ENABLED=${CGO_ENABLED} -e GO111MODULE=on ${DOCKER_GO_CACHING_VOLUME_AND_ENV}
49+
ifeq ($(FIPS), 1)
50+
DOCKER_GO_BASE_COMMAND += -e GOFIPS140=${GOFIPS140_VERSION}
51+
endif
4652

4753
GO_ENV_ARCH_AMD=-e GOOS=linux -e GOARCH=amd64 -e CC=x86_64-linux-gnu-gcc -e CXX=x86_64-linux-gnu-g++
4854
GO_ENV_ARCH_ARM=-e GOOS=linux -e GOARCH=arm64 -e CC=aarch64-linux-gnu-gcc -e CXX=aarch64-linux-gnu-g++

deployments/kai-scheduler/templates/_helpers.tpl

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
{{/*
2+
Resolves a component image tag: explicit tag, then global.tag, then the chart
3+
version. When global.fips is set, appends "-fips" to whatever tag resolves so
4+
the FIPS image variants are used. Usage:
5+
{{ include "kai-scheduler.imageTag" (dict "root" $ "tag" .Values.<svc>.image.tag) }}
6+
*/}}
7+
{{- define "kai-scheduler.imageTag" -}}
8+
{{- $tag := .tag | default .root.Values.global.tag | default .root.Chart.AppVersion -}}
9+
{{- if .root.Values.global.fips -}}{{- $tag = printf "%s-fips" $tag -}}{{- end -}}
10+
{{- $tag -}}
11+
{{- end -}}
12+
113
{{/*
214
Renders the kai-config Config CR. Used by the kai-config-deployer hook
315
ConfigMap so the operator's input config can be applied via kubectl
@@ -65,7 +77,7 @@ spec:
6577
image:
6678
name: {{ .Values.binder.image.name }}
6779
repository: {{ .Values.global.registry }}
68-
tag: {{ .Values.binder.image.tag | default .Values.global.tag | default .Chart.AppVersion }}
80+
tag: {{ include "kai-scheduler.imageTag" (dict "root" $ "tag" .Values.binder.image.tag) }}
6981
pullPolicy: {{ .Values.binder.image.pullPolicy | default .Values.global.imagePullPolicy }}
7082
{{- if .Values.binder.resources }}
7183
resources:
@@ -92,7 +104,7 @@ spec:
92104
image:
93105
name: {{ .Values.binder.resourceReservationImage.name }}
94106
repository: {{ .Values.global.registry }}
95-
tag: {{ .Values.binder.resourceReservationImage.tag | default .Values.global.tag | default .Chart.AppVersion }}
107+
tag: {{ include "kai-scheduler.imageTag" (dict "root" $ "tag" .Values.binder.resourceReservationImage.tag) }}
96108
pullPolicy: {{ .Values.binder.resourceReservationImage.pullPolicy | default .Values.global.imagePullPolicy }}
97109
{{- if .Values.binder.resourceReservationPodResources }}
98110
podResources:
@@ -112,7 +124,7 @@ spec:
112124
image:
113125
name: {{ .Values.podgrouper.image.name }}
114126
repository: {{ .Values.global.registry }}
115-
tag: {{ .Values.podgrouper.image.tag | default .Values.global.tag | default .Chart.AppVersion }}
127+
tag: {{ include "kai-scheduler.imageTag" (dict "root" $ "tag" .Values.podgrouper.image.tag) }}
116128
pullPolicy: {{ .Values.podgrouper.image.pullPolicy | default .Values.global.imagePullPolicy }}
117129
{{- if .Values.podgrouper.resources }}
118130
resources:
@@ -129,7 +141,7 @@ spec:
129141
image:
130142
name: {{ .Values.podgroupcontroller.image.name }}
131143
repository: {{ .Values.global.registry }}
132-
tag: {{ .Values.podgroupcontroller.image.tag | default .Values.global.tag | default .Chart.AppVersion }}
144+
tag: {{ include "kai-scheduler.imageTag" (dict "root" $ "tag" .Values.podgroupcontroller.image.tag) }}
133145
pullPolicy: {{ .Values.podgroupcontroller.image.pullPolicy | default .Values.global.imagePullPolicy }}
134146
{{- if .Values.podgroupcontroller.resources }}
135147
resources:
@@ -146,7 +158,7 @@ spec:
146158
image:
147159
name: {{ .Values.queuecontroller.image.name }}
148160
repository: {{ .Values.global.registry }}
149-
tag: {{ .Values.queuecontroller.image.tag | default .Values.global.tag | default .Chart.AppVersion }}
161+
tag: {{ include "kai-scheduler.imageTag" (dict "root" $ "tag" .Values.queuecontroller.image.tag) }}
150162
pullPolicy: {{ .Values.queuecontroller.image.pullPolicy | default .Values.global.imagePullPolicy }}
151163
{{- if .Values.queuecontroller.resources }}
152164
resources:
@@ -163,7 +175,7 @@ spec:
163175
image:
164176
name: {{ .Values.admission.image.name }}
165177
repository: {{ .Values.global.registry }}
166-
tag: {{ .Values.admission.image.tag | default .Values.global.tag | default .Chart.AppVersion }}
178+
tag: {{ include "kai-scheduler.imageTag" (dict "root" $ "tag" .Values.admission.image.tag) }}
167179
pullPolicy: {{ .Values.admission.image.pullPolicy | default .Values.global.imagePullPolicy }}
168180
{{- if .Values.admission.resources }}
169181
resources:
@@ -200,7 +212,7 @@ spec:
200212
image:
201213
name: {{ .Values.nodescaleadjuster.image.name }}
202214
repository: {{ .Values.global.registry }}
203-
tag: {{ .Values.nodescaleadjuster.image.tag | default .Values.global.tag | default .Chart.AppVersion }}
215+
tag: {{ include "kai-scheduler.imageTag" (dict "root" $ "tag" .Values.nodescaleadjuster.image.tag) }}
204216
pullPolicy: {{ .Values.nodescaleadjuster.image.pullPolicy | default .Values.global.imagePullPolicy }}
205217
{{- if .Values.nodescaleadjuster.resources }}
206218
resources:
@@ -215,7 +227,7 @@ spec:
215227
scalingPodImage:
216228
name: {{ .Values.nodescaleadjuster.scalingPodImage.name }}
217229
repository: {{ .Values.global.registry }}
218-
tag: {{ .Values.nodescaleadjuster.scalingPodImage.tag | default .Values.global.tag | default .Chart.AppVersion }}
230+
tag: {{ include "kai-scheduler.imageTag" (dict "root" $ "tag" .Values.nodescaleadjuster.scalingPodImage.tag) }}
219231
pullPolicy: {{ .Values.nodescaleadjuster.scalingPodImage.pullPolicy | default .Values.global.imagePullPolicy }}
220232

221233
scheduler:
@@ -224,7 +236,7 @@ spec:
224236
image:
225237
name: {{ .Values.scheduler.image.name }}
226238
repository: {{ .Values.global.registry }}
227-
tag: {{ .Values.scheduler.image.tag | default .Values.global.tag | default .Chart.AppVersion }}
239+
tag: {{ include "kai-scheduler.imageTag" (dict "root" $ "tag" .Values.scheduler.image.tag) }}
228240
pullPolicy: {{ .Values.scheduler.image.pullPolicy | default .Values.global.imagePullPolicy }}
229241
{{- if .Values.scheduler.resources }}
230242
resources:
@@ -255,7 +267,7 @@ spec:
255267
image:
256268
name: {{ .Values.numaPlacementExporter.image.name }}
257269
repository: {{ .Values.global.registry }}
258-
tag: {{ .Values.numaPlacementExporter.image.tag | default .Values.global.tag | default .Chart.AppVersion }}
270+
tag: {{ include "kai-scheduler.imageTag" (dict "root" $ "tag" .Values.numaPlacementExporter.image.tag) }}
259271
pullPolicy: {{ .Values.numaPlacementExporter.image.pullPolicy | default .Values.global.imagePullPolicy }}
260272
{{- if .Values.numaPlacementExporter.resources }}
261273
resources:

deployments/kai-scheduler/templates/hooks/post/kai-config-deployer/job.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ spec:
4848
{{- end }}
4949
containers:
5050
- name: deployer
51-
image: "{{ .Values.kaiConfigDeployer.image.registry | default .Values.global.registry }}/{{ .Values.kaiConfigDeployer.image.name }}:{{ .Values.kaiConfigDeployer.image.tag | default .Values.global.tag | default .Chart.AppVersion }}"
51+
image: "{{ .Values.kaiConfigDeployer.image.registry | default .Values.global.registry }}/{{ .Values.kaiConfigDeployer.image.name }}:{{ include "kai-scheduler.imageTag" (dict "root" $ "tag" .Values.kaiConfigDeployer.image.tag) }}"
5252
imagePullPolicy: {{ .Values.kaiConfigDeployer.image.pullPolicy }}
5353
{{- with .Values.kaiConfigDeployer.resources }}
5454
resources:

deployments/kai-scheduler/templates/hooks/post/post-delete-job.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ spec:
4646
{{- end }}
4747
containers:
4848
- name: deleter
49-
image: "{{ .Values.global.registry }}/{{ .Values.postCleanup.image.name }}:{{ .Values.postCleanup.image.tag | default .Values.global.tag | default .Chart.AppVersion }}"
49+
image: "{{ .Values.global.registry }}/{{ .Values.postCleanup.image.name }}:{{ include "kai-scheduler.imageTag" (dict "root" $ "tag" .Values.postCleanup.image.tag) }}"
5050
imagePullPolicy: {{ .Values.postCleanup.image.pullPolicy }}
5151
{{- with .Values.postCleanup.resources }}
5252
resources:

deployments/kai-scheduler/templates/hooks/pre/crd-upgrader.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ spec:
3939
{{- end }}
4040
containers:
4141
- name: upgrader
42-
image: "{{ .Values.crdupgrader.image.registry | default .Values.global.registry }}/{{ .Values.crdupgrader.image.name }}:{{ .Values.crdupgrader.image.tag | default .Values.global.tag | default .Chart.AppVersion }}"
42+
image: "{{ .Values.crdupgrader.image.registry | default .Values.global.registry }}/{{ .Values.crdupgrader.image.name }}:{{ include "kai-scheduler.imageTag" (dict "root" $ "tag" .Values.crdupgrader.image.tag) }}"
4343
imagePullPolicy: {{ .Values.crdupgrader.image.pullPolicy }}
4444
{{- with .Values.crdupgrader.resources }}
4545
resources:

deployments/kai-scheduler/templates/hooks/pre/topology-migration/job.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ spec:
4040
{{- end }}
4141
containers:
4242
- name: migration
43-
image: "{{ .Values.global.registry }}/{{ .Values.topologyMigration.image.name }}:{{ .Values.topologyMigration.image.tag | default .Values.global.tag | default .Chart.AppVersion }}"
43+
image: "{{ .Values.global.registry }}/{{ .Values.topologyMigration.image.name }}:{{ include "kai-scheduler.imageTag" (dict "root" $ "tag" .Values.topologyMigration.image.tag) }}"
4444
imagePullPolicy: {{ .Values.topologyMigration.image.pullPolicy }}
4545
{{- with .Values.topologyMigration.resources }}
4646
resources:

deployments/kai-scheduler/templates/services/operator.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ spec:
2121
serviceAccountName: kai-operator
2222
containers:
2323
- name: operator
24-
image: {{ .Values.global.registry }}/{{ .Values.operator.image.name }}:{{ .Values.operator.image.tag | default .Values.global.tag | default .Chart.AppVersion }}
24+
image: {{ .Values.global.registry }}/{{ .Values.operator.image.name }}:{{ include "kai-scheduler.imageTag" (dict "root" $ "tag" .Values.operator.image.tag) }}
2525
imagePullPolicy: {{ .Values.operator.image.pullPolicy }}
2626
{{- with .Values.operator.resources }}
2727
resources:
@@ -52,7 +52,7 @@ spec:
5252
- name: MS_REPOSITORY
5353
value: {{ .Values.global.registry }}
5454
- name: MS_TAG
55-
value: {{ .Values.operator.image.tag | default .Values.global.tag | default .Chart.AppVersion }}
55+
value: {{ include "kai-scheduler.imageTag" (dict "root" $ "tag" .Values.operator.image.tag) }}
5656
ports:
5757
- containerPort: 8080
5858
name: metrics

0 commit comments

Comments
 (0)