From 50ee21a6e19be293d67615551998f5cac3bc098f Mon Sep 17 00:00:00 2001 From: nitesh3108 Date: Thu, 1 Jun 2023 09:13:13 -0400 Subject: [PATCH] ubi image updated to micro --- Dockerfile.podman | 14 ++------------ buildubimicro.sh | 24 ++++++++++++++++++++++++ docker.mk | 3 +++ helm/csi-isilon/templates/_helpers.tpl | 14 +++++++------- overrides.mk | 6 +++--- 5 files changed, 39 insertions(+), 22 deletions(-) create mode 100644 buildubimicro.sh diff --git a/Dockerfile.podman b/Dockerfile.podman index 6e9e1967..a26438ad 100644 --- a/Dockerfile.podman +++ b/Dockerfile.podman @@ -1,4 +1,4 @@ -# Copyright © 2021-2022 Dell Inc. or its subsidiaries. All Rights Reserved. +# Copyright © 2021-2023 Dell Inc. or its subsidiaries. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -26,17 +26,7 @@ RUN CGO_ENABLED=0 \ # Stage to build the driver image FROM $BASEIMAGE AS driver -# install necessary packages -# alphabetical order for easier maintenance -RUN microdnf update -y && \ - microdnf install -y \ - e4fsprogs \ - libaio \ - libuuid \ - nfs-utils \ - numactl \ - xfsprogs && \ - microdnf clean all + # copy in the driver COPY --from=builder /go/src/csi-isilon / ENTRYPOINT ["/csi-isilon"] diff --git a/buildubimicro.sh b/buildubimicro.sh new file mode 100644 index 00000000..5fc6be3f --- /dev/null +++ b/buildubimicro.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +# Copyright © 2023 Dell Inc. or its subsidiaries. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License + +# overrides file +# this file, included from the Makefile, will overlay default values with environment variables +# + +microcontainer=$(buildah from $1) +micromount=$(buildah mount $microcontainer) +dnf install --installroot $micromount --releasever=8 --nodocs --setopt install_weak_deps=false --setopt=reposdir=/etc/yum.repos.d/ libaio libuuid numactl xfsprogs e4fsprogs nfs-utils -y +dnf clean all --installroot $micromount +buildah umount $microcontainer +buildah commit $microcontainer csipowerscale-ubimicro diff --git a/docker.mk b/docker.mk index f254e6ba..b9b15aae 100644 --- a/docker.mk +++ b/docker.mk @@ -10,6 +10,9 @@ docker-build-image-push: podman-build: @echo "Base Image is set to: $(BASEIMAGE)" + @echo "Adding Driver dependencies to $(BASEIMAGE)" + bash ./buildubimicro.sh $(BASEIMAGE) + @echo "Base image build: SUCCESS" $(eval BASEIMAGE=localhost/csipowerscale-ubimicro:latest) @echo "Building: $(REGISTRY)/$(IMAGENAME):$(IMAGETAG)" $(BUILDER) build -t "$(REGISTRY)/$(IMAGENAME):$(IMAGETAG)" -f Dockerfile.podman --target $(BUILDSTAGE) --build-arg GOPROXY=$(GOPROXY) --build-arg BASEIMAGE=$(BASEIMAGE) --build-arg GOVERSION=$(GOVERSION) . diff --git a/helm/csi-isilon/templates/_helpers.tpl b/helm/csi-isilon/templates/_helpers.tpl index 2fb80664..02b2867e 100644 --- a/helm/csi-isilon/templates/_helpers.tpl +++ b/helm/csi-isilon/templates/_helpers.tpl @@ -4,7 +4,7 @@ Return the appropriate sidecar images based on k8s version {{- define "csi-isilon.attacherImage" -}} {{- if eq .Capabilities.KubeVersion.Major "1" }} {{- if and (ge (trimSuffix "+" .Capabilities.KubeVersion.Minor) "21") (le (trimSuffix "+" .Capabilities.KubeVersion.Minor) "27") -}} - {{- print "registry.k8s.io/sig-storage/csi-attacher:v4.2.0" -}} + {{- print "registry.k8s.io/sig-storage/csi-attacher:v4.3.0" -}} {{- end -}} {{- end -}} {{- end -}} @@ -12,7 +12,7 @@ Return the appropriate sidecar images based on k8s version {{- define "csi-isilon.provisionerImage" -}} {{- if eq .Capabilities.KubeVersion.Major "1" }} {{- if and (ge (trimSuffix "+" .Capabilities.KubeVersion.Minor) "21") (le (trimSuffix "+" .Capabilities.KubeVersion.Minor) "27") -}} - {{- print "registry.k8s.io/sig-storage/csi-provisioner:v3.4.0" -}} + {{- print "registry.k8s.io/sig-storage/csi-provisioner:v3.5.0" -}} {{- end -}} {{- end -}} {{- end -}} @@ -20,7 +20,7 @@ Return the appropriate sidecar images based on k8s version {{- define "csi-isilon.snapshotterImage" -}} {{- if eq .Capabilities.KubeVersion.Major "1" }} {{- if and (ge (trimSuffix "+" .Capabilities.KubeVersion.Minor) "21") (le (trimSuffix "+" .Capabilities.KubeVersion.Minor) "27") -}} - {{- print "registry.k8s.io/sig-storage/csi-snapshotter:v6.2.1" -}} + {{- print "registry.k8s.io/sig-storage/csi-snapshotter:v6.2.2" -}} {{- end -}} {{- end -}} {{- end -}} @@ -28,7 +28,7 @@ Return the appropriate sidecar images based on k8s version {{- define "csi-isilon.resizerImage" -}} {{- if eq .Capabilities.KubeVersion.Major "1" }} {{- if and (ge (trimSuffix "+" .Capabilities.KubeVersion.Minor) "21") (le (trimSuffix "+" .Capabilities.KubeVersion.Minor) "27") -}} - {{- print "registry.k8s.io/sig-storage/csi-resizer:v1.7.0" -}} + {{- print "registry.k8s.io/sig-storage/csi-resizer:v1.8.0" -}} {{- end -}} {{- end -}} {{- end -}} @@ -36,7 +36,7 @@ Return the appropriate sidecar images based on k8s version {{- define "csi-isilon.registrarImage" -}} {{- if eq .Capabilities.KubeVersion.Major "1" }} {{- if and (ge (trimSuffix "+" .Capabilities.KubeVersion.Minor) "21") (le (trimSuffix "+" .Capabilities.KubeVersion.Minor) "27") -}} - {{- print "registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.6.3" -}} + {{- print "registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.8.0" -}} {{- end -}} {{- end -}} {{- end -}} @@ -44,7 +44,7 @@ Return the appropriate sidecar images based on k8s version {{- define "csi-isilon.healthmonitorImage" -}} {{- if eq .Capabilities.KubeVersion.Major "1" }} {{- if and (ge (trimSuffix "+" .Capabilities.KubeVersion.Minor) "21") (le (trimSuffix "+" .Capabilities.KubeVersion.Minor) "27") -}} - {{- print "registry.k8s.io/sig-storage/csi-external-health-monitor-controller:v0.8.0" -}} + {{- print "registry.k8s.io/sig-storage/csi-external-health-monitor-controller:v0.9.0" -}} {{- end -}} {{- end -}} {{- end -}} @@ -58,4 +58,4 @@ Return true if storage capacity tracking is enabled and is supported based on k8 {{- true -}} {{- end -}} {{- end -}} -{{- end -}} \ No newline at end of file +{{- end -}} diff --git a/overrides.mk b/overrides.mk index 0a820366..0491b47a 100644 --- a/overrides.mk +++ b/overrides.mk @@ -1,4 +1,4 @@ -# Copyright © 2020-2022 Dell Inc. or its subsidiaries. All Rights Reserved. +# Copyright © 2020-2023 Dell Inc. or its subsidiaries. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,8 +15,8 @@ # # DEFAULT values -# ubi8/ubi-minimal:8.7-1085 -DEFAULT_BASEIMAGE="registry.access.redhat.com/ubi8/ubi-minimal@sha256:ab03679e683010d485ef0399e056b09a38d7843ba4a36ee7dec337dd0037f7a7" +# ubi8/ubi-micro:8.8-1 +DEFAULT_BASEIMAGE="registry.access.redhat.com/ubi8/ubi-micro:8.8-1" DEFAULT_GOVERSION="1.20" DEFAULT_REGISTRY="" DEFAULT_IMAGENAME="isilon"