openstack-operator/openstack_operator/templates/mcrouter/deployment.yml.j2
okozachenko 809caecd82 Remove default service token from all pod spec
Change-Id: I3c182806245056bfc87c8737a7ffbf611614b2af
2020-07-24 16:50:56 +03:00

103 lines
2.7 KiB
Django/Jinja

---
# Copyright 2020 VEXXHOST, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
apiVersion: apps/v1
kind: Deployment
metadata:
name: mcrouter-{{ name }}
labels:
{{ labels("mcrouter", name) | indent(4) }}
spec:
replicas: 2
selector:
matchLabels:
{{ labels("mcrouter", name) | indent(6) }}
template:
metadata:
labels:
{{ labels("mcrouter", name) | indent(8) }}
spec:
automountServiceAccountToken: false
containers:
- name: mcrouter
image: vexxhost/mcrouter:latest
args: ["-p", "11211", "-f", "/data/config.json"]
imagePullPolicy: Always
ports:
- name: mcrouter
protocol: TCP
containerPort: 11211
livenessProbe:
tcpSocket:
port: mcrouter
readinessProbe:
tcpSocket:
port: mcrouter
resources:
limits:
cpu: 100m
ephemeral-storage: 50M
memory: 128M
requests:
cpu: 50m
ephemeral-storage: 50M
memory: 64M
securityContext:
runAsUser: 999
runAsGroup: 999
volumeMounts:
- mountPath: /data
name: config
- name: exporter
image: vexxhost/mcrouter_exporter:latest
args: ["-mcrouter.address", "127.0.0.1:11211", "-mcrouter.timeout", "3s"]
imagePullPolicy: Always
ports:
- name: metrics
protocol: TCP
containerPort: 9442
livenessProbe:
httpGet:
path: /
port: metrics
readinessProbe:
httpGet:
path: /
port: metrics
resources:
limits:
cpu: 100m
ephemeral-storage: 10M
memory: 64Mi
requests:
cpu: 50m
ephemeral-storage: 10M
memory: 32Mi
securityContext:
runAsUser: 1001
volumes:
- configMap:
defaultMode: 420
name: mcrouter-{{ name }}
name: config
{% if 'nodeSelector' in spec %}
nodeSelector:
{{ spec.nodeSelector | to_yaml | indent(8) }}
{% endif %}
{% if 'tolerations' in spec %}
tolerations:
{{ spec.tolerations | to_yaml | indent(8) }}
{% endif %}