Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Maintain two different Dockerfiles
Browse files Browse the repository at this point in the history
anusha94 committed Jan 13, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 1393444 commit d393209
Showing 6 changed files with 35 additions and 16 deletions.
1 change: 0 additions & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: e2e-suite

on:
push:
pull_request:
branches: [ main ]

4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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)" \
28 changes: 28 additions & 0 deletions docs/BYOHDockerFileDev
Original file line number Diff line number Diff line change
@@ -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"]
2 changes: 1 addition & 1 deletion docs/getting_started.md
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 1 addition & 1 deletion docs/local_dev.md
Original file line number Diff line number Diff line change
@@ -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
14 changes: 1 addition & 13 deletions test/e2e/BYOHDockerFile
Original file line number Diff line number Diff line change
@@ -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 / /

0 comments on commit d393209

Please sign in to comment.