add ability to mount single config file
Change-Id: I328d73b6ee80410ad633fded1ef35d3ceeb77f2a
diff --git a/README.rst b/README.rst
index 0ee5fa5..e2be335 100644
--- a/README.rst
+++ b/README.rst
@@ -568,6 +568,19 @@
key: policy.json
path: policy.json
+To mount single configuration file instead of whole directory:
+
+.. code-block:: yaml
+
+ service:
+ memcached:
+ container:
+ memcached:
+ volumes:
+ - name: volume1
+ mountPath: /volume/config.conf
+ sub_path: config.conf
+
Generating Jobs
===============
diff --git a/kubernetes/files/rc.yml b/kubernetes/files/rc.yml
index 04f737d..e012918 100644
--- a/kubernetes/files/rc.yml
+++ b/kubernetes/files/rc.yml
@@ -85,7 +85,10 @@
{%- for volume in container.volumes %}
- name: {{ volume.name }}
mountPath: {{ volume.mount }}
- readOnly: {{ volume.read_only }}
+ readOnly: {{ volume.get('read_only', 'False') }}
+ {%- if volume.sub_path is defined %}
+ subPath: {{ volume.sub_path }}
+ {%- endif %}
{%- endfor %}
{%- endif %}
{%- if container.liveness_probe is defined %}