apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: memcached-frontend
  namespace: logging
spec:
  replicas: 3
  selector:
    matchLabels:
      name: memcached-frontend
  serviceName: memcached-frontend
  template:
    metadata:
      labels:
        name: memcached-frontend
    spec:
      affinity:
        podAntiAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
          - labelSelector:
              matchLabels:
                name: memcached-frontend
            topologyKey: kubernetes.io/hostname
      containers:
      - args:
        - -m 1024
        - -I 5m
        - -c 1024
        - -v
        image: quay.io/cybozu/memcached
        imagePullPolicy: IfNotPresent
        name: memcached
        ports:
        - containerPort: 11211
          name: client
        resources:
          limits:
            cpu: "3"
            memory: 1536Mi
          requests:
            cpu: 500m
            memory: 1329Mi
      - args:
        - --memcached.address=localhost:11211
        - --web.listen-address=0.0.0.0:9150
        image: quay.io/cybozu/memcached-exporter
        imagePullPolicy: IfNotPresent
        name: exporter
        ports:
        - containerPort: 9150
          name: http-metrics
  updateStrategy:
    type: RollingUpdate
