diff --git a/Documentation/kubernetes.md b/Documentation/kubernetes.md index a50fc4849..8eddde421 100644 --- a/Documentation/kubernetes.md +++ b/Documentation/kubernetes.md @@ -57,7 +57,7 @@ For a walkthrough of the three types of storage exposed by Rook, see the guides ### Rook Client You also have the option to use the `rook` client tool directly by running it in a pod that can be started in the cluster with: ```bash -kubectl create -f rook-client/rook-client.yml +kubectl create -f rook-client.yml # Starting the rook-client pod will take a bit of time to download the container, so check when it's in the Running state kubectl -n rook get pod rook-client diff --git a/build/release/containers.sh b/build/release/containers.sh index 07f5847d3..d3524b833 100755 --- a/build/release/containers.sh +++ b/build/release/containers.sh @@ -33,8 +33,13 @@ build_artifact() { local name=$(get_image_name $os $arch $repo ${RELEASE_VERSION}) + local docker_no_cache= + if [[ ${RELEASE_CHANNEL} != "" ]]; then + docker_no_cache=--no-cache + fi + echo building docker container ${name} - docker build --pull --no-cache -t ${registry}${name} $tmpdir + docker build --pull ${docker_no_cache} -t ${registry}${name} $tmpdir local file=${name/\//-} local file=${file/:/-} @@ -59,6 +64,7 @@ build() { arm64) baseimage=aarch64/alpine ;; esac + echo "Building the rookd container" tmpdir=$(mktemp -d) trap "rm -fr $tmpdir" EXIT cat < $tmpdir/Dockerfile @@ -69,6 +75,50 @@ ENTRYPOINT ["/usr/bin/rookd"] EOF build_artifact $os $arch $tmpdir rook/rookd rookd rm -fr $tmpdir + + # TODO: build the client and toolbox for arm + [[ ${arch} == "amd64" ]] || return 0 + + echo "Building the rook-client container" + mkdir $tmpdir + cat < $tmpdir/Dockerfile +FROM ubuntu +RUN apt-get update && \ + apt-get install -yq --no-install-recommends wget s3cmd kmod module-init-tools sudo +COPY root / +ENTRYPOINT ["/usr/bin/rook"] +EOF + build_artifact $os $arch $tmpdir rook/rook-client rook + rm -fr $tmpdir + + echo "Building the toolbox container" + mkdir $tmpdir + cp toolbox/entrypoint.sh $tmpdir + cat < $tmpdir/Dockerfile +FROM ubuntu:xenial +RUN apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 08b73419ac32b4e966c1a330e84ac2c0460f3994 \ + && echo "deb http://download.ceph.com/debian-${CEPH_BRANCH}/ xenial main" > /etc/apt/sources.list.d/ceph-${CEPH_BRANCH}.list \ + && apt-get update \ + && DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends \ + binutils \ + ceph-common \ + curl \ + fio \ + gdb \ + iperf3 \ + jq \ + kmod \ + less \ + man-db \ + sudo \ + vim \ + && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* +COPY root / +COPY entrypoint.sh /toolbox/ +ENTRYPOINT [ "/toolbox/entrypoint.sh" ] +EOF + build_artifact $os $arch $tmpdir rook/toolbox rook + rm -fr $tmpdir } publish_artifact() { @@ -148,8 +198,9 @@ cleanup() { local arch=$2 [[ ${os} == "linux" ]] || return 0 - cleanup_artifact $os $arch rook/rookd + cleanup_artifact $os $arch rook/rook-client + cleanup_artifact $os $arch rook/toolbox } action=$1 diff --git a/demo/kubernetes/rook-client/rook-client.yml b/demo/kubernetes/rook-client.yml similarity index 92% rename from demo/kubernetes/rook-client/rook-client.yml rename to demo/kubernetes/rook-client.yml index 3efb05105..d8592837a 100644 --- a/demo/kubernetes/rook-client/rook-client.yml +++ b/demo/kubernetes/rook-client.yml @@ -6,7 +6,7 @@ metadata: spec: containers: - name: rook-client - image: quay.io/rook/rook-client:latest + image: quay.io/rook/rook-client:master-latest imagePullPolicy: IfNotPresent command: ["sleep", "36500d"] securityContext: diff --git a/demo/kubernetes/rook-client/Dockerfile b/demo/kubernetes/rook-client/Dockerfile deleted file mode 100644 index 6f1b9eb5a..000000000 --- a/demo/kubernetes/rook-client/Dockerfile +++ /dev/null @@ -1,16 +0,0 @@ -FROM ubuntu -MAINTAINER Jared Watts - -ENV ROOK_VERSION 0.3.1 - -RUN apt-get update && \ - apt-get install -yq --no-install-recommends wget s3cmd kmod module-init-tools sudo - -RUN wget --no-check-certificate -P /tmp https://github.com/rook/rook/releases/download/v${ROOK_VERSION}/rook-v${ROOK_VERSION}-linux-amd64.tar.gz && \ - gunzip /tmp/rook-v${ROOK_VERSION}-linux-amd64.tar.gz && \ - tar -xf /tmp/rook-v${ROOK_VERSION}-linux-amd64.tar -C /tmp && \ - mv /tmp/rook /usr/local/bin/ && \ - chmod 0755 /usr/local/bin/rook && \ - rm -rf /tmp/rook* - - diff --git a/toolbox/Dockerfile b/toolbox/Dockerfile deleted file mode 100644 index e6a8332bb..000000000 --- a/toolbox/Dockerfile +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright 2016 The Rook Authors. 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. - -FROM ubuntu:xenial -MAINTAINER Jared Watts - -# install common tools for debugging and testing (including ceph Kraken) -RUN apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 08b73419ac32b4e966c1a330e84ac2c0460f3994 \ - && echo "deb http://download.ceph.com/debian-kraken/ xenial main" > /etc/apt/sources.list.d/ceph-kraken.list \ - && apt-get update \ - && DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends \ - binutils \ - ceph-common \ - curl \ - fio \ - gdb \ - iperf3 \ - jq \ - kmod \ - less \ - man-db \ - sudo \ - vim \ - && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* - -ENV ROOK_VERSION v0.3.1 -RUN cd /tmp && \ - curl -s -L https://github.com/rook/rook/releases/download/${ROOK_VERSION}/rook-${ROOK_VERSION}-linux-amd64.tar.gz > rook.tar.gz && \ - tar xvf rook.tar.gz && \ - mv rook /usr/bin/ && \ - chown root:root /usr/bin/rook && \ - rm -fr rook* - -COPY entrypoint.sh /toolbox/ -ENTRYPOINT [ "/toolbox/entrypoint.sh" ] diff --git a/toolbox/rook-tools.yml b/toolbox/rook-tools.yml index c2168a998..3f5c1bdbe 100644 --- a/toolbox/rook-tools.yml +++ b/toolbox/rook-tools.yml @@ -6,7 +6,7 @@ metadata: spec: containers: - name: rook-tools - image: quay.io/rook/toolbox:latest + image: quay.io/rook/toolbox:master-latest imagePullPolicy: IfNotPresent args: ["sleep", "36500d"] env: