common_volume_mounts and common_containers macros

Two new macros for further code optimization

TrivialFix

Change-Id: I4f3995579039862a5b3422ce1db4b2b7af0d5a47
This commit is contained in:
Serguei Bezverkhi
2016-09-28 18:36:13 -04:00
parent 789dae66ac
commit 271d3c6547
52 changed files with 318 additions and 674 deletions

View File

@@ -1,3 +1,5 @@
{%- set resourceName = kolla_kubernetes.cli.args.resource_name %}
{%- import "services/common/common-lib.yml.j2" as lib with context %}
apiVersion: v1
kind: ReplicationController
spec:
@@ -18,11 +20,9 @@ spec:
- image: "{{ memcached_image_full }}"
name: main
volumeMounts:
{{ lib.common_volume_mounts(indent=12) }}
- mountPath: {{ container_config_directory }}
name: memcached-config
- mountPath: /etc/localtime
name: host-etc-localtime
readOnly: true
env:
- name: KOLLA_CONFIG_STRATEGY
value: {{ config_strategy }}
@@ -30,13 +30,10 @@ spec:
- containerPort: {{ memcached_port }}
name: memcached
volumes:
{{ lib.common_volumes(indent=8) }}
- name: memcached-config
configMap:
name: memcached
- name: host-etc-localtime
hostPath:
path: /etc/localtime
metadata:
name: memcached
namespace: {{ kolla_kubernetes_namespace }}