{%- set resourceName = kolla_kubernetes.cli.args.resource_name %}
{%- import "services/common/common-lib.yml.j2" as lib with context %}
apiVersion: v1
kind: ReplicationController
spec:
  replicas: {{ memcached_replicas }}
  selector:
      service: memcached
  template:
    metadata:
      labels:
        service: memcached
    spec:
      nodeSelector:
{%- set selector = kolla_kubernetes_hostlabel_memcached |
                       default(kolla_kubernetes_hostlabel_controller)
%}
          {{ selector.key }}: {{ selector.value }}
      containers:
        - image: "{{ memcached_image_full }}"
          name: main
          volumeMounts:
{{ lib.common_volume_mounts(indent=12) }}
            - mountPath: {{ container_config_directory }}
              name: memcached-config
          env:
            - name: KOLLA_CONFIG_STRATEGY
              value: {{ config_strategy }}
          ports:
            - containerPort: {{ memcached_port }}
              name: memcached
      volumes:
{{ lib.common_volumes(indent=8) }}
        - name: memcached-config
          configMap:
            name: memcached
metadata:
   name: memcached
   namespace: {{ kolla_kubernetes_namespace }}
