mirror of https://github.com/k3s-io/k3s
Make kubemark work on Jenkins
parent
99e2605302
commit
9a74980da2
|
@ -1,7 +1,6 @@
|
|||
FROM debian:jessie
|
||||
|
||||
COPY kubemark.sh /kubemark.sh
|
||||
COPY kubernetes-server-linux-amd64.tar.gz /tmp/kubemark.tar.gz
|
||||
COPY build-kubemark.sh /build-kubemark.sh
|
||||
RUN chmod a+x /kubemark.sh
|
||||
|
||||
RUN /build-kubemark.sh
|
||||
COPY kubemark /kubemark
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
# build Kubemark image from currently built binaries containing both 'real' master and Hollow Node
|
||||
# build Kubemark image from currently built binaries containing both 'real' master and Hollow Node.
|
||||
# This makefile assumes that the kubemark binary is present in this directory.
|
||||
|
||||
all:
|
||||
cp ../../../_output/release-tars/kubernetes-server-linux-amd64.tar.gz .
|
||||
docker build -t gcr.io/$(PROJECT)/kubemark .
|
||||
gcloud docker push gcr.io/$(PROJECT)/kubemark
|
||||
rm kubernetes-server-linux-amd64.tar.gz
|
||||
|
||||
.PHONY: all
|
||||
|
|
|
@ -23,8 +23,7 @@ update-ca-certificates
|
|||
|
||||
chmod a+x /kubemark.sh
|
||||
|
||||
tar xzf /tmp/kubemark.tar.gz
|
||||
cp kubernetes/server/bin/kubemark /
|
||||
cp kubemark /
|
||||
|
||||
rm -rf /tmp/*
|
||||
apt-get clean -y
|
||||
|
|
|
@ -87,6 +87,7 @@ readonly KUBE_TEST_BINARIES_WIN=("${KUBE_TEST_BINARIES[@]/%/.exe}")
|
|||
readonly KUBE_TEST_PORTABLE=(
|
||||
test/images/network-tester/rc.json
|
||||
test/images/network-tester/service.json
|
||||
test/kubemark
|
||||
hack/e2e.go
|
||||
hack/e2e-internal
|
||||
hack/ginkgo-e2e.sh
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
# limitations under the License.
|
||||
|
||||
# Script that creates a Kubemark cluster with Master running on GCE.
|
||||
|
||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
|
||||
|
||||
source "${KUBE_ROOT}/cluster/kubemark/config-default.sh"
|
||||
|
@ -23,9 +24,24 @@ source "${KUBE_ROOT}/cluster/kubemark/util.sh"
|
|||
detect-project &> /dev/null
|
||||
export PROJECT
|
||||
|
||||
|
||||
RUN_FROM_DISTRO=${RUN_FROM_DISTRO:-false}
|
||||
MAKE_DIR="${KUBE_ROOT}/cluster/images/kubemark"
|
||||
|
||||
if [ "${RUN_FROM_DISTRO}" == "false" ]; then
|
||||
# Running from repository
|
||||
cp "${KUBE_ROOT}/_output/release-stage/server/linux-amd64/kubernetes/server/bin/kubemark" "${MAKE_DIR}"
|
||||
else
|
||||
cp "${KUBE_ROOT}/server/kubernetes-server-linux-amd64.tar.gz" "."
|
||||
tar -xzf kubernetes-server-linux-amd64.tar.gz
|
||||
cp "kubernetes/server/bin/kubemark" "${MAKE_DIR}"
|
||||
rm -rf "kubernetes-server-linux-amd64.tar.gz" "kubernetes"
|
||||
fi
|
||||
|
||||
CURR_DIR=`pwd`
|
||||
cd ${KUBE_ROOT}/cluster/images/kubemark
|
||||
cd "${MAKE_DIR}"
|
||||
make
|
||||
rm kubemark
|
||||
cd $CURR_DIR
|
||||
|
||||
MASTER_NAME="hollow-cluster-master"
|
||||
|
@ -49,17 +65,26 @@ gcloud compute instances create ${MASTER_NAME} \
|
|||
|
||||
MASTER_IP=`gcloud compute instances describe hollow-cluster-master --zone=${ZONE} | grep networkIP | cut -f2 -d":" | sed "s/ //g"`
|
||||
|
||||
until gcloud compute ssh --zone=${ZONE} hollow-cluster-master --command="ls" &> /dev/null; do
|
||||
until gcloud compute ssh --zone="${ZONE}" hollow-cluster-master --command="ls" &> /dev/null; do
|
||||
sleep 1
|
||||
done
|
||||
|
||||
gcloud compute copy-files --zone=${ZONE} \
|
||||
${KUBE_ROOT}/_output/release-tars/kubernetes-server-linux-amd64.tar.gz \
|
||||
${KUBE_ROOT}/test/kubemark/start-kubemark-master.sh \
|
||||
${KUBE_ROOT}/test/kubemark/configure-kubectl.sh \
|
||||
hollow-cluster-master:~
|
||||
if [ "${RUN_FROM_DISTRO}" == "false" ]; then
|
||||
gcloud compute copy-files --zone="${ZONE}" \
|
||||
"${KUBE_ROOT}/_output/release-tars/kubernetes-server-linux-amd64.tar.gz" \
|
||||
"${KUBE_ROOT}/test/kubemark/start-kubemark-master.sh" \
|
||||
"${KUBE_ROOT}/test/kubemark/configure-kubectl.sh" \
|
||||
"hollow-cluster-master":~
|
||||
else
|
||||
gcloud compute copy-files --zone="${ZONE}" \
|
||||
"${KUBE_ROOT}/server/kubernetes-server-linux-amd64.tar.gz" \
|
||||
"${KUBE_ROOT}/test/kubemark/start-kubemark-master.sh" \
|
||||
"${KUBE_ROOT}/test/kubemark/configure-kubectl.sh" \
|
||||
"hollow-cluster-master":~
|
||||
fi
|
||||
|
||||
gcloud compute ssh --zone=${ZONE} hollow-cluster-master --command="chmod a+x configure-kubectl.sh && chmod a+x start-kubemark-master.sh && sudo ./start-kubemark-master.sh"
|
||||
gcloud compute ssh --zone=${ZONE} hollow-cluster-master \
|
||||
--command="chmod a+x configure-kubectl.sh && chmod a+x start-kubemark-master.sh && sudo ./start-kubemark-master.sh"
|
||||
|
||||
sed "s/##masterip##/\"${MASTER_IP}\"/g" ${KUBE_ROOT}/test/kubemark/hollow-kubelet_template.json > ${KUBE_ROOT}/test/kubemark/hollow-kubelet.json
|
||||
sed -i'' -e "s/##numreplicas##/${NUM_MINIONS:-10}/g" ${KUBE_ROOT}/test/kubemark/hollow-kubelet.json
|
||||
|
|
Loading…
Reference in New Issue