--- # 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: containers: - name: mcrouter image: vexxhost/mcrouter:latest args: ["-p", "11211", "-f", "/data/config.json"] imagePullPolicy: Always ports: - name: mcrouter containerPort: 11211 livenessProbe: tcpSocket: port: mcrouter readinessProbe: tcpSocket: port: mcrouter resources: limits: cpu: 50m ephemeral-storage: 50M memory: 128M requests: cpu: 10m ephemeral-storage: 50M memory: 64M securityContext: runAsUser: 1001 volumeMounts: - mountPath: /data name: config - name: exporter image: vexxhost/mcrouter_exporter:latest args: ["-mcrouter.address", "localhost:11211"] imagePullPolicy: Always ports: - name: metrics containerPort: 9442 livenessProbe: httpGet: path: /metrics port: metrics readinessProbe: httpGet: path: /metrics 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 %}