Allow full customisation of kube image binaries

The location of the binaries in these images can be overridden by
setting ENV in the header blocks, but if an operator wants to use a
different install method all together (e.g. rpm), these blocks will
allow that.

Also import the macros in kube-base to allow their use in overrides.

Change-Id: I3e52e315f0103d8a1c95d4489fa3841900fdff75
This commit is contained in:
Paul Bourke 2017-02-22 12:04:11 +00:00
parent 1fbe35815c
commit d0f84b491c
6 changed files with 12 additions and 0 deletions

View File

@ -5,9 +5,11 @@ ENV KUBERNETES_COMPONENT=kube-apiserver
{% block kube_apiserver_amd64_header %}{% endblock %}
{% block kube_apiserver_amd64_install %}
RUN true \
&& curl -L ${KUBERNETES_DOWNLOAD_ROOT}/${KUBERNETES_COMPONENT} -o /usr/bin/${KUBERNETES_COMPONENT} \
&& chmod +x /usr/bin/${KUBERNETES_COMPONENT}
{% endblock %}
# Clear any customisation by Kolla to entrypoint & command
ENTRYPOINT []

View File

@ -7,4 +7,6 @@ ENV KUBERNETES_DOWNLOAD_ROOT=https://storage.googleapis.com/kubernetes-release/r
{% block kube_base_header %}{% endblock %}
{% import "macros.j2" as macros with context %}
{% block kube_base_footer %}{% endblock %}

View File

@ -18,9 +18,11 @@ ENV KUBERNETES_COMPONENT=kube-controller-manager
{% endif %}
{{ macros.install_packages(ceph_support_packages | customizable("packages")) }}
{% block kube_controller_manager_amd64_install %}
RUN true \
&& curl -L ${KUBERNETES_DOWNLOAD_ROOT}/${KUBERNETES_COMPONENT} -o /usr/bin/${KUBERNETES_COMPONENT} \
&& chmod +x /usr/bin/${KUBERNETES_COMPONENT}
{% endblock %}
# Clear any customisation by Kolla to entrypoint & command
ENTRYPOINT []

View File

@ -5,10 +5,12 @@ ENV KUBERNETES_COMPONENT=kube-discovery
{% block kube_discovery_amd64_header %}{% endblock %}
{% block kube_discovery_amd64_install %}
# To match upstream we load the binary to /usr/local/bin
RUN true \
&& curl -L ${KUBERNETES_DOWNLOAD_ROOT}/${KUBERNETES_COMPONENT} -o /usr/local/bin/${KUBERNETES_COMPONENT} \
&& chmod +x /usr/local/bin/${KUBERNETES_COMPONENT}
{% endblock %}
# Clear any customisation by Kolla to entrypoint & command
ENTRYPOINT []

View File

@ -5,9 +5,11 @@ ENV KUBERNETES_COMPONENT=kube-proxy
{% block kube_proxy_amd64_header %}{% endblock %}
{% block kube_proxy_amd64_install %}
RUN true \
&& curl -L ${KUBERNETES_DOWNLOAD_ROOT}/${KUBERNETES_COMPONENT} -o /usr/bin/${KUBERNETES_COMPONENT} \
&& chmod +x /usr/bin/${KUBERNETES_COMPONENT}
{% endblock %}
# Clear any customisation by Kolla to entrypoint & command
ENTRYPOINT []

View File

@ -5,9 +5,11 @@ ENV KUBERNETES_COMPONENT=kube-scheduler
{% block kube_scheduler_amd64_header %}{% endblock %}
{% block kube_scheduler_amd64_install %}
RUN true \
&& curl -L ${KUBERNETES_DOWNLOAD_ROOT}/${KUBERNETES_COMPONENT} -o /usr/bin/${KUBERNETES_COMPONENT} \
&& chmod +x /usr/bin/${KUBERNETES_COMPONENT}
{% endblock %}
# Clear any customisation by Kolla to entrypoint & command
ENTRYPOINT []