diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index c82aab151..e802f0bcf 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -1,7 +1,6 @@ name: e2e-suite on: - push: pull_request: branches: [ main ] diff --git a/Makefile b/Makefile index 09ea22d6e..72e6239d6 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,7 @@ RELEASE_DIR := _dist # Image URL to use all building/pushing image targets IMG ?= ${STAGING_REGISTRY}/${IMAGE_NAME}:${TAG} BYOH_BASE_IMG = byoh/node:v1.22.3 +BYOH_BASE_IMG_DEV = byoh-dev/node:v1.22.3 # Produce CRDs that work back to Kubernetes 1.11 (no version conversion) CRD_OPTIONS ?= "crd:trivialVersions=true,preserveUnknownFields=false" @@ -111,6 +112,9 @@ docker-push: ## Push docker image with the manager. prepare-byoh-docker-host-image: docker build test/e2e -f test/e2e/BYOHDockerFile -t ${BYOH_BASE_IMG} +prepare-byoh-docker-host-image-dev: + docker build test/e2e -f docs/BYOHDockerFileDev -t ${BYOH_BASE_IMG_DEV} + test-e2e: docker-build prepare-byoh-docker-host-image $(GINKGO) cluster-templates ## Run the end-to-end tests CONTROL_PLANE_ENDPOINT_IP=172.18.10.151 $(GINKGO) -v -trace -tags=e2e -focus="$(GINKGO_FOCUS)" $(_SKIP_ARGS) -nodes=$(GINKGO_NODES) --noColor=$(GINKGO_NOCOLOR) $(GINKGO_ARGS) test/e2e -- \ -e2e.artifacts-folder="$(ARTIFACTS)" \ diff --git a/docs/BYOHDockerFileDev b/docs/BYOHDockerFileDev new file mode 100644 index 000000000..c22138a20 --- /dev/null +++ b/docs/BYOHDockerFileDev @@ -0,0 +1,28 @@ +ARG BASE_IMAGE=ubuntu:20.04 +FROM $BASE_IMAGE as build +ARG TARGETARCH +# install containerd +RUN apt-get update \ + && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + systemd conntrack iptables iproute2 ethtool socat util-linux mount \ + ebtables kmod libseccomp2 pigz bash ca-certificates \ + rsync nfs-common fuse-overlayfs containerd curl gnupg2 \ + && mkdir -p /etc/containerd \ + && containerd config default | tee /etc/containerd/config.toml \ + && ln -s "$(which systemd)" /sbin/init +RUN systemctl enable containerd +COPY kubernetes.list /etc/apt/sources.list.d/kubernetes.list +RUN echo "Installing kubectl kubeadm kubelet" \ + && curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - \ + && apt-get update \ + && apt-get install -y linux-image-$(uname -r) \ + && apt-get install -y kubelet=1.22.3-00 kubeadm=1.22.3-00 kubectl=1.22.3-00 \ + && apt-mark hold containerd kubelet kubeadm kubectl \ + && apt-get clean \ + && systemctl enable kubelet.service \ + && systemctl enable containerd.service + +FROM scratch +COPY --from=build / / + +ENTRYPOINT ["/sbin/init"] \ No newline at end of file diff --git a/docs/getting_started.md b/docs/getting_started.md index 3e9f88130..c61857bf4 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -81,7 +81,7 @@ If not, you could create containers to deploy your workload clusters on. We have ```shell cd cluster-api-provider-bringyourownhost -make prepare-byoh-docker-host-image +make prepare-byoh-docker-host-image-dev ``` Once the image is ready, lets start 2 docker containers for our deployment. One for the control plane, and one for the worker. (you could of course run more) diff --git a/docs/local_dev.md b/docs/local_dev.md index ca5331904..c4bc91a86 100644 --- a/docs/local_dev.md +++ b/docs/local_dev.md @@ -94,7 +94,7 @@ make host-agent-binaries ### Create docker hosts ```shell cd cluster-api-provider-bringyourownhost -make prepare-byoh-docker-host-image +make prepare-byoh-docker-host-image-dev ``` Run the following to create n hosts, where ```n>1``` ```shell diff --git a/test/e2e/BYOHDockerFile b/test/e2e/BYOHDockerFile index 26f2fdf34..b39143e2e 100644 --- a/test/e2e/BYOHDockerFile +++ b/test/e2e/BYOHDockerFile @@ -8,20 +8,8 @@ RUN apt-get update \ ebtables kmod libseccomp2 pigz bash ca-certificates \ rsync nfs-common fuse-overlayfs curl gnupg2 \ dbus ufw linux-image-$(uname -r) \ - # && mkdir -p /etc/containerd \ - # && containerd config default | tee /etc/containerd/config.toml \ && ln -s "$(which systemd)" /sbin/init -# RUN systemctl enable containerd -# COPY kubernetes.list /etc/apt/sources.list.d/kubernetes.list -# RUN echo "Installing kubectl kubeadm kubelet" \ -# && curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - \ -# && apt-get update \ -# && apt-get install -y linux-image-$(uname -r) \ -# && apt-get install -y kubelet=1.22.3-00 kubeadm=1.22.3-00 kubectl=1.22.3-00 \ -# && apt-mark hold containerd kubelet kubeadm kubectl \ -# && apt-get clean \ -# && systemctl enable kubelet.service \ -# && systemctl enable containerd.service + FROM scratch COPY --from=build / /