From b082b3aab05da5c3ef859f49577c953386b6a04d Mon Sep 17 00:00:00 2001 From: Modassar Rana Date: Fri, 17 May 2024 12:45:23 +0530 Subject: [PATCH 1/4] Update Dockerfile.develop Signed-off-by: Modassar Rana --- Dockerfile.develop | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/Dockerfile.develop b/Dockerfile.develop index a8d6d1e0..6c4fd8c7 100644 --- a/Dockerfile.develop +++ b/Dockerfile.develop @@ -76,8 +76,10 @@ ARG TARGETARCH ARG OPENSHIFT_VERSION=4.12 ARG KUSTOMIZE_VERSION=4.5.2 -ARG KUBEBUILDER_VERSION=v3.11.0 +ARG KUBEBUILDER_VERSION=v3.14.0 ARG CONTROLLER_GEN_VERSION=v0.11.4 +ARG ETCD_VERSION=v3.5.6 +ARG APISERVER_VERSION=v1.25.0 ENV PATH=/usr/local/go/bin:$PATH:/usr/local/kubebuilder/bin: @@ -102,14 +104,30 @@ ENV PIP_CACHE_DIR=/root/.cache/pip RUN --mount=type=cache,target=/root/.cache/pip \ pip install pre-commit -# First download and extract older dist of kubebuilder which includes required etcd, kube-apiserver and kubectl binaries -# Then download and overwrite kubebuilder binary with desired/latest version +#Older version of kubebuilder doesn't have s390x tar file. Individually installing etcd , kube-apiserver , kubebuilder , kubectl for all architecture (amd64, arm64 , pp64cle & s390x) RUN true \ - && curl -L https://github.com/kubernetes-sigs/kubebuilder/releases/download/v2.3.2/kubebuilder_2.3.2_${TARGETOS:-linux}_${TARGETARCH:-amd64}.tar.gz | tar -xz -C /tmp/ \ - && mv /tmp/kubebuilder_*_${TARGETOS:-linux}_${TARGETARCH:-amd64} /usr/local/kubebuilder \ + && mkdir -p /usr/local/kubebuilder/bin \ && curl -L https://github.com/kubernetes-sigs/kubebuilder/releases/download/${KUBEBUILDER_VERSION}/kubebuilder_${TARGETOS:-linux}_${TARGETARCH:-amd64} -o /usr/local/kubebuilder/bin/kubebuilder \ + && chmod +x /usr/local/kubebuilder/bin/kubebuilder \ && true +RUN true \ + && wget https://dl.k8s.io/${APISERVER_VERSION}/bin/${TARGETOS:-linux}/${TARGETARCH:-amd64}/kube-apiserver \ + && mv kube-apiserver /usr/local/kubebuilder/bin \ + && chmod +x /usr/local/kubebuilder/bin/kube-apiserver \ + && kube-apiserver --version \ + && true + +ENV PATH=/usr/local/go/bin:$PATH:/usr/local/kubebuilder/bin/etcd-${ETCD_VERSION}-${TARGETOS:-linux}-${TARGETARCH:-amd64}: + +RUN true \ + && wget https://github.com/etcd-io/etcd/releases/download/${ETCD_VERSION}/etcd-${ETCD_VERSION}-${TARGETOS:-linux}-${TARGETARCH:-amd64}.tar.gz \ + && tar -C /usr/local/kubebuilder/bin -xvzf etcd-${ETCD_VERSION}-${TARGETOS:-linux}-${TARGETARCH:-amd64}.tar.gz \ + && chmod +x /usr/local/kubebuilder/bin/etcd-${ETCD_VERSION}-${TARGETOS:-linux}-${TARGETARCH:-amd64}/etcd \ + && etcd --version \ + && true + + # Download openshift-cli RUN true \ && curl -sSLf --output /tmp/oc_client.tar.gz https://mirror.openshift.com/pub/openshift-v4/${TARGETARCH:-amd64}/clients/ocp/latest-${OPENSHIFT_VERSION}/openshift-client-${TARGETOS:-linux}.tar.gz \ @@ -158,10 +176,10 @@ RUN true \ && ginkgo version \ && true -# Use setup-envtest for kubebuilder to use K8s version 1.23+ for autoscaling/v2 (HPA) +# Use setup-envtest for kubebuilder to use K8s version 1.23+ for autoscaling/v2 (HPA).kubebuilder tool 1.29 works fine with s390x & other architecture RUN true \ && go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest \ - && setup-envtest use 1.26 \ + && setup-envtest use 1.29 \ && true # For GitHub Action 'lint', work around error "detected dubious ownership in repository at '/workspace'" From e69bd83c34be3e14b9711b007041675f01e18d16 Mon Sep 17 00:00:00 2001 From: Modassar Rana Date: Tue, 28 May 2024 10:18:25 +0530 Subject: [PATCH 2/4] Update Dockerfile.develop Signed-off-by: Modassar Rana --- Dockerfile.develop | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Dockerfile.develop b/Dockerfile.develop index 6c4fd8c7..9ba6821f 100644 --- a/Dockerfile.develop +++ b/Dockerfile.develop @@ -104,7 +104,7 @@ ENV PIP_CACHE_DIR=/root/.cache/pip RUN --mount=type=cache,target=/root/.cache/pip \ pip install pre-commit -#Older version of kubebuilder doesn't have s390x tar file. Individually installing etcd , kube-apiserver , kubebuilder , kubectl for all architecture (amd64, arm64 , pp64cle & s390x) +# Older version of kubebuilder doesn't have s390x tar file. Individually installing etcd , kube-apiserver , kubebuilder , kubectl for all architecture (amd64, arm64 , pp64cle & s390x) RUN true \ && mkdir -p /usr/local/kubebuilder/bin \ && curl -L https://github.com/kubernetes-sigs/kubebuilder/releases/download/${KUBEBUILDER_VERSION}/kubebuilder_${TARGETOS:-linux}_${TARGETARCH:-amd64} -o /usr/local/kubebuilder/bin/kubebuilder \ @@ -127,7 +127,6 @@ RUN true \ && etcd --version \ && true - # Download openshift-cli RUN true \ && curl -sSLf --output /tmp/oc_client.tar.gz https://mirror.openshift.com/pub/openshift-v4/${TARGETARCH:-amd64}/clients/ocp/latest-${OPENSHIFT_VERSION}/openshift-client-${TARGETOS:-linux}.tar.gz \ @@ -176,7 +175,7 @@ RUN true \ && ginkgo version \ && true -# Use setup-envtest for kubebuilder to use K8s version 1.23+ for autoscaling/v2 (HPA).kubebuilder tool 1.29 works fine with s390x & other architecture +# Use setup-envtest for kubebuilder to use K8s version 1.23+ for autoscaling/v2 (HPA), and 1.29+ for s390x & other architectures RUN true \ && go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest \ && setup-envtest use 1.29 \ From 66b4985e16e526906a50dfc4daa64066e21c5b90 Mon Sep 17 00:00:00 2001 From: Modassar Rana Date: Mon, 15 Jul 2024 17:40:47 +0530 Subject: [PATCH 3/4] Update Dockerfile.develop Signed-off-by: Modassar Rana --- Dockerfile.develop | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile.develop b/Dockerfile.develop index 3ff78d2a..dbf88115 100644 --- a/Dockerfile.develop +++ b/Dockerfile.develop @@ -132,10 +132,11 @@ RUN true \ && ginkgo version \ && true -# Use setup-envtest for kubebuilder to use K8s version 1.23+ for autoscaling/v2 (HPA), and 1.29+ for s390x & other architectures +# Use setup-entest for kubebuilder to use K8s version 1.23+ for autoscaling/v2 (HPA) +# Pin envest to specific version until update to go 1.22 RUN true \ - && go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest \ - && setup-envtest use 1.29 \ + && go install sigs.k8s.io/controller-runtime/tools/setup-envtest@v0.0.0-20240320141353-395cfc74866 \ + && setup-envtest use 1.26 \ && true # For GitHub Action 'lint', work around error "detected dubious ownership in repository at '/workspace'" From 11c4078ab324aa68d05a4cbbe73c4841d48a6126 Mon Sep 17 00:00:00 2001 From: Modassar Rana Date: Mon, 15 Jul 2024 17:42:06 +0530 Subject: [PATCH 4/4] Update Dockerfile.develop Signed-off-by: Modassar Rana --- Dockerfile.develop | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile.develop b/Dockerfile.develop index dbf88115..cf5fae93 100644 --- a/Dockerfile.develop +++ b/Dockerfile.develop @@ -132,10 +132,10 @@ RUN true \ && ginkgo version \ && true -# Use setup-entest for kubebuilder to use K8s version 1.23+ for autoscaling/v2 (HPA) -# Pin envest to specific version until update to go 1.22 +# Use setup-envtest for kubebuilder to use K8s version 1.23+ for autoscaling/v2 (HPA) +# Pin envtest to specific version until update to go 1.22 RUN true \ - && go install sigs.k8s.io/controller-runtime/tools/setup-envtest@v0.0.0-20240320141353-395cfc74866 \ + && go install sigs.k8s.io/controller-runtime/tools/setup-envtest@v0.0.0-20240320141353-395cfc7486e6 \ && setup-envtest use 1.26 \ && true