Skip to content

Commit dcc34c1

Browse files
committed
cleanup: v3.0.0 make bundle with devicePluginImage updates
- README.md now references new Onload Device Plugin image location - Removed unused metrics - Copyright header hack for bundle
1 parent 765ee60 commit dcc34c1

19 files changed

+284
-165
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ bin
1111
testbin/*
1212
Dockerfile.cross
1313

14+
# Moved to bundle/Dockerfile but hard-coded in Operator SDK
15+
bundle.Dockerfile
16+
1417
# Machine config output
1518
scripts/machineconfig/mc
1619

@@ -29,3 +32,6 @@ scripts/machineconfig/mc
2932
*.swp
3033
*.swo
3134
*~
35+
36+
# User generated
37+
my-*

Makefile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# To re-generate a bundle for another specific version without changing the standard setup, you can:
77
# - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.2)
88
# - use environment variables to overwrite this value (e.g export VERSION=0.0.2)
9-
VERSION ?= 0.0.1
9+
VERSION ?= 3.0.0
1010

1111
# CHANNELS define the bundle channels used in the bundle.
1212
# Add a new line here if you would like to change its default config. (E.g CHANNELS = "candidate,fast,stable")
@@ -53,10 +53,11 @@ endif
5353
# This is useful for CI or a project to utilize a specific version of the operator-sdk toolkit.
5454
OPERATOR_SDK_VERSION ?= v1.31.0
5555

56+
IMG_BASE ?= docker.io/onload
5657
# Image URL to use all building/pushing image targets
57-
IMG ?= controller:latest
58+
IMG ?= $(IMG_BASE)/onload-operator:$(VERSION)
5859
# Image URL to use for building/pushing device plugin
59-
DEVICE_IMG ?= deviceplugin:latest
60+
DEVICE_IMG ?= $(IMG_BASE)/onload-device-plugin:$(VERSION)
6061
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
6162
ENVTEST_K8S_VERSION = 1.26.0
6263

@@ -268,8 +269,11 @@ endif
268269
.PHONY: bundle
269270
bundle: manifests kustomize operator-sdk ## Generate bundle manifests and metadata, then validate generated files.
270271
$(OPERATOR_SDK) generate kustomize manifests -q
271-
cd config/manager && $(KUSTOMIZE) edit set image controller=$(IMG)
272+
cd config/manager && $(KUSTOMIZE) edit set image controller=$(IMG) deviceplugin=${DEVICE_IMG}
272273
$(KUSTOMIZE) build config/manifests | $(OPERATOR_SDK) generate bundle $(BUNDLE_GEN_FLAGS)
274+
for generated in `grep -rL --include '*.yaml' '^# SPDX-License-Identifier' bundle/`; do \
275+
cat hack/boilerplate.yaml.txt $$generated > $$generated.out && mv $$generated.out $$generated; \
276+
done
273277
$(OPERATOR_SDK) bundle validate ./bundle
274278

275279
.PHONY: bundle-build

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Use OpenOnload® or EnterpriseOnload® to accelerate your workloads in Kubernete
99
* [OpenOnload](https://github.com/Xilinx-CNS/onload) (including EnterpriseOnload) 8.1+
1010
* [AMD Solarflare](https://www.solarflare.com) hardware (`sfc`)
1111
* OpenShift Container Platform (OCP) 4.10+ with
12-
* [Kernel Module Management (KMM) Operator](https://kmm.sigs.k8s.io/) 1.1 ([OpenShift documentation](https://docs.openshift.com/container-platform/4.14/hardware_enablement/kmm-kernel-module-management.html)
12+
* [Kernel Module Management (KMM) Operator](https://kmm.sigs.k8s.io/) 1.1 ([OpenShift documentation](https://docs.openshift.com/container-platform/4.14/hardware_enablement/kmm-kernel-module-management.html))
1313
* Both restricted network or internet-connected clusters
1414

1515
Deployment can also be performed on Kubernetes 1.23+ but full implementation details are not currently provided.
@@ -121,9 +121,9 @@ an `Onload` *kind* of Custom Resource (CR).
121121

122122
#### Local Onload Operator images in restricted networks
123123

124-
For restricted networks, the `onload-operator` image location will require changing from its DockerHub default.
125-
To run the above command using locally hosted container images, open this repository locally and use the
126-
[following overlay](config/samples/default-clusterlocal/kustomization.yaml):
124+
For restricted networks, the `onload-operator` and `onload-device-plugin` image locations will require changing from
125+
their DockerHub defaults. To run the above command using locally hosted container images, open this repository
126+
locally and use the [following overlay](config/samples/default-clusterlocal/kustomization.yaml):
127127

128128
```sh
129129
git clone -b v3.0 https://github.com/Xilinx-CNS/kubernetes-onload && cd kubernetes-onload
@@ -140,8 +140,9 @@ to expose a [Kubernetes Resource](https://kubernetes.io/docs/concepts/configurat
140140
named `amd.com/onload`.
141141

142142
It is distributed as the container image `onload-device-plugin` and is deployed and configured entirely by
143-
the Onload Operator. You can configure the image location and its settings via the Onload Operator within
144-
a [Onload Custom Resource (CR)](#onload-custom-resource-cr).
143+
the Onload Operator. Its image location is configured as an environment variable within the Onload Operator deployment
144+
([see above](#local-onload-operator-images-in-restricted-networks)) and its ImagePullPolicy as part of
145+
[Onload Custom Resource (CR)](#onload-custom-resource-cr) along with its other customisation properties.
145146

146147
### Onload Custom Resource (CR)
147148

@@ -163,7 +164,6 @@ this recommended overlay further, see the variant steps below.
163164
The above overlay configures KMM to `modprobe onload` but `modprobe sfc` is also required.
164165
Please see [Out-of-tree `sfc` module](#out-of-tree-sfc-kernel-module) for options.
165166

166-
167167
> [!IMPORTANT]
168168
> Due to Kubernetes limitations on label lengths, the combined length of the Name and Namespace of the Onload CR must be less than 32 characters.
169169
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# SPDX-License-Identifier: MIT
2+
# SPDX-FileCopyrightText: (c) Copyright 2023 Advanced Micro Devices, Inc.
3+
apiVersion: v1
4+
data:
5+
dockerfile: |+
6+
# SPDX-License-Identifier: MIT
7+
# SPDX-FileCopyrightText: (c) Copyright 2023 Advanced Micro Devices, Inc.
8+
# hadolint global ignore=DL3006,DL3059,DL3040,DL3041
9+
ARG DTK_AUTO
10+
ARG ONLOAD_SOURCE=onload-source
11+
ARG UBI_BASE=registry.access.redhat.com/ubi9/ubi-minimal:9.2
12+
13+
14+
FROM $ONLOAD_SOURCE as onload-source
15+
16+
17+
FROM $DTK_AUTO as builder
18+
ARG ONLOAD_BUILD_PARAMS
19+
ARG KERNEL_FULL_VERSION
20+
COPY --from=onload-source / /opt/onload
21+
WORKDIR /opt/onload
22+
RUN scripts/onload_build --kernel --kernelver $KERNEL_FULL_VERSION $ONLOAD_BUILD_PARAMS
23+
RUN scripts/onload_install --nobuild --kernelfiles --kernelver $KERNEL_FULL_VERSION
24+
RUN depmod $KERNEL_FULL_VERSION
25+
26+
27+
# ON-15418: Consider reducing deps
28+
FROM $UBI_BASE
29+
ARG KERNEL_FULL_VERSION
30+
RUN microdnf install -y kmod && microdnf clean all
31+
COPY --from=builder /lib/modules/$KERNEL_FULL_VERSION/modules* /opt/lib/modules/$KERNEL_FULL_VERSION/
32+
COPY --from=builder /lib/modules/$KERNEL_FULL_VERSION/extra /opt/lib/modules/$KERNEL_FULL_VERSION/extra
33+
RUN ln -s /lib/modules/$KERNEL_FULL_VERSION/kernel /opt/lib/modules/$KERNEL_FULL_VERSION/kernel
34+
35+
kind: ConfigMap
36+
metadata:
37+
name: onload-module-dockerfile-ch29bghg54

bundle/manifests/onload-operator-controller-manager-metrics-service_v1_service.yaml

Lines changed: 0 additions & 25 deletions
This file was deleted.

bundle/manifests/onload-operator-metrics-reader_rbac.authorization.k8s.io_v1_clusterrole.yaml

Lines changed: 0 additions & 19 deletions
This file was deleted.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# SPDX-License-Identifier: MIT
2+
# SPDX-FileCopyrightText: (c) Copyright 2023 Advanced Micro Devices, Inc.
3+
apiVersion: rbac.authorization.k8s.io/v1
4+
kind: RoleBinding
5+
metadata:
6+
creationTimestamp: null
7+
name: onload-operator-rb
8+
roleRef:
9+
apiGroup: rbac.authorization.k8s.io
10+
kind: Role
11+
name: onload-operator-role
12+
subjects:
13+
- kind: ServiceAccount
14+
name: onload-operator-sa
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# SPDX-License-Identifier: MIT
2+
# SPDX-FileCopyrightText: (c) Copyright 2023 Advanced Micro Devices, Inc.
3+
apiVersion: rbac.authorization.k8s.io/v1
4+
kind: Role
5+
metadata:
6+
creationTimestamp: null
7+
name: onload-operator-role
8+
rules:
9+
- apiGroups:
10+
- security.openshift.io
11+
resourceNames:
12+
- privileged
13+
resources:
14+
- securitycontextconstraints
15+
verbs:
16+
- use
17+
- apiGroups:
18+
- ""
19+
resources:
20+
- pods
21+
verbs:
22+
- get
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# SPDX-License-Identifier: MIT
22
# SPDX-FileCopyrightText: (c) Copyright 2023 Advanced Micro Devices, Inc.
3-
resources:
4-
- base
3+
apiVersion: v1
4+
kind: ServiceAccount
5+
metadata:
6+
creationTimestamp: null
7+
name: onload-operator-sa

0 commit comments

Comments
 (0)