From 46b41d2fadbe8cf52193176bf1f530e0121af15e Mon Sep 17 00:00:00 2001 From: Serguei Bezverkhi Date: Mon, 10 Oct 2016 21:27:42 -0400 Subject: [PATCH] Adding kubetoolbox image This PS adds kubetoolbox image which is required for Kubernetes fencing pod. This image includes, kubectl binary, ceph-common and ipmi. Change-Id: I17b2a47b95ed7dea391f1427a41c92b15c97986d Partially-Implements: blueprint kubernetes-toolbox --- ansible/roles/common/defaults/main.yml | 4 ++++ docker/kubetoolbox/Dockerfile.j2 | 32 ++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 docker/kubetoolbox/Dockerfile.j2 diff --git a/ansible/roles/common/defaults/main.yml b/ansible/roles/common/defaults/main.yml index a10e55f466..8e93160512 100644 --- a/ansible/roles/common/defaults/main.yml +++ b/ansible/roles/common/defaults/main.yml @@ -21,3 +21,7 @@ cron_image_full: "{{ cron_image }}:{{ cron_tag }}" fluentd_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-fluentd" fluentd_tag: "{{ openstack_release }}" fluentd_image_full: "{{ fluentd_image }}:{{ fluentd_tag }}" + +kubetoolbox_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-kubetoolbox" +kubetoolbox_tag: "{{ openstack_release }}" +kubetoolbox_image_full: "{{ kubetoolbox_image }}:{{ kubetoolbox_tag }}" diff --git a/docker/kubetoolbox/Dockerfile.j2 b/docker/kubetoolbox/Dockerfile.j2 new file mode 100644 index 0000000000..59db2d8f31 --- /dev/null +++ b/docker/kubetoolbox/Dockerfile.j2 @@ -0,0 +1,32 @@ +FROM {{ namespace }}/{{ image_prefix }}base:{{ tag }} +MAINTAINER {{ maintainer }} + +{% block kubetoolbox_header %}{% endblock %} + +{% import "macros.j2" as macros with context %} + +{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %} + + {% set kubetoolbox_packages = [ + 'jq', + 'ceph-common', + 'ipmitool' + ] %} + +{% elif base_distro in ['ubuntu', 'debian'] %} + + {% set kubetoolbox_packages = [ + 'jq', + 'ceph-common', + 'ipmitool' + ] %} +{% endif %} + +{{ macros.install_packages(kubetoolbox_packages | customizable("packages")) }} + +RUN curl -o /usr/bin/kubectl http://storage.googleapis.com/kubernetes-release/release/v1.4.0/bin/linux/amd64/kubectl \ + && chmod 755 /usr/bin/kubectl + +{% block kubetoolbox_footer %}{% endblock %} +{% block footer %}{% endblock %} +{{ include_footer }}