aboutsummaryrefslogtreecommitdiff
path: root/docker/macros.j2
diff options
context:
space:
mode:
authorMarcin Juszkiewicz <marcin.juszkiewicz@linaro.org>2017-05-12 14:22:29 +0200
committerMarcin Juszkiewicz <marcin.juszkiewicz@linaro.org>2017-05-12 14:22:29 +0200
commit43de60caaf7cc592b6397c844ef35b2f66e8dd4b (patch)
tree54ec31c6d3be35c7ba02c405c1d42dc2ee3ac9d2 /docker/macros.j2
parent2e438918384447d52c958d61b9a377c375ec932b (diff)
downloadkolla-43de60caaf7cc592b6397c844ef35b2f66e8dd4b.tar.gz
kolla-43de60caaf7cc592b6397c844ef35b2f66e8dd4b.zip
introduce 'install_kubectl' macro
Both kubetoolbox and magnum-conductor install 'kubectl'. In different versions. And only for x86-64. New macro knows how to handle other architectures. AArch64 binary is fetched properly, other architectures (ppc64le for now) gets info that there is no binary upstream. Also updated to v1.5.4 as this one is used by kube/* images. Change-Id: Ia491d6ec7156201742f28b5d1018f2794529b5b4 Partially-Implements: blueprint multiarch-and-arm64-containers
Diffstat (limited to 'docker/macros.j2')
-rw-r--r--docker/macros.j214
1 files changed, 14 insertions, 0 deletions
diff --git a/docker/macros.j2 b/docker/macros.j2
index e40206071..479d33ff8 100644
--- a/docker/macros.j2
+++ b/docker/macros.j2
@@ -48,3 +48,17 @@ RUN apt-get -y install --no-install-recommends haproxy \
&& apt-get -y install -f \
&& apt-get clean
{% endmacro %}
+
+{% macro install_kubectl() %}
+ {% if base_arch == 'x86_64' %}
+ ENV KUBE_ARCH=amd64
+ {% elif base_arch == 'aarch64' %}
+ ENV KUBE_ARCH=arm64
+ {% else %}
+ RUN echo 'There is no "kubectl" binary for {{ base_arch }}' \
+ && /bin/false
+ {% endif %}
+
+ RUN curl -o /usr/bin/kubectl http://storage.googleapis.com/kubernetes-release/release/v1.5.4/bin/linux/${KUBE_ARCH}/kubectl \
+ && chmod 755 /usr/bin/kubectl
+{% endmacro %}