Adding application definition for memcached

Change-Id: I68ab7a8315e38a17c89b08ae71672dee6006227a
This commit is contained in:
Andrey Pavlov 2016-06-08 18:08:29 +03:00
parent 21b89cb770
commit 6e97ed6a71
7 changed files with 21 additions and 28 deletions

View File

@ -1,8 +1,6 @@
FROM {{ namespace }}/base-tools:{{ tag }}
MAINTAINER {{ maintainer }}
ENV DEBIAN_FRONTEND "noninteractive"
RUN apt-get update \
&& apt-get install -q -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" memcached \
&& rm -rf /var/lib/apt/lists/* \
@ -10,9 +8,3 @@ RUN apt-get update \
RUN useradd --user-group memcached \
&& usermod -a -G microservices memcached
USER memcached
EXPOSE 11211
# ChancheMe to template in future
CMD ["memcached", "-v", "-u", "memcached", "-l", "0.0.0.0", "-m", "256"]

View File

@ -0,0 +1,4 @@
configs:
memcached_addr: 0.0.0.0
memcached_port: 11211
memcached_ram: 256

View File

@ -1,16 +0,0 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: memcached-deployment
spec:
replicas: 3
template:
metadata:
labels:
app: memcached
spec:
containers:
- name: memcached
image: nextgen/memcached:v1
ports:
- containerPort: 11211

10
service/memcached.yaml Normal file
View File

@ -0,0 +1,10 @@
service:
name: memcached
ports:
- memcached_port
probes:
readiness: "true"
liveness: "true"
daemon:
command: memcached -v -u memcached -l {{ memcached_addr }} -m {{ memcached_ram }}
user: memcached

4
test-requirements.txt Normal file
View File

@ -0,0 +1,4 @@
docker-py
docker-compose
requests==2.7.0
pytest

View File

@ -1,4 +1,5 @@
memcached:
image: mcp/memcached
image: memcachedbuild/memcached:latest
ports:
- 11219:11211
command: "memcached -v -u memcached -l 127.0.0.1"

View File

@ -8,9 +8,7 @@ commands = bash -c "exit 0"
[testenv:py27]
deps =
docker-py
docker-compose
pytest
-r{toxinidir}/test-requirements.txt
changedir={toxinidir}/tests
commands =
py.test -vv {posargs}